Sha256: 962f172bc66446ed524196d2a4185eb33870c8c8f2fd59c378f1f4176404b752

Contents?: true

Size: 383 Bytes

Versions: 8

Compression:

Stored size: 383 Bytes

Contents

class Jets::Commands::Runner
  def self.run(code, args=nil)
    if code =~ %r{^file://}
      path = code.sub('file://', '')
      full_path = "#{Jets.root}/#{path}"
      if File.exist?(full_path)
        code = IO.read(full_path)
      else
        puts "ERROR: file not found at #{full_path}".color(:red)
        exit 1
      end
    end

    eval(code) # inline script
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jets-4.0.12 lib/jets/commands/runner.rb
jets-4.0.11 lib/jets/commands/runner.rb
jets-4.0.10 lib/jets/commands/runner.rb
jets-4.0.9 lib/jets/commands/runner.rb
jets-4.0.8 lib/jets/commands/runner.rb
jets-4.0.7 lib/jets/commands/runner.rb
jets-4.0.6 lib/jets/commands/runner.rb
jets-4.0.5 lib/jets/commands/runner.rb