Class: CapExtWebistrano::Task
- Inherits:
-
Object
- Object
- CapExtWebistrano::Task
- Defined in:
- lib/cap_ext_webistrano/task.rb
Instance Attribute Summary collapse
-
#task ⇒ Object
Returns the value of attribute task.
Instance Method Summary collapse
-
#initialize(task, config) ⇒ Task
constructor
A new instance of Task.
- #run ⇒ Object
- #set_access_data ⇒ Object
Constructor Details
#initialize(task, config) ⇒ Task
Returns a new instance of Task.
9 10 11 12 |
# File 'lib/cap_ext_webistrano/task.rb', line 9 def initialize(task, config) @task = task @config = config end |
Instance Attribute Details
#task ⇒ Object
Returns the value of attribute task.
7 8 9 |
# File 'lib/cap_ext_webistrano/task.rb', line 7 def task @task end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 |
# File 'lib/cap_ext_webistrano/task.rb', line 20 def run set_access_data project = Project.find_by_name(@config[:application]) stage = project.find_stage(@config[:stage]) Deployment.create(:task => task, :stage_id => stage.id, :project_id => project.id) end |
#set_access_data ⇒ Object
14 15 16 17 18 |
# File 'lib/cap_ext_webistrano/task.rb', line 14 def set_access_data [Project, Stage, Deployment].each do |klazz| klazz.configure(@config) end end |