Class: FlashFlow::MergeMaster::Status
- Inherits:
-
Object
- Object
- FlashFlow::MergeMaster::Status
- Defined in:
- lib/flash_flow/merge_master/status.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#issue_tracker ⇒ Object
readonly
Returns the value of attribute issue_tracker.
-
#releases ⇒ Object
readonly
Returns the value of attribute releases.
-
#stories ⇒ Object
readonly
Returns the value of attribute stories.
Instance Method Summary collapse
- #branches ⇒ Object
-
#initialize(issue_tracker_config, branches_config, branch_info_file, git_config, opts = {}) ⇒ Status
constructor
A new instance of Status.
- #status(filename = nil) ⇒ Object
Constructor Details
#initialize(issue_tracker_config, branches_config, branch_info_file, git_config, opts = {}) ⇒ Status
Returns a new instance of Status.
8 9 10 11 |
# File 'lib/flash_flow/merge_master/status.rb', line 8 def initialize(issue_tracker_config, branches_config, branch_info_file, git_config, opts={}) @issue_tracker = IssueTracker::Base.new(issue_tracker_config) @collection = Data::Base.new(branches_config, branch_info_file, ShadowGit.new(git_config)).merged_branches end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
6 7 8 |
# File 'lib/flash_flow/merge_master/status.rb', line 6 def collection @collection end |
#issue_tracker ⇒ Object (readonly)
Returns the value of attribute issue_tracker.
6 7 8 |
# File 'lib/flash_flow/merge_master/status.rb', line 6 def issue_tracker @issue_tracker end |
#releases ⇒ Object (readonly)
Returns the value of attribute releases.
6 7 8 |
# File 'lib/flash_flow/merge_master/status.rb', line 6 def releases @releases end |
#stories ⇒ Object (readonly)
Returns the value of attribute stories.
6 7 8 |
# File 'lib/flash_flow/merge_master/status.rb', line 6 def stories @stories end |
Instance Method Details
#branches ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/flash_flow/merge_master/status.rb', line 25 def branches g = ReleaseGraph.build(collection.current_branches, issue_tracker) branch_hash = {} collection.current_branches.each_with_index do |branch, i| connected_branches = g.connected_branches(branch.ref) connected_stories = g.connected_stories(branch.ref) connected_releases = g.connected_releases(branch.ref) add_stories(connected_stories) add_releases(connected_releases) sub_g = ReleaseGraph.build(connected_branches, issue_tracker) graph_file = sub_g.output("/tmp/graph-#{i}.png") branch_hash[branch] = Hash.new.tap do |hash| hash[:name] = branch.ref hash[:branch_url] = collection.branch_link(branch) hash[:branch_can_ship?] = collection.can_ship?(branch) hash[:connected_branches] = connected_branches hash[:image] = graph_file hash[:my_stories] = branch.stories.to_a hash[:stories] = connected_stories hash[:releases] = connected_releases end end mark_as_shippable(branch_hash) branch_hash end |
#status(filename = nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/flash_flow/merge_master/status.rb', line 13 def status(filename=nil) filename = File.dirname(__FILE__) + '/merge_status.html' @branches = branches template = ERB.new File.read(File.dirname(__FILE__) + '/merge_status.html.erb') html = template.result(binding) File.open(filename, 'w') do |f| f.puts html end `open #{filename}` end |