Sha256: 09f83fc17ba9e68cbb127ef56b0a3042c3a925e75f68f4b6d3e92b0b71d21119

Contents?: true

Size: 570 Bytes

Versions: 10

Compression:

Stored size: 570 Bytes

Contents

module Chap
  module SpecialMethods
    SPECIAL_METHODS = %w/deploy_to release_path current_path shared_path cached_path latest_release node chap log run/

    def self.included(base)
      base.send(:extend, ClassMethods)
      base.define_special_methods
    end

    module ClassMethods
      # delegate to the config class
      def define_special_methods
        SPECIAL_METHODS.each do |method|
          class_eval <<-EOL
            def #{method}(*args)
              @config.#{method}(*args)
            end
          EOL
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
chap-0.1.3 lib/chap/special_methods.rb
chap-0.1.2 lib/chap/special_methods.rb
chap-0.1.1 lib/chap/special_methods.rb
chap-0.1.0 lib/chap/special_methods.rb
chap-0.0.9 lib/chap/special_methods.rb
chap-0.0.8 lib/chap/special_methods.rb
chap-0.0.7 lib/chap/special_methods.rb
chap-0.0.6 lib/chap/special_methods.rb
chap-0.0.5 lib/chap/special_methods.rb
chap-0.0.4 lib/chap/special_methods.rb