Class: Gitcamp::Github::Milestone
- Inherits:
-
Object
- Object
- Gitcamp::Github::Milestone
- Defined in:
- lib/gitcamp/github/milestone.rb
Instance Attribute Summary collapse
-
#milestone ⇒ Object
readonly
Returns the value of attribute milestone.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#todolist ⇒ Object
readonly
Returns the value of attribute todolist.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Milestone
constructor
A new instance of Milestone.
- #number ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Milestone
Returns a new instance of Milestone.
6 7 8 9 10 11 12 13 14 |
# File 'lib/gitcamp/github/milestone.rb', line 6 def initialize( = {}) unless [:todolist] raise ArgumentError, 'no Basecamp todolist given' end @repo = [:repo] @github = [:github] @todolist = [:todolist] end |
Instance Attribute Details
#milestone ⇒ Object (readonly)
Returns the value of attribute milestone.
4 5 6 |
# File 'lib/gitcamp/github/milestone.rb', line 4 def milestone @milestone end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
4 5 6 |
# File 'lib/gitcamp/github/milestone.rb', line 4 def repo @repo end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/gitcamp/github/milestone.rb', line 4 def title @title end |
#todolist ⇒ Object (readonly)
Returns the value of attribute todolist.
4 5 6 |
# File 'lib/gitcamp/github/milestone.rb', line 4 def todolist @todolist end |
Instance Method Details
#number ⇒ Object
16 17 18 |
# File 'lib/gitcamp/github/milestone.rb', line 16 def number @milestone.number end |
#save ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/gitcamp/github/milestone.rb', line 20 def save milestones = @github.list_milestones(repo) @milestone = milestones.find { |mls| mls.title == todolist.name.strip } unless @milestone @milestone = @github.create_milestone(repo, @todolist.name) end if @milestone say "Using milestone '#{milestone.title}' in GitHub #{repo}" end end |