Class: RubyLeiningen::Commands::Run
- Includes:
- Mixins::Profile
- Defined in:
- lib/ruby_leiningen/commands/run.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods included from Mixins::Profile
Methods inherited from Base
#do_after, #do_before, #execute, #initialize, #instantiate_builder, #stderr, #stdin, #stdout
Instance Method Details
#configure_command(builder, opts) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/ruby_leiningen/commands/run.rb', line 11 def configure_command(builder, opts) builder = super(builder, opts) main_function = opts[:main_function] arguments = opts[:arguments] || [] quote_arguments = opts[:quote_arguments] builder = builder.with_subcommand('run') do |sub| sub = sub.with_option('-m', main_function) if main_function sub = sub.with_flag('--quote-args') if quote_arguments sub end if arguments.any? builder = builder.with_argument("--") builder = arguments.inject(builder) do |b, argument| b.with_argument(argument) end end builder end |