Sha256: d22288845952cfcc9f0132538b6ef8511f66ab2b35303ee2a44c59ddd589275f

Contents?: true

Size: 644 Bytes

Versions: 2

Compression:

Stored size: 644 Bytes

Contents

require 'cap_ext_webistrano/project'
require 'cap_ext_webistrano/stage'
require 'cap_ext_webistrano/deployment'

module CapExtWebistrano
  class Task
    attr_accessor :task
    
    def initialize(task, config)
      @task = task
      @config = config
    end

    def set_access_data
      [Project, Stage, Deployment].each do |klazz|
        klazz.configure(@config)
      end
    end
    
    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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mattmatt-cap-ext-webistrano-0.0.3 lib/cap_ext_webistrano/task.rb
mattmatt-cap-ext-webistrano-0.0.4 lib/cap_ext_webistrano/task.rb