Class: Salt::Formula::Git

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/salt/formula/git.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#dirname, #name, #path

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#accept, #full_path, #status, #sync

Constructor Details

#initialize(name, dirname, args) ⇒ Git

Returns a new instance of Git.



20
21
22
23
24
25
# File 'lib/salt/formula/git.rb', line 20

def initialize(name, dirname, args)
  super
  parse_options(@args)
  @name = name
  @repo = Salt::Matrix::Gitrepo.new(@remote, @name, @ref, dirname)
end

Instance Attribute Details

#repoObject (readonly)

Returns the value of attribute repo.



18
19
20
# File 'lib/salt/formula/git.rb', line 18

def repo
  @repo
end

Class Method Details

.implement?(name, args) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
13
# File 'lib/salt/formula/git.rb', line 9

def self.implement?(name, args)
  args.is_a? Hash and (args.has_key?(:git) or args.has_key?(:github))
rescue
  false
end

Instance Method Details

#propertiesObject



31
32
33
34
35
36
37
# File 'lib/salt/formula/git.rb', line 31

def properties
  {
    :expected => @ref,
    :actual   => (@repo.head || "(unresolvable)"),
    :type     => :git,
  }
end

#versionObject



27
28
29
# File 'lib/salt/formula/git.rb', line 27

def version
  @ref
end