Class: Kleiber::Performer

Inherits:
Object
  • Object
show all
Defined in:
lib/kleiber/performer.rb

Overview

Provides api for symphony perphomance

Author:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symphony, projects, options) ⇒ Performer

Returns a new instance of Performer.



8
9
10
11
12
# File 'lib/kleiber/performer.rb', line 8

def initialize(symphony, projects, options)
  @symphony = symphony
  @projects = projects
  @tasks    = options[:tasks]
end

Instance Attribute Details

#projectsObject (readonly)

Returns the value of attribute projects.



7
8
9
# File 'lib/kleiber/performer.rb', line 7

def projects
  @projects
end

#symphonyObject (readonly)

Returns the value of attribute symphony.



7
8
9
# File 'lib/kleiber/performer.rb', line 7

def symphony
  @symphony
end

Instance Method Details

#task_namesArray

Returns array of task names

Returns:

  • (Array)

    task names



27
28
29
# File 'lib/kleiber/performer.rb', line 27

def task_names
  @tasks ? @tasks.split(':') : []
end

#tasksHash

Returns tasks to run with command

Returns:

  • (Hash)

    tasks to run



33
34
35
36
# File 'lib/kleiber/performer.rb', line 33

def tasks
  all_tasks = Kleiber.settings.tasks
  task_names.each_with_object({}) { |t, hash| hash[t] = all_tasks[t] if all_tasks.key?(t) }
end