Sha256: 0ac56bc9d02816009138adea46ea6f4d64d036f9de604cad655d70fe237d6a57

Contents?: true

Size: 961 Bytes

Versions: 2

Compression:

Stored size: 961 Bytes

Contents

#!/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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lux-fw-0.1.35 ./bin/cli/console
lux-fw-0.1.17 ./bin/cli/console