Sha256: b873049878b68546250a34ea594339fd0e013210a162883a4d6c7cfde6f72817

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

::Dir.glob(::File.expand_path('../cape/*.rb', __FILE__)) do |f|
  require "cape/#{::File.basename f, '.rb'}"
end

# Contains the implementation of Cape.
module Cape

  extend DSL

end

# The method used to group Cape statements.
#
# @param [Proc] block Cape and Capistrano statements
# @return [Cape] the Cape module
#
# @yield [cape] a block containing Cape statements
# @yieldparam [Cape::DSL] cape the Cape DSL; optional
#
# @example Basic Cape usage
#   # config/deploy.rb
#
#   require 'cape'
#
#   Cape do
#     mirror_rake_tasks
#   end
#
# @example Combining Cape statements with Capistrano statements
#   # config/deploy.rb
#
#   require 'cape'
#
#   namespace :rake_tasks do
#     # Use an argument with the Cape block, if you want to or need to.
#     Cape do |cape|
#       cape.mirror_rake_tasks
#     end
#   end
def Cape(&block)
  Cape.module_eval do
    @outer_self = block.binding.eval('self', __FILE__, __LINE__)
    if 0 < block.arity
      block.call self
    else
      module_eval(&block)
    end
  end
  Cape
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cape-1.3.0 lib/cape.rb
cape-1.2.0 lib/cape.rb
cape-1.1.0 lib/cape.rb
cape-1.0.3 lib/cape.rb
cape-1.0.2 lib/cape.rb