lib/rib/runner.rb in rib-1.5.1 vs lib/rib/runner.rb in rib-1.5.2

- old
+ new

@@ -1,9 +1,9 @@ require 'rib' -module Rib::Runner +module Rib; module Runner module_function def options @options ||= [['ruby options:' , '' ], ['-e, --eval LINE' , @@ -58,11 +58,12 @@ 'rack' => 'Run as Rack console' } end # Extract the text below __END__ in the bin file as the description def command_descriptions_find path - File.read(path) =~ /Gem\.bin_path\(['"](.+)['"], ['"](.+)['"],/ + # FIXME: Can we do better? This is not reliable + File.read(path) =~ /Gem\.activate_bin_path\(['"](.+)['"], ['"](.+)['"],/ (File.read(Gem.bin_path($1, $2))[/\n__END__\n(.+)$/m, 1] || '').strip end def run argv=ARGV (@running_commands ||= []) << Rib.config[:name] @@ -183,6 +184,6 @@ def which_bin bin # handle windows here `which #{bin}`.strip rescue Errno::ENOENT # probably a windows platform, try where `where #{bin}`.lines.first.strip end -end +end; end