lib/berkshelf/cookbook_source/git_location.rb in berkshelf-0.3.7 vs lib/berkshelf/cookbook_source/git_location.rb in berkshelf-0.4.0.rc1
- old
+ new
@@ -2,19 +2,31 @@
class CookbookSource
# @author Jamie Winsor <jamie@vialstudios.com>
class GitLocation
include Location
+ location_key :git
+ valid_options :ref, :branch, :tag
+
attr_accessor :uri
attr_accessor :branch
alias_method :ref, :branch
alias_method :tag, :branch
# @param [#to_s] name
- # @param [DepSelector::VersionConstraint] version_constraint
+ # @param [Solve::Constraint] version_constraint
# @param [Hash] options
- def initialize(name, version_constraint, options)
+ #
+ # @option options [String] :git
+ # the Git URL to clone
+ # @option options [String] :ref
+ # the commit hash or an alias to a commit hash to clone
+ # @option options [String] :branch
+ # same as ref
+ # @option options [String] :tag
+ # same as tag
+ def initialize(name, version_constraint, options = {})
@name = name
@version_constraint = version_constraint
@uri = options[:git]
@branch = options[:branch] || options[:ref] || options[:tag]