pivotal_tracker_pr 0.3.0 → 0.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b31214a83e3747a65c01fc9bdce4d4ea2399eeaa
4
- data.tar.gz: 07176180c76bc00aa6913482b1ca4269673ed41f
3
+ metadata.gz: 764f1f12dcd28ae8959347fa7259b1590c93ca63
4
+ data.tar.gz: dc0e19819bd06dacaf9338554fef4c3838586a4c
5
5
  SHA512:
6
- metadata.gz: b8a2f590cbe8025bdc1c4e494448ca54577bc80d22983e186e81f86539c82ca2386135d4441155f218d3d62b0e2a6477aa6cd10aee439e4a3777c1946bd82987
7
- data.tar.gz: 7984823b003c0254d33b4f86202202f5075c66c640b3e2e2821e05b1b0da05717bfeafa909a0527f8841b9e1c346088d667e04b640386186cb76484c2763aae0
6
+ metadata.gz: 31e42d12282c81134980118fd7810f4e9b6dc9f221a22afa77772cbd0f3da645e170ea312fee34c6f168655594d6723fc9ee1395fad1e507e1a508aa8716922a
7
+ data.tar.gz: 22ca5992720e37cb9855337d1abc169d183fd2a69b67b13e7dab9b57dc2cf21bb423481d408c891d672c51f0e13d57169cecb3b564c577d916444de6cac73d69
data/README.md CHANGED
@@ -1,24 +1,34 @@
1
1
  # PivotalTrackerPr
2
2
  - `PivotalTracker`のストリーIDとストリー名を取得し、カレントブランチの`PullRequest`を作成する
3
3
 
4
- ## Installation
4
+ ## インストール
5
5
 
6
6
  ```ruby
7
7
  $ gem install pivotal_tracker_pr
8
8
  ```
9
9
 
10
- ## Usage
10
+ ## 使い方
11
11
  - 下記の環境変数を設定しておく
12
12
  - `PT_TOKEN`:`PivotalTracker`のアクセストークン
13
13
  - `PT_PROJECT_ID`:`PivotalTracker`のプロジェクトID
14
14
  - ブランチを作成するとき、`PivotalTracker`のストリーIDを含めるように命名する
15
15
  - `git commit; git push`の後、`PullRequest`を作ろうとするタイミングで、`pivotal_tracker_pr create`を実行する
16
16
 
17
- ## 作成した内容
17
+ ### PullRequest内容
18
+ - デフォルト内容
19
+
18
20
  |コマンド実行後|githubで作成した内容|
19
21
  |--------------|--------------------|
20
22
  |![PullRequest command](https://raw.github.com/wiki/blueplanet/pivotal_tracker_pr/images/pt_pr_cmd.png)|![PullRequest github](https://raw.github.com/wiki/blueplanet/pivotal_tracker_pr/images/pt_pr_github.png)|
21
23
 
24
+ - カスタマイズしたい場合は、`.git/PULLREQ_MSG_TEMPLATE`ファイルに内容を書き出しておけば使われます。
25
+ - 下記の文字列が置換される
26
+
27
+ |置換文字列|置換後の内容|
28
+ |--------------|--------------------|
29
+ |{{STORY_ID}}|ストリーのID|
30
+ |{{STORY_NAME}}|ストリー内容|
31
+ |{{STORY_LINK}}|ストリーのリンク|
22
32
 
23
33
  ## TODO
24
34
  - [ ] PullRequestのテンプレートをERBに切り出す
@@ -61,11 +61,12 @@ module PivotalTrackerPr
61
61
  end
62
62
 
63
63
  def write_pull_request_template(story_id, story_name)
64
- message_context = if File.exists?(message_template_path)
65
- message_from_template(story_id, story_name)
66
- else
67
- default_message
68
- end
64
+ message_context =
65
+ if File.exists?(message_template_path)
66
+ message_from_template(story_id, story_name)
67
+ else
68
+ default_message
69
+ end
69
70
 
70
71
  open(pull_request_message, 'w') { |file| file.puts message_context }
71
72
  end
@@ -76,7 +77,7 @@ module PivotalTrackerPr
76
77
 
77
78
  def message_from_template(story_id, story_name)
78
79
  template_content = File.open(message_template_path).read
79
- template_content.gsub('{{STORY_ID}}', story_id).gsub('{{STORY_NAME}}')
80
+ template_content.gsub('{{STORY_ID}}', story_id).gsub('{{STORY_NAME}}', story_name).gsub('{{STORY_LINK}}', story_link(story_id))
80
81
  end
81
82
 
82
83
  def pull_request_message
@@ -85,10 +86,14 @@ module PivotalTrackerPr
85
86
 
86
87
  def default_message(story_id, story_name)
87
88
  <<~EOF
88
- "[fixed ##{story_id}]#{story_name}"
89
- "\n"
90
- "https://www.pivotaltracker.com/story/show/#{story_id}"
89
+ [fixed ##{story_id}]#{story_name}
90
+
91
+ #{story_link story_id}
91
92
  EOF
92
93
  end
94
+
95
+ def story_link(story_id)
96
+ "https://www.pivotaltracker.com/story/show/#{story_id}"
97
+ end
93
98
  end
94
99
  end
@@ -1,3 +1,3 @@
1
1
  module PivotalTrackerPr
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal_tracker_pr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - blueplanet