lib/pry-singular.rb in pry-singular-0.1.3 vs lib/pry-singular.rb in pry-singular-0.1.4
- old
+ new
@@ -23,11 +23,11 @@
singular_methods = adapt_options_singleton_methods(klass, options)
set_pry_command do
singular_methods.each do |klass_method|
command "#{klass_method}", "#{klass}.#{klass_method}" do
klass.class_eval <<-EOS
- #{Readline::HISTORY.to_a.last.gsub(' ', '')}
+ #{parse_readline!(Readline::HISTORY.to_a.last)}
EOS
end
end
end
end
@@ -40,8 +40,13 @@
def adapt_options_singleton_methods(klass, options)
if options[:only].any?
return options[:only].select { |method_name| klass.respond_to?(method_name) }
end
klass.singleton_methods - options[:except]
+ end
+
+ def parse_readline!(readline_history_element)
+ method, args = readline_history_element.split(" ", 2)
+ method + ' ' + args.gsub(' ', '')
end
end
end