Class: Vendorificator::Vendor::Git
- Inherits:
-
Vendorificator::Vendor
- Object
- Vendorificator::Vendor
- Vendorificator::Vendor::Git
- Defined in:
- lib/vendorificator/vendor/git.rb
Instance Attribute Summary collapse
-
#conjured_revision ⇒ Object
readonly
Returns the value of attribute conjured_revision.
Attributes inherited from Vendorificator::Vendor
#args, #block, #environment, #name, #segment
Instance Method Summary collapse
Methods inherited from Vendorificator::Vendor
#===, #after_conjure!, arg_reader, #before_conjure!, #compute_dependencies!, #git_add_extra_paths, #group, #initialize, #inspect, #metadata, #version
Constructor Details
This class inherits a constructor from Vendorificator::Vendor
Instance Attribute Details
#conjured_revision ⇒ Object (readonly)
Returns the value of attribute conjured_revision.
7 8 9 |
# File 'lib/vendorificator/vendor/git.rb', line 7 def conjured_revision @conjured_revision end |
Instance Method Details
#conjure! ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/vendorificator/vendor/git.rb', line 9 def conjure! say_status :default, :clone, repository MiniGit.git :clone, repository, '.' local_git = MiniGit.new('.') if tag||revision local_git.checkout({:b => 'vendorified'}, tag||revision) elsif branch local_git.checkout({:b => 'vendorified'}, "origin/#{branch}") end super @conjured_revision = local_git.capturing.rev_parse('HEAD').strip FileUtils::rm_rf '.git' end |
#conjure_commit_message ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/vendorificator/vendor/git.rb', line 31 def rv = "Conjured git module #{name} " rv << "version #{version} " if version rv << "from tag #{tag} " if tag rv << "from branch #{branch} " if branch rv << "at revision #{conjured_revision}" rv end |
#upstream_version ⇒ Object
27 28 29 |
# File 'lib/vendorificator/vendor/git.rb', line 27 def upstream_version tag || conjured_revision end |