Sha256: cb8b11c8a264ac3fd2703e177655be9e0e3042a1c157cf8b183a236642209a82
Contents?: true
Size: 1.04 KB
Versions: 4
Compression:
Stored size: 1.04 KB
Contents
#!/usr/bin/env ruby # encoding: utf-8 # irb = 'irb' require 'optparse' options = { :sandbox => false, :irb => irb } OptionParser.new do |opt| opt.banner = "Usage: console [environment] [options]" opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |v| options[:irb] = v } opt.parse!(ARGV) end libs = " -r irb/completion" libs << %( -r "picky" ) ENV['SEARCH_ENV'] = case ARGV.first when "p"; "production" when "d"; "development" when "t"; "test" else ARGV.first || ENV['SEARCH_ENV'] || 'development' end puts "Use \x1b[1;30mLoader.load_application\x1b[m to load app." puts "Use \x1b[1;30mIndexes.load_from_cache\x1b[m after that to load indexes." puts "Copy the following line to do just that:" puts "\x1b[1;30mLoader.load_application; Indexes.load_from_cache; nil\x1b[m" puts "" puts "Now you can for example create a query instance." puts "\x1b[1;30mfull_books = Query::Full.new(Indexes[:books]); nil\x1b[m" puts "and search on it" puts "\x1b[1;30mfull_books.search_with_text 'bla'\x1b[m" exec "#{options[:irb]} #{libs} --simple-prompt"
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
picky-0.0.5 | prototype_project/script/console |
picky-0.0.4 | prototype_project/script/console |
picky-0.0.3 | prototype_project/script/console |
picky-0.0.2 | prototype_project/script/console |