<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>noqisofon</author_name>
  <author_url>https://blog.hatena.ne.jp/noqisofon/</author_url>
  <blog_title>想像力の欠如は深刻な欠点の一つである。</blog_title>
  <blog_url>https://noqisofon.hatenablog.com/</blog_url>
  <categories>
    <anon>ってみた</anon>
    <anon>Ruby</anon>
  </categories>
  <description>File クラスに入ってるけど、書いてみた。 ルールはこんな感じ。 path の一番後ろのスラッシュより前を返すこと スラッシュを含まないファイル名に対しては &quot;.&quot; を返すこと 先頭が &quot;./&quot; なファイル名に対しても &quot;.&quot; を返すこと path が &quot;C:/&quot; のようなときは、path を返す def dirname(path) directory_levels = path.split( /[\\\/]/ ) if directory_levels.length == 1 then if directory_levels.first =~ /^[A-Z]:/ then return &quot;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnoqisofon.hatenablog.com%2Fentry%2F20100215%2F1266240976&quot; title=&quot; `dirname&amp;#39; を書いてみた - 想像力の欠如は深刻な欠点の一つである。&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>2010-02-15 22:36:16</published>
  <title> `dirname' を書いてみた</title>
  <type>rich</type>
  <url>https://noqisofon.hatenablog.com/entry/20100215/1266240976</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
