Sha256: 347b7c1f5f5b5e4e606c6b4390ee60dd9c87699fe3523f075da4d60208462b3b

Contents?: true

Size: 635 Bytes

Versions: 6

Compression:

Stored size: 635 Bytes

Contents

LuxCli.class_eval do
  desc :evaluate, 'Eval ruby string in context of Lux::Application'
  def evaluate *args
    require './config/application'

    Lux.start

    if File.exist?('./config/console.rb')
      puts '* loading ./config/console.rb'
      load './config/console.rb'
    end

    command = ARGV.drop(1).join('; ')

    puts 'Command : %s' % command.light_blue

    data = eval command

    puts '-'
    puts 'Class   : %s' % data.class
    puts '-'

    if data.is_a?(String) && data.include?('</body>')
      require 'nokogiri'
      puts Nokogiri::XML(data, &:noblanks)
    else
      ap data
    end

    exit
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lux-fw-0.5.37 ./bin/cli/eval.rb
lux-fw-0.5.36 ./bin/cli/eval.rb
lux-fw-0.5.35 ./bin/cli/eval.rb
lux-fw-0.5.34 ./bin/cli/eval.rb
lux-fw-0.5.33 ./bin/cli/eval.rb
lux-fw-0.5.32 ./bin/cli/eval.rb