class Batali::Source::Git

Path based source

Public Class Methods

new(*_, &block) click to toggle source
Calls superclass method
# File lib/batali/source/git.rb, line 16
def initialize(*_, &block)
  super
  self.subdirectory = Utility.clean_path(subdirectory)
  self.path = Utility.clean_path(path)
end

Public Instance Methods

asset() click to toggle source

@return [String] directory containing contents

Calls superclass method
# File lib/batali/source/git.rb, line 23
def asset
  clone_repository
  clone_path = ref_dup
  self.path = Utility.join_path(*[ref_dup, subdirectory].compact)
  result = super
  self.path = clone_path
  result
end
to_json(*args) click to toggle source

Overload to remove non-relevant attributes

# File lib/batali/source/git.rb, line 33
def to_json(*args)
  MultiJson.dump(
    Smash.new(
      :url => url,
      :ref => ref,
      :type => self.class.name,
      :subdirectory => subdirectory,
    ), *args
  )
end