Class: Dply::Cli::Task

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/dply/cli/task.rb

Instance Method Summary collapse

Methods included from Logger

#debug?, #logger, stderr, #stderr

Constructor Details

#initialize(argv) ⇒ Task

Returns a new instance of Task.



11
12
13
# File 'lib/dply/cli/task.rb', line 11

def initialize(argv)
  @argv = argv
end

Instance Method Details

#lockObject



25
26
27
# File 'lib/dply/cli/task.rb', line 25

def lock
  @lock ||= Lock.new(Dir.pwd)
end

#runObject



15
16
17
18
19
20
21
22
23
# File 'lib/dply/cli/task.rb', line 15

def run
  task_name = @argv.shift
  error "task name not specified" if not task_name
  lock.acquire
  Dir.chdir "current" do
    app_config = AppConfig.new
    app_config.run_task task_name
  end
end