Module: LokkaSh::Rake

Extended by:
Forkable
Defined in:
lib/lokka-sh/rake.rb

Class Method Summary collapse

Methods included from Forkable

_invoke, after_fork, before_fork, invoke, run_after_fork, run_before_fork

Methods included from Helpers

#lesspipe

Class Method Details

._invoke(line) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/lokka-sh/rake.rb', line 21

def _invoke(line)
  line ||= 'default'
  name, *args = line.split(/\s+/)
  args.each do |arg|
    env, value = arg.split('=')
    next unless env && !env.empty? && value && !value.empty?
    ENV[env] = value
  end
  ::Rake.application[name].invoke
end

.initObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/lokka-sh/rake.rb', line 6

def init
  $stdout = StringIO.new

  before_fork do
  end
  after_fork do
  end

  ::Rake.application = ::Rake::Application.new
  ::Rake.application.init
  ::Rake.application.load_rakefile
ensure
  $stdout = STDOUT
end

.task_namesObject



32
33
34
# File 'lib/lokka-sh/rake.rb', line 32

def task_names
  ::Rake.application.tasks.map{|t| t.name}
end