Sha256: 5b811a0f3d339ff081fb722436bce77d64da827c4a1b18438e8d47945b29006c

Contents?: true

Size: 822 Bytes

Versions: 19

Compression:

Stored size: 822 Bytes

Contents

command "run command" do |c|
  c.syntax = 'brief run FILE'
  c.description = 'run a script in the context of the briefcase'

  c.option '--root PATH', String, 'The briefcase root'

  c.action do |args, options|
    options.default(root: Pathname(args.first || Brief.pwd))

    command = args.first.to_s.to_sym

    bc = Brief.case = Brief::Briefcase.new(root: Pathname(options.root))
    bc = bc.call if bc.respond_to?(:call)

    if !Brief.commands[command.to_sym]
      puts "Invalid command. #{ Brief.commands.keys }"
    else
      bc.run_command(command.to_sym, *args)
    end
  end
end

command "run" do |c|
  c.syntax = 'brief run FILE'
  c.description = 'run a script in the context of the briefcase'

  c.action do |args, options|
    code = Pathname(args.first).read
    Brief.case.instance_eval(code)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
brief-1.17.14 lib/brief/cli/run.rb
brief-1.17.13 lib/brief/cli/run.rb
brief-1.17.12 lib/brief/cli/run.rb
brief-1.17.11 lib/brief/cli/run.rb
brief-1.17.10 lib/brief/cli/run.rb
brief-1.17.9 lib/brief/cli/run.rb
brief-1.17.8 lib/brief/cli/run.rb
brief-1.17.7 lib/brief/cli/run.rb
brief-1.17.5 lib/brief/cli/run.rb
brief-1.17.4 lib/brief/cli/run.rb
brief-1.17.3 lib/brief/cli/run.rb
brief-1.17.2 lib/brief/cli/run.rb
brief-1.17.1 lib/brief/cli/run.rb
brief-1.17.0 lib/brief/cli/run.rb
brief-1.16.2 lib/brief/cli/run.rb
brief-1.16.1 lib/brief/cli/run.rb
brief-1.16.0 lib/brief/cli/run.rb
brief-1.15.5 lib/brief/cli/run.rb
brief-1.15.4 lib/brief/cli/run.rb