Hello All:
I’m trying to add jruby as the shell for our application. I’d like to
make it so that on initial presentation of the shell, noobies can do at
least do some basic operations without having to know or type a bunch of
ruby specifics. I am trying to put together a little DSL of the basic
verbs. The first verb I’d like to implement is ‘help’.
I have a little module. It looks basically like this:
Run the java magic include and import basic HBase types.
include Java
def help
puts ‘Shell Commands:’
puts ’ version Output version’
puts ’ …’
end
def version
puts ‘TODO: 0.2.x’
end
When I run jirb and pass -r to load the above, my help runs when I type
‘help’ in jirb but there’s an ugly message emitted before the shell
comes up. Here’s how it looks:
$ ./bin/hbase shell
irb: warn: can’t alias help from irb_help.
hbase(main):001:0> help
HBase Shell Commands:
version Output the hbase version
…
=> nil
hbase(main):002:0>
I can dig and see that ‘can’t alias help from irb_help’ bubbles up out
of extended irb. Does anyone know how I might suppress it?
Failing that, I’m using jruby_complete.1.1.1.jar and the unadorned help
– i.e. I don’t try and override help with my help method – I get the
following:
$ java -classpath lib/jruby-complete-1.1.1.jar org.jruby.Main --command
irb
irb(main):001:0> help
No ri documentation found in:
Was rdoc run to create documentation?
Errno::ENOENT: No such file or directory - File not found - (irb):2:in
file:/Users/stack/Documents/checkouts/hbase/trunk/lib/jruby-complete-1.1.1.jar!/builtin/javasupport/java.rb' from file:/Users/stack/Documents/checkouts/hbase/trunk/lib/jruby-complete-1.1.1.jar!/rdoc/usage.rb:100:in
initialize’
from
file:/Users/stack/Documents/checkouts/hbase/trunk/lib/jruby-complete-1.1.1.jar!/rdoc/usage.rb:100:in
open' from file:/Users/stack/Documents/checkouts/hbase/trunk/lib/jruby-complete-1.1.1.jar!/rdoc/usage.rb:100:in
usage_no_exit’
from
file:/Users/stack/Documents/checkouts/hbase/trunk/lib/jruby-complete-1.1.1.jar!/rdoc/usage.rb:93:in
usage' from file:/Users/stack/Documents/checkouts/hbase/trunk/lib/jruby-complete-1.1.1.jar!/rdoc/ri/ri_driver.rb:39:in
report_missing_documentation’
from
file:/Users/stack/Documents/checkouts/hbase/trunk/lib/jruby-complete-1.1.1.jar!/rdoc/ri/ri_driver.rb:25:in
initialize' from (eval):3:in
irb_help’
from (irb):2:in
`file:/Users/stack/Documents/checkouts/hbase/trunk/lib/jruby-complete-1.1.1.jar!/builtin/javasupport/java.rb’
I’m guessing the jruby_complete.1.1.1.jar doesn’t include rdoc. Could I
somehow hook up my own help by intercepting the above exception
outputting my own instead?
I’m new to ruby so excuse me if the above are dumb questions.
Any help appreciated.
St.Ack
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email