gplan 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54936e7bc0c10f14a2420e46cfebc0a747a35ae4
4
- data.tar.gz: 3b0181f9399cd157c784d812e4142b54f847ee50
3
+ metadata.gz: de28ad83ab2592e113db3b2470609cb9faaf563c
4
+ data.tar.gz: 733fe4924a1eb36d5245487f9a121b3af5968c26
5
5
  SHA512:
6
- metadata.gz: a5b4d0438f6f371a318a538fc987084bca1a75303679eb0df24640070156d072f624b096573732c9fd368ffe032d73c4f9742ab53c48ff810d3b12d3f620e28d
7
- data.tar.gz: d7dfb55f4f08731c256e4aa3b970ea7bb18c2f5a2abeac52767580ba8e2259da8ec71c9c000b045b0570e9c34726b89eb74598fdf367c3cbd07f510a8c48e542
6
+ metadata.gz: 178f2ffe2895f74769a12b44f9fdb712a04a387dd7a30bd14bd2952c73b1c015107ccec9196a4675291923a5b67aa88286392c49ef48bd53cd89927f09488d6f
7
+ data.tar.gz: 0fa6bef00801473df3ae7db55718a33c0506a84ab840f83e933da3afb4fe8cba1ba40faf01d5baf2a1c58590663265ae2496be70462d8bdf064fd2ee52131838
data/lib/planbox.rb CHANGED
@@ -74,4 +74,15 @@ module Planbox
74
74
  result_string.gsub!('`', ' ') || result_string
75
75
  end
76
76
 
77
+ def self.has_planbox? object
78
+ if object.is_a?(Hash)
79
+ return !object['name'].nil?
80
+ elsif object.is_a?(Array)
81
+ object.each do |story|
82
+ return true if !story['name'].nil?
83
+ end
84
+ return false
85
+ end
86
+ end
87
+
77
88
  end
data/lib/printer.rb CHANGED
@@ -11,26 +11,36 @@ class Printer
11
11
  end
12
12
 
13
13
  def print stories
14
- end_of_pbs = false
15
- release_notes = "ID:STATUS:TITLE:PROJECT_NAME:PROJECT_ALIAS:PR:TITLE\n"
16
14
  dependencies = []
17
- stories.each do |story|
18
- if !end_of_pbs and story['name'].nil?
19
- end_of_pbs = true
20
- release_notes += title "Unmatched PRs"
21
- release_notes += "PR:TITLE\n"
22
- end
23
15
 
16
+ # Github stories only
17
+ release_notes = "PR:TITLE:ISSUES:MILESTONE\n"
18
+ stories.each do |story|
19
+ next if Planbox.has_planbox?(story)
24
20
  dependency = get_dependency(story)
25
21
  dependencies << "PR ##{story['number']}: " + dependency unless dependency.nil?
26
22
 
27
23
  line = ""
28
- line += planbox_info story unless end_of_pbs
29
- line += github_pr_info story unless story['number'].nil?
24
+ line += github_pr_info(story) unless story['number'].nil?
30
25
 
31
26
  release_notes += line + "\n"
32
27
  end
33
28
 
29
+ # Planbox matching stories
30
+ if Planbox.has_planbox?(stories)
31
+ release_notes += title "Matched Planbox Stories"
32
+ release_notes += "ID:STATUS:TITLE:PROJECT_NAME:PROJECT_ALIAS:PR:TITLE\n"
33
+ stories.each do |story|
34
+ next unless Planbox.has_planbox?(story)
35
+ dependency = get_dependency(story)
36
+ dependencies << "PR ##{story['number']}: " + dependency unless dependency.nil?
37
+
38
+ line = ""
39
+ line += planbox_info(story)
40
+ line += github_pr_info(story) unless story['number'].nil?
41
+ end
42
+ end
43
+
34
44
  # print dependency blocks
35
45
  unless dependencies.empty?
36
46
  release_notes += include_dependencies dependencies
@@ -70,7 +80,7 @@ class Printer
70
80
 
71
81
  def github_pr_info story
72
82
  line = ":#{story['number']}:#{story['title']}"
73
- line += github_issue_info story if story['linked_issues']
83
+ line += github_issue_info(story) if story['linked_issues']
74
84
  line
75
85
  end
76
86
 
@@ -1,33 +1,4 @@
1
1
  %h2 Release notes
2
- %table{:border => "1"}
3
- %thead
4
- %tr
5
- %th ID
6
- %th STATUS
7
- %th DESCRIPTION
8
- %th PROJECT NAME
9
- %th PROJECT ALIAS
10
- %th PR
11
- %th PR TITLE
12
- %th Dependencies
13
- %tbody
14
- - $stories.each do |story|
15
- %tr
16
- - break if story['name'].nil?
17
- %td
18
- %a{href: story['pb_url']}= story['id']
19
- %td= story['status']
20
- %td= story['name']
21
- %td= story['project_name']
22
- %td= story['project_alias']
23
- %td
24
- %a{href: story['html_url']}= story['number']
25
- %td= story['title']
26
- - block = Printer.new.get_dependency(story)
27
- - next if block.nil?
28
- %td= block
29
-
30
- %h2 Unmatched PRs
31
2
  %table{:border => "1"}
32
3
  %thead
33
4
  %tr
@@ -37,7 +8,7 @@
37
8
  %th Dependencies
38
9
  %tbody
39
10
  - $stories.each do |story|
40
- - next unless story['name'].nil?
11
+ - next if Planbox.has_planbox?(story)
41
12
  %tr
42
13
  %td
43
14
  %a{href: story['html_url']}= story['number']
@@ -49,7 +20,39 @@
49
20
  %tr
50
21
  %td
51
22
  %a{href: issue['html_url']}= issue['number']
52
- %td= issue['milestone']['title'] if issue['milestone']
23
+ %td
24
+ - if issue['milestone']
25
+ %a{href: issue['milestone']['html_url']}= issue['milestone']['title']
26
+ - block = Printer.new.get_dependency(story)
27
+ - next if block.nil?
28
+ %td= block
29
+
30
+ - if Planbox.has_planbox?($stories)
31
+ %h2 Matched Planbox Stories
32
+ %table{:border => "1"}
33
+ %thead
34
+ %tr
35
+ %th ID
36
+ %th STATUS
37
+ %th DESCRIPTION
38
+ %th PROJECT NAME
39
+ %th PROJECT ALIAS
40
+ %th PR
41
+ %th PR TITLE
42
+ %th Dependencies
43
+ %tbody
44
+ - $stories.each do |story|
45
+ %tr
46
+ - break unless Planbox.has_planbox?(story)
47
+ %td
48
+ %a{href: story['pb_url']}= story['id']
49
+ %td= story['status']
50
+ %td= story['name']
51
+ %td= story['project_name']
52
+ %td= story['project_alias']
53
+ %td
54
+ %a{href: story['html_url']}= story['number']
55
+ %td= story['title']
53
56
  - block = Printer.new.get_dependency(story)
54
57
  - next if block.nil?
55
58
  %td= block
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gplan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Koenig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-10 00:00:00.000000000 Z
11
+ date: 2015-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -53,7 +53,7 @@ files:
53
53
  - lib/planbox.rb
54
54
  - lib/printer.rb
55
55
  - templates/template.html.haml
56
- homepage: https://github.com/el-jefe-/gplan
56
+ homepage: https://github.com/thejefe/gplan
57
57
  licenses: []
58
58
  metadata: {}
59
59
  post_install_message: