hirb

Extend IRB main methods

血红的双手。 提交于 2019-12-08 10:17:29
问题 I have a directory structure in my app. For development purposes (and possibly beyond), I currently have a class X which has class methods pwd , cd , and ls . Is there a way to make these methods available when I enter irb whithin my app, for example: 2.1.5 :0 > pwd /current_dir/ Currently I am doing: 2.1.5 :0 > X.pwd /current_dir/ which is simply inconvenient. A solution where I could simply add something to my existing class would be perfect, like: class X < Irb::main def self.pwd #stuff

Hirb doesn't work at all in rails console

纵饮孤独 提交于 2019-12-06 13:27:29
问题 I followed the tutorial on hirb rdoc but unfortunately, my rails console is not working at all. I've already done sudo gem install hirb and added hirb to my Gemfile: gem 'hirb', '~>0.7.0' Then I launched bundle install And I get this result : rails c Loading development environment (Rails 3.2.11) > require 'hirb' => false > Hirb.enable => true > Municipality.all Municipality Load (0.8ms) SELECT "municipalities".* FROM "municipalities" ORDER BY name asc => [#<Municipality id: 1, district_id: 6