<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>potisan</author_name>
  <author_url>https://blog.hatena.ne.jp/potisan/</author_url>
  <blog_title>potisanのプログラミングメモ</blog_title>
  <blog_url>https://potisan-programming-memo.hatenablog.jp/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>Windows</anon>
  </categories>
  <description>本文 File::globで取得されたファイルパスの様に始めからRubyで取得されたファイルパスなら良いのですが、環境変数やWin32 APIが絡んでくるとパス区切りに「\」（バックスラッシュ）が使われます（DOSISH）。今回はそれにとりあえず対処するためのコードです。動作確認はWindows 7ですが、UNIXやCygwinなどではnilが設定されるそうなので何も起きないだけだと思います。 s = ENV['UserProfile'] #=&gt; &quot;C:\\Users\\&lt;UserName&gt;&quot; s.gsub(File::ALT_SEPARATOR) {File::SEPARATOR} #=&gt; …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2014%2F01%2F05%2F000000&quot; title=&quot;Ruby 2 DOSISHなパス（「\」（バックスラッシュ）区切りのパス）を整形する - potisanのプログラミングメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2014-01-05 00:00:00</published>
  <title>Ruby 2 DOSISHなパス（「\」（バックスラッシュ）区切りのパス）を整形する</title>
  <type>rich</type>
  <url>https://potisan-programming-memo.hatenablog.jp/entry/2014/01/05/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
