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
end
end
Right now I don't really dig hirb
, but if there is a solution that works with hirb
or irb
, I'll give it a shot! Thanks for your help!