git-pr-release 0.1.0 → 0.1.1

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: 0a86a7c2e8b0cef94c0eb162660772b0efa212bf
4
- data.tar.gz: 81115e65decbf92b726b6218b6fe9cd1cd007f7f
3
+ metadata.gz: f2a46ea53d359add84c3d2cf0b4fe9306dee5a37
4
+ data.tar.gz: 0e20bcc51ba00d21349c1c4cc9a3d1c9a345788d
5
5
  SHA512:
6
- metadata.gz: 64cb59550b604a2a0d189b23dfddeca083bd2a21b656ccadc04e4d72294ed99ce9cf05fc98732b28a1e71f7886ec0f75a472afab2868d551990b38133c94f265
7
- data.tar.gz: 0f9f1f277f6f4ce30e73d7d4c6c4681ea9b5e2541a24e17ad518fc3b7291f04af963464ee15a674f36ddbe51d4b723c321f97db8b058f5d732fcb3e421054198
6
+ metadata.gz: a5dbe7c865ee9b5c9d540b0ec349e90c69acdca6f18df18eb8426ff7c223280ed1d7268e1bb0871169eb8a20c874aa81981e610c5f120eebd9c7839d7938cdc5
7
+ data.tar.gz: 972cc421a5e02edff5f737e8e0ff25b2abd9827d24730b2bfd3d54acc62eae48df6d0d2b1ac6eaf35a24f1f302c6dcb44cf2c9adcb12969d67bf48482a250032
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 motemen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,8 +1,15 @@
1
1
  git-pr-release <a href="http://badge.fury.io/rb/git-pr-release"><img src="https://badge.fury.io/rb/git-pr-release@2x.png" alt="Gem Version" height="18"></a>
2
2
  ==============
3
3
 
4
- Creates a pull request which summarizes feature branches that are to be
5
- released into production. Useful if your branching storategy is like below:
4
+ Creates a "release pull request", whose body consists of features list or
5
+ pull requests that are to be released into production. It's especially useful for QA and
6
+ pre-release checks. `git-pr-release` automatically collect pull requests
7
+ merged into master branch and generates the content of the release
8
+ pull request.
9
+
10
+ ![Screenshot](https://cloud.githubusercontent.com/assets/113420/3147184/61bf2eec-ea53-11e3-835b-50d63ed11b39.png)
11
+
12
+ Suitable for branching strategy like below (similar to git-flow):
6
13
 
7
14
  * Feature branches are first merged into "staging" (or release, development)
8
15
  branch.
@@ -12,7 +19,9 @@ released into production. Useful if your branching storategy is like below:
12
19
  Configuration
13
20
  -------------
14
21
 
15
- All configuration are taken using `git config`.
22
+ All configuration are taken using `git config`. You can write these variables
23
+ in file `.git-pr-release` (instead of `.git/config` or `~/.gitconfig`) to share project-wise configuration to other
24
+ collaborators.
16
25
 
17
26
  ### `pr-release.token`
18
27
 
@@ -38,7 +47,9 @@ Default value: `staging`.
38
47
 
39
48
  ### `pr-release.template`
40
49
 
41
- The template file path (relative to the workidir top) for pull requests created. Its first line is used for the PR title, the rest for the body. This is an ERB template.
50
+ The template file path (relative to the workidir top) for pull requests
51
+ created. Its first line is used for the PR title, the rest for the body. This
52
+ is an ERB template.
42
53
 
43
54
  If not specified, the content below is used as the template (embedded in the code):
44
55
 
@@ -48,3 +59,8 @@ Release <%= Time.now %>
48
59
  <%= pr.to_checklist_item %>
49
60
  <% end -%>
50
61
  ```
62
+
63
+ Author
64
+ ------
65
+
66
+ motemen <motemen@gmail.com>, original in-house version written by @hitode909.
@@ -183,7 +183,8 @@ def obtain_token!
183
183
 
184
184
  temporary_client = Octokit::Client.new :login => username, :password => password
185
185
 
186
- auth = temporary_client.create_authorization({ :scopes => [ 'public_repo', 'repo' ], :note => 'summerize-release' })
186
+ auth = request_authorization(temporary_client, nil)
187
+
187
188
  token = auth.token
188
189
  git_config_set 'token', token
189
190
  end
@@ -191,6 +192,21 @@ def obtain_token!
191
192
  token
192
193
  end
193
194
 
195
+ def request_authorization(client, two_factor_code)
196
+ params = { :scopes => [ 'public_repo', 'repo' ], :note => 'git-pr-release' }
197
+ params[:headers] = { "X-GitHub-OTP" => two_factor_code} if two_factor_code
198
+
199
+ auth = nil
200
+ begin
201
+ auth = client.create_authorization(params)
202
+ rescue Octokit::OneTimePasswordRequired
203
+ two_factor_code = ask('two-factor authentication code? ')
204
+ auth = request_authorization(client, two_factor_code)
205
+ end
206
+
207
+ auth
208
+ end
209
+
194
210
  def host_and_repository
195
211
  @host_and_repository ||= begin
196
212
  remote = git(:config, 'remote.origin.url').first.chomp
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "git-pr-release"
7
- spec.version = '0.1.0'
7
+ spec.version = '0.1.1'
8
8
  spec.authors = ["motemen"]
9
9
  spec.email = ["motemen@gmail.com"]
10
10
  spec.summary = 'Creates a release pull request'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-pr-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - motemen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-13 00:00:00.000000000 Z
11
+ date: 2014-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -78,6 +78,7 @@ files:
78
78
  - ".gitignore"
79
79
  - Gemfile
80
80
  - Gemfile.lock
81
+ - LICENSE
81
82
  - README.md
82
83
  - Rakefile
83
84
  - bin/git-pr-release