Class: CapistranoChangelog::Release

Inherits:
Object
  • Object
show all
Defined in:
lib/changelog/release.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag) ⇒ Release

Returns a new instance of Release.



7
8
9
# File 'lib/changelog/release.rb', line 7

def initialize(tag)
  @tag = tag
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/changelog/release.rb', line 15

def method_missing(meth, *args)
  if tag.respond_to?(meth)
    tag.send(meth, *args)
  else
    super
  end
end

Instance Attribute Details

#tagObject (readonly)

Returns the value of attribute tag.



5
6
7
# File 'lib/changelog/release.rb', line 5

def tag
  @tag
end

Class Method Details

.allObject



41
42
43
44
45
# File 'lib/changelog/release.rb', line 41

def self.all
  CapistranoChangelog::Git.tags.map do |tag|
    CapistranoChangelog::Release.new(tag)
  end
end

Instance Method Details

#<=>(other) ⇒ Object



11
12
13
# File 'lib/changelog/release.rb', line 11

def <=> (other)
  self.date <=> other.date
end

#stories(history) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/changelog/release.rb', line 23

def stories(history)
  commits = CapistranoChangelog::Git.commits history.prev_to(self), self

  CapistranoChangelog::StoriesTracker.new.ids(commits).map do |uid|
    CapistranoChangelog::Story.new(uid, history, commits)
  end
end

#unreconized(history) ⇒ Object



31
32
33
34
35
# File 'lib/changelog/release.rb', line 31

def unreconized(history)
  CapistranoChangelog::Git.commits(history.prev_to(self), self).select do |commit|
    commit.comment !~ Trackers::Pivotal::MATCHER
  end
end

#unreconized?(history) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/changelog/release.rb', line 37

def unreconized?(history)
  unreconized(history).size > 0
end