Class: Batali::Source::Git

Inherits:
Path show all
Includes:
Git, Bogo::Memoization
Defined in:
lib/batali/source/git.rb

Overview

Path based source

Constant Summary

Constants inherited from Path

Path::DEFAULT_IGNORE, Path::IGNORE_FILE

Instance Attribute Summary

Attributes inherited from Batali::Source

#cache_path

Instance Method Summary collapse

Methods included from Git

#base_path, #clone_repository, included, #ref_dup

Methods inherited from Batali::Source

#==, build, #clean_asset, #diff, #initialize, #unit_dependencies, #unit_version

Constructor Details

This class inherits a constructor from Batali::Source

Instance Method Details

#assetString

Returns directory containing contents.

Returns:

  • (String)

    directory containing contents



18
19
20
21
22
23
24
25
# File 'lib/batali/source/git.rb', line 18

def asset
  clone_repository
  clone_path = ref_dup
  self.path = File.join(*[ref_dup, subdirectory].compact)
  result = super
  self.path = clone_path
  result
end

#to_json(*args) ⇒ Object

Overload to remove non-relevant attributes



28
29
30
31
32
33
34
35
36
37
# File 'lib/batali/source/git.rb', line 28

def to_json(*args)
  MultiJson.dump(
    Smash.new(
      :url => url,
      :ref => ref,
      :type => self.class.name,
      :subdirectory => subdirectory
    ), *args
  )
end