Sha256: 513be8df504ebefc47872bbe9d46e1459ba7c0c009d65f1065310137f7d557e8
Contents?: true
Size: 1005 Bytes
Versions: 2
Compression:
Stored size: 1005 Bytes
Contents
#!/usr/bin/env ruby load_start = Time.now require 'awesome_print' require 'clipboard' require './config/application' Lux.config.show_server_errors = true Lux.config.log_to_stdout = true 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
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lux-fw-0.2.3 | ./bin/cli/console |
lux-fw-0.2.1 | ./bin/cli/console |