gplan 0.0.12 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/gplan +12 -3
- data/lib/planbox.rb +2 -0
- data/lib/printer.rb +11 -0
- metadata +2 -2
data/bin/gplan
CHANGED
@@ -13,6 +13,10 @@ include Printer
|
|
13
13
|
PB_STORY_REGEX=/\[(?:fixes)? *#*([0-9]*)\]/i
|
14
14
|
GH_PR_REGEX=/Merge pull request #(\d*)/i
|
15
15
|
|
16
|
+
@repo_overide = ARGV.select{|i| i[/^(?!-)/]}.first
|
17
|
+
@params = ARGV.select{|i| i[/^-/]}
|
18
|
+
@PRINT_HTML = @params.include? "-h"
|
19
|
+
|
16
20
|
@gh_release_array = []
|
17
21
|
@pb_release_array = []
|
18
22
|
@combined = []
|
@@ -64,8 +68,8 @@ def pull_dependency(story)
|
|
64
68
|
end
|
65
69
|
|
66
70
|
def setup_repository
|
67
|
-
if
|
68
|
-
@target =
|
71
|
+
if @repo_overide # allow you to pass in a SHA or remote/branch to target against. This can be useful when generating release notes after a deployment
|
72
|
+
@target = @repo_overide
|
69
73
|
else
|
70
74
|
conf_file =Dir.pwd+"/.gplan"
|
71
75
|
if File.exists?(conf_file)
|
@@ -98,4 +102,9 @@ gh_pr_ids = list.scan(GH_PR_REGEX).flatten.uniq
|
|
98
102
|
|
99
103
|
pull_pb_numbers_from_prs
|
100
104
|
combine_results
|
101
|
-
|
105
|
+
|
106
|
+
if @PRINT_HTML
|
107
|
+
Printer.html @combined
|
108
|
+
else
|
109
|
+
Printer.print @combined
|
110
|
+
end
|
data/lib/planbox.rb
CHANGED
@@ -44,6 +44,8 @@ module Planbox
|
|
44
44
|
|
45
45
|
story = story.merge({"project_name" => project_name})
|
46
46
|
story = story.merge({"project_alias" => project_alias})
|
47
|
+
story = story.merge(
|
48
|
+
{"pb_url" => "https://www.planbox.com/initiatives/#{story['product_id']}#story_id=#{story['id']}"})
|
47
49
|
|
48
50
|
story
|
49
51
|
end
|
data/lib/printer.rb
CHANGED
@@ -1,4 +1,15 @@
|
|
1
|
+
require 'haml'
|
2
|
+
|
1
3
|
module Printer
|
4
|
+
|
5
|
+
def html stories
|
6
|
+
$stories = stories
|
7
|
+
file_path = File.expand_path('../../templates/template.html.haml', __FILE__)
|
8
|
+
template = File.read(file_path)
|
9
|
+
engine = Haml::Engine.new(template)
|
10
|
+
File.write 'releasenotes.html',engine.render
|
11
|
+
end
|
12
|
+
|
2
13
|
def print stories
|
3
14
|
end_of_pbs = false
|
4
15
|
release_notes = "ID:STATUS:TITLE:PROJECT_NAME:PROJECT_ALIAS:PR:TITLE\n"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gplan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-03-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|