2012年7月19日木曜日

開発環境

『Learning Ruby』(Michael Fitzgerald 著、O'Reilly Media、2007年、ISBN978-0-596-52986-4)の Chapter 8(Working with Files)Review Questions 5を解いてみる。

その他参考書籍

5.

array

コード(TextWrangler)

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

result = Dir.entries(".")
puts "kind: #{result.class}"
result.each do |item|
  puts item
end

入出力結果(Terminal)

$ ./sample.rb
kind: Array
.
..
.DS_Store
birth_day_helper
Ruby
ruby_kamimura_blog
sample.rb
sample_folder
tcl8.4.19
tk8.4.19
tmp.txt
tmp_test
$

0 コメント:

コメントを投稿