Class: Treet::Gitfarm

Inherits:
Farm
  • Object
show all
Defined in:
lib/treet/gitfarm.rb

Instance Attribute Summary collapse

Attributes inherited from Farm

#repotype, #root, #xrefkey

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Farm

#count, #export, #patch, #xrefs

Constructor Details

#initialize(opts) ⇒ Gitfarm

Returns a new instance of Gitfarm.

Raises:

  • (ArgumentError)


6
7
8
9
10
11
# File 'lib/treet/gitfarm.rb', line 6

def initialize(opts)
  raise ArgumentError, "No git farm without an author for commits" unless opts[:author]
  super
  @repotype = Treet::Gitrepo
  @author = opts[:author]
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



4
5
6
# File 'lib/treet/gitfarm.rb', line 4

def author
  @author
end

Class Method Details

.plant(opts) ⇒ Object



13
14
15
# File 'lib/treet/gitfarm.rb', line 13

def self.plant(opts)
  super(opts.merge(:repotype => Treet::Gitrepo))
end

Instance Method Details

#add(hash, opts = {}) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/treet/gitfarm.rb', line 25

def add(hash, opts = {})
  repo = super(hash, opts.merge(:author => author))
  if opts[:tag]
    repo.tag(opts[:tag])
  end
  repo
end

#repo(id, opts = {}) ⇒ Object



21
22
23
# File 'lib/treet/gitfarm.rb', line 21

def repo(id, opts = {})
  super(id, opts.merge(:author => author))
end

#reposObject



17
18
19
# File 'lib/treet/gitfarm.rb', line 17

def repos
  super(:author => author)
end