ruby

順序付きのHash OrderedHash

$ script/console Loading development environment (Rails 2.3.2) >> RUBY_VERSION => "1.8.7" >> ActiveSupport::OrderedHash.new(:a => 1, :b => 2) => #<OrderedHash {}> >> ActiveSupport::OrderedHash.new([[:a, 1], [:b, 2]]) => #<OrderedHash {}> >> hash = ActiveSupport::OrderedH</orderedhash></orderedhash>…

@reminders.map(&:id)

app/controllers/reminders_controller.rb from authorNari's brushup - GitHub @reminders.map(&:id) 動作 ruby 1.8.7 irb ○ ruby 1.8.6でRails 2.3.2 script/console ○ ruby 1.8.6 irb TypeError: wrong argument type Symbol (expected Proc) 別の書き方…

RubyGems の設定ファイル

オプションのデフォルトを設定するには、~/.gemrc か /etc/gemrc を作成する $ gem help environment (省略) Command line argument defaults and some RubyGems defaults can be set in ~/.gemrc file for individual users and a /etc/gemrc for all users…

croc インストールしたgemのドキュメントをブラウザでインクリメンタル検索

install $ gem install croc Successfully installed croc-1.0.0 1 gem installed Installing ri documentation for croc-1.0.0... Installing RDoc documentation for croc-1.0.0... $ croc /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in …

Cygwin + Rails + SQLite3

Cygwin Ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin] SQLite3 3.6.2 RubyGems 1.3.1 Ruby on Rails 2.2.2 sqlite3-ruby 1.2.4 RSpec 1.1.12 RSpec on Rails 1.1.12 rcov 0.8.1.2.0 ZenTest 4.0.0 Cygwin [Devel]-[cygport] [Devel]-[gcc] [Interpre…

gemファイルの依存関係を調べる

RubyGems で Ruby on Rails 2.2.2 の依存関係をリモートで調べる gem dependency rails --version 2.2.2 --remote Gem rails-2.2.2 rake (>= 0.8.3, runtime) activesupport (= 2.2.2, runtime) activerecord (= 2.2.2, runtime) actionpack (= 2.2.2, runti…