Skip to content

Instantly share code, notes, and snippets.

require 'irb/completion'
require 'irb/ext/save-history'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
IRB.conf[:SAVE_HISTORY] = 100
if ENV['RAILS_ENV']
rr = IRB.conf[:LOAD_MODULES].detect{|x| x =~ /environment$/}.gsub(/config\/environment$/, '')
IRB.conf[:HISTORY_FILE] = File.join(rr, '.irb_history')
else
IRB.conf[:HISTORY_FILE] = File.join(ENV['HOME'], '.irb_history')
// TODO
// show spinner on loading
//
// element.identify() is a prototype function -- remove it so
// there are less methods to overwrite when switching backend
// also: addClassName / RemoveClassName
//
// clean up the namespace -- instead of long function names in the window
// have descriptive names in their own class
//
require 'yaml'
def spit_context context, level=0
spaces = " " * level
puts "#{spaces}context '#{context[0]}' do"
puts "#{spaces} setup do\n#{spaces} end\n\n"
spit_specs(context[1], level)
puts "#{spaces}end\n\n"
end