<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>karlley_jp</author_name>
  <author_url>https://blog.hatena.ne.jp/karlley_jp/</author_url>
  <blog_title>時々とおまわり</blog_title>
  <blog_url>https://karlley.hatenablog.jp/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>フィヨルドブートキャンプの課題、Sinatraを使ったメモアプリの開発はまだまだ終わらないです😇 メモ一覧は表示できましたが作成順に並んでいないのが非常に気持ち悪い。 複数のファイルを取得して作成日時で並び替えたいなと思ったので調べてみました。 結論 Dir.glob で指定したディレクトリ内のファイルを配列で取得 File.birthtime でファイル作成日時を取得 sort_by でファイルを並び替える 指定したディレクトリ内のファイルを配列で取得 dir ディレクトリ内の拡張子がjson のファイルを配列で取得する # ディレクトリ構成 ./ ├ main.rb └ dir/ ├ 1.…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkarlley.hatenablog.jp%2Fentry%2F2022%2F06%2F03%2F111916&quot; title=&quot;複数のファイルを取得して作成日時で並び替える - 時々とおまわり&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>2022-06-03 11:19:16</published>
  <title>複数のファイルを取得して作成日時で並び替える</title>
  <type>rich</type>
  <url>https://karlley.hatenablog.jp/entry/2022/06/03/111916</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
