#!/usr/bin/env ruby ENV['LUX_VERBOSE'] ||= 'true' load_start = Time.now require 'awesome_print' require 'clipboard' require './config/application' if File.exist?('./config/console.rb') puts '* loading ./config/console.rb' require './config/console' else puts '* ./config/console.rb not found' end Lux::Config.live_require_check! if Lux.config(:auto_code_reload) puts Lux::Config.show_load_speed load_start class Object def cp data data = JSON.pretty_generate(data.to_hash) if data.respond_to?(:to_hash) Clipboard.copy data 'copied' end end begin require 'pry' # AwesomePrint.pry! # nice object dump in console Pry.print = proc { |output, data| out = if data.is_a?(Hash) data.class.to_s+"\n"+JSON.pretty_generate(data).gsub(/"(\w+)":/) { '"%s":' % $1.yellow } else data.ai end output.puts out } Pry rescue LoadError puts 'pry not found, starting irb'.red require 'irb' IRB end.start