class Object

Public Instance Methods

code(object = self, method_name) click to toggle source
# File lib/irbtools/libraries.rb, line 59
def code(object = self, method_name)
  Code.for(object, method_name)
end
colorize(string) click to toggle source

…a string

# File lib/irbtools/libraries.rb, line 66
def colorize(string)
  puts CodeRay.scan( string, :ruby ).term
end
copy(str) click to toggle source

copies the clipboard

# File lib/irbtools/libraries.rb, line 78
def copy(str)
  Clipboard.copy(str)
end
copy_output() click to toggle source

copies the output of all irb commands in this irb session

# File lib/irbtools/libraries.rb, line 88
def copy_output
  copy context.instance_variable_get(:@eval_history_values).inspect.gsub(/^\d+ (.*)/, '\1')
  "The session output history has been copied to the clipboard."
end
mf(*args, &block) click to toggle source
# File lib/irbtools/libraries.rb, line 97
def mf(*args, &block)
  args.empty? ? MethodFinder : MethodFinder.find(*args, &block)
end
output_value(_ = false) click to toggle source
# File lib/irbtools/hirb.rb, line 13
def output_value(_ = false)
  Hirb::View.view_or_page_output(@context.last_value) || non_hirb_view_output
end
page(what, options = {}) click to toggle source
# File lib/irbtools/hirb.rb, line 6
def page(what, options = {})
  Hirb::Pager.command_pager(what, options = {})
end
paste() click to toggle source

pastes the clipboard

# File lib/irbtools/libraries.rb, line 83
def paste
  Clipboard.paste
end
ray(path) click to toggle source

…a file

# File lib/irbtools/libraries.rb, line 71
def ray(path)
  print CodeRay.scan( File.read(path), :ruby ).term
end