Class: Batali::Origin::Git
- Inherits:
-
Path
- Object
- Grimoire::Utility
- Utility
- Batali::Origin
- Path
- Batali::Origin::Git
- Includes:
- Git
- Defined in:
- lib/batali/origin/git.rb
Overview
Fetch unit from local path
Instance Method Summary collapse
-
#fetch_repo ⇒ String
Path to repository.
-
#initialize(args = {}) ⇒ Git
constructor
A new instance of Git.
-
#load_metadata ⇒ Smash
Metadata information.
- #units ⇒ Array<Unit>
Methods included from Git
#base_path, #clone_repository, included, #ref_dup
Constructor Details
#initialize(args = {}) ⇒ Git
Returns a new instance of Git.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/batali/origin/git.rb', line 13 def initialize(args={}) super self.identifier = Smash.new( :url => url, :ref => ref, :subdirectory => subdirectory ).checksum unless(name?) self.name = self.identifier end end |
Instance Method Details
#fetch_repo ⇒ String
Returns path to repository.
49 50 51 52 53 54 |
# File 'lib/batali/origin/git.rb', line 49 def fetch_repo memoize(:fetch_repo) do clone_repository ref_dup end end |
#load_metadata ⇒ Smash
Returns metadata information.
39 40 41 42 43 44 45 46 |
# File 'lib/batali/origin/git.rb', line 39 def fetch_repo original_path = path.dup self.path = File.join(*[path, subdirectory].compact) result = super self.path = original_path result end |