class Rake::Application

Public Instance Methods

_run()
Alias for: run
_standard_rake_options()
keyworded(opt) click to toggle source
# File lib/raken.rb, line 45
def keyworded opt
  JSON.parse('{' + opt.gsub(/(\w+):/, '"\1":') + '}').tap do |hash|
    hash.keys.each do |k|
      v = hash.delete(k)
      hash[k.to_sym] = v
    end
  end
rescue
  raise ArgumentError, "->#{opt}<- is not ruby keyword argument"
end
pry_debug_alias(opt) click to toggle source
# File lib/raken.rb, line 56
def pry_debug_alias opt
  return unless opt
  {c: 'continue', s: 'step', n: 'next', f: 'finish'}.each_pair do |ali, cmd|
    Pry.commands.alias_command(ali, cmd) if opt.include?(ali.to_s)
  end
  Pry::Commands.command /^$/, "repeat last command" do
      _pry_.run_command Pry.history.to_a.last
  end if opt.include?('e')
end
run() click to toggle source
# File lib/raken.rb, line 36
def run
  _run
ensure
  tasks.each do |t|
    next unless t.beginning
    puts "#{t.name} #{t.beginning} -> #{t.ending} = #{t.duration}"
  end if options.time
end
Also aliased as: _run
standard_rake_options() click to toggle source
# File lib/raken.rb, line 12
def standard_rake_options
  [
    ['--time [all]',
     'time tasks',
     lambda { |value|
       options.time = value || true
     }
    ],
    ['--trace-tree OPTS',
     'https://github.com/turnon/trace_tree',
     lambda { |value|
       options.trace_tree = keyworded(value)
     }
    ],
    ['--pry [csnfe]',
     'invoke pry-byebug before task. `csnf` to enable stepping alias and `e` to repeat last command by hitting Enter',
     lambda { |value|
       options.pry_debug = true
       pry_debug_alias value
     }
    ]
  ] + _standard_rake_options
end
Also aliased as: _standard_rake_options