forward3d / cap-ec2

Capify-EC2 rewritten for Capistrano v3
MIT License
181 stars 118 forks source link

don't need to monkey patch in to Capistrano::TaskEnhancements #5

Closed rjocoleman closed 10 years ago

rjocoleman commented 10 years ago

hello!

You don't need to monkey patch into Capistrano::TaskEnhancements - you can extend the DSL like so:

module Capistrano
  module DSL
    module Ec2

      def ec2_handler
        @ec2_handler ||= CapEC2::EC2Handler.new(env.fetch(:ec2_config, "config/ec2.yml"))
      end

      ...

    end
  end
end

self.extend Capistrano::DSL::Ec2
andytinycat commented 10 years ago

Nice patch - I wanted to get rid of the monkey patching but couldn't see the way to do it. Thanks for your contributions!