git-whistles 0.9.1 → 0.10.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 45a4748235c9aec27b999bc310925befb175bc3e
4
+ data.tar.gz: 018ed7e3b1ebbc8188ec00684a6cd4d62e1743ca
5
+ SHA512:
6
+ metadata.gz: 572fde6b81c12c7f81466bac2701d70fa28b8f5632376a14ae03eae0a64addc48b8e2b4d90a7ded83f3dc3655c060f69288e017353b021e1837b113006312700
7
+ data.tar.gz: f4e65a332fc1a18160c9fb0a04abd9e2bafbd6419891b376073d6807a3ac18ba9d928e189d2955470cc411a35a38c32e695c46fc220ae01ac56f85ad16865248
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git-whistles (0.9.1)
4
+ git-whistles (0.10.0)
5
5
  pivotal-tracker (~> 0.5.6)
6
6
  term-ansicolor
7
7
 
@@ -10,19 +10,20 @@ GEM
10
10
  specs:
11
11
  builder (3.2.2)
12
12
  coderay (1.0.9)
13
- crack (0.4.1)
14
- safe_yaml (~> 0.9.0)
15
- happymapper (0.4.0)
13
+ crack (0.4.2)
14
+ safe_yaml (~> 1.0.0)
15
+ happymapper (0.4.1)
16
16
  libxml-ruby (~> 2.0)
17
+ json (1.8.1)
17
18
  libxml-ruby (2.7.0)
18
19
  method_source (0.8.2)
19
- mime-types (1.25)
20
- mini_portile (0.5.1)
21
- nokogiri (1.6.0)
22
- mini_portile (~> 0.5.0)
23
- nokogiri-happymapper (0.5.7)
20
+ mime-types (1.25.1)
21
+ mini_portile (0.6.0)
22
+ nokogiri (1.6.3.1)
23
+ mini_portile (= 0.6.0)
24
+ nokogiri-happymapper (0.5.9)
24
25
  nokogiri (~> 1.5)
25
- pivotal-tracker (0.5.10)
26
+ pivotal-tracker (0.5.12)
26
27
  builder
27
28
  builder
28
29
  crack
@@ -39,13 +40,16 @@ GEM
39
40
  pry-nav (0.2.3)
40
41
  pry (~> 0.9.10)
41
42
  rake (10.1.0)
42
- rest-client (1.6.7)
43
- mime-types (>= 1.16)
44
- safe_yaml (0.9.5)
43
+ rdoc (4.1.1)
44
+ json (~> 1.4)
45
+ rest-client (1.6.8)
46
+ mime-types (~> 1.16)
47
+ rdoc (>= 2.4.2)
48
+ safe_yaml (1.0.3)
45
49
  slop (3.4.6)
46
- term-ansicolor (1.2.2)
47
- tins (~> 0.8)
48
- tins (0.9.0)
50
+ term-ansicolor (1.3.0)
51
+ tins (~> 1.0)
52
+ tins (1.3.2)
49
53
 
50
54
  PLATFORMS
51
55
  ruby
data/README.md CHANGED
@@ -22,6 +22,7 @@ Use it with:
22
22
  | `git select <story-id>` | Checkout a local branch with the matching number. If not found, lists remote branches |
23
23
  | `git latest-pushes [-n NR_RESULTS] [-p PATTERN]` | Show latest pushed branches to origin. Defaults to 20 results. Pattern is appended to refs/remotes/origin/ so include the team or project name to filter results. [[PedroCunha](https://github.com/PedroCunha)] |
24
24
  | `git pivotal-branch <story-id>` | Creates a branch name suggestion from the specified Pivotal Tracker story ID. It also comments on the story the branch name created and starts the story [[dncrht](https://github.com/dncrht)] |
25
+ | `git pivotal-open [story-id]` | Opens the Pivotal Tracker story page for the current branch, from the specified Pivotal Tracker story ID or it is inferred from the branch name if not supplied [[khiet](https://github.com/khiet)] |
25
26
  | `git explore [-r REF] [-p PATH]` | Opens the remote origin interface on the given reference and path. Reference defaults to current branch and path to root [[PedroCunha](https://github.com/pedrocunha)]|
26
27
 
27
28
 
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: UTF-8
3
+ #
4
+ # git-pivotal-open
5
+ #
6
+ # Opens the Pivotal Tracker story page for the current branch,
7
+ # from the specified Pivotal Tracker story ID
8
+ # or it is inferred from the branch name if not supplied
9
+
10
+ require 'rubygems'
11
+ require 'optparse'
12
+ require 'pivotal-tracker'
13
+ require 'term/ansicolor'
14
+ require 'git-whistles/app'
15
+
16
+ class App < Git::Whistles::App
17
+
18
+ def initialize
19
+ super
20
+ end
21
+
22
+ def main(args)
23
+ super
24
+ parse_args!(args)
25
+
26
+ @story_id = if args.empty?
27
+ branch_name =`git rev-parse --abbrev-ref HEAD`.strip
28
+ branch_name.scan(/\d{8,}/).first
29
+ else
30
+ args.first
31
+ end
32
+
33
+ setup_pivotal_tracker_client
34
+
35
+ warn_story_not_found if @story_id.nil?
36
+
37
+ PivotalTracker::Project.all.find do |project|
38
+ story = project.stories.find(@story_id)
39
+ next unless story
40
+
41
+ system('open', story.url) and return
42
+ end
43
+
44
+ warn_story_not_found
45
+ end
46
+
47
+ private
48
+
49
+ def setup_pivotal_tracker_client
50
+ token = `git config pivotal-tracker.token`.strip
51
+ if token.empty?
52
+ warn_missing_pivotal_tracker_token
53
+ end
54
+ PivotalTracker::Client.token = token
55
+ end
56
+
57
+ def warn_story_not_found
58
+ puts Term::ANSIColor.yellow %Q{
59
+ Story ID: '#{@story_id}' cannot be found in your projects.
60
+ }
61
+ die "Aborting."
62
+ end
63
+
64
+ def warn_missing_pivotal_tracker_token
65
+ puts Term::ANSIColor.yellow %Q{
66
+ I don't know your Pivotal Tracker token!
67
+ Please set it with:
68
+ $ git config [--global] pivotal-tracker.token <token>
69
+ }
70
+ die "Aborting."
71
+ end
72
+
73
+ def option_parser
74
+ @option_parser ||= OptionParser.new do |op|
75
+ op.banner = "Usage: git pivotal-open [story-id]"
76
+
77
+ op.on_tail("-h", "--help", "Show this message") do
78
+ puts op
79
+ exit
80
+ end
81
+ end
82
+ end
83
+
84
+ end
85
+
86
+ ############################################################################
87
+
88
+ App.run!
data/bin/git-pull-request CHANGED
@@ -2,12 +2,12 @@
2
2
  # encoding: UTF-8
3
3
  #
4
4
  # git-pull-request --
5
- #
5
+ #
6
6
  # Open a pull request for the current branch in your default browser
7
- #
7
+ #
8
8
  # Assumes the branches are named
9
9
  # <team>/<branch-title>-<story-id>
10
- #
10
+ #
11
11
  require 'rubygems'
12
12
  require 'pivotal-tracker'
13
13
  require 'optparse'
@@ -58,7 +58,7 @@ class App < Git::Whistles::App
58
58
  }.join('&')
59
59
  url = "https://github.com/#{repo}/compare/#{options.to}...#{options.from}?#{query_string}"
60
60
  puts "Preparing a pull request for branch #{options.from}"
61
-
61
+
62
62
  unless launch_browser(url)
63
63
  log.warn "Sorry, I don't know how to launch a web browser on your system. You can open it yourself and paste this URL:\n#{url}"
64
64
  end
@@ -101,7 +101,7 @@ class App < Git::Whistles::App
101
101
  url =~ /github\.com/ or die "origin does not have a Github URL !"
102
102
  end
103
103
  end
104
- end
104
+ end
105
105
 
106
106
 
107
107
  def repo
@@ -139,7 +139,7 @@ class App < Git::Whistles::App
139
139
 
140
140
  headline = "Pivotal tracker story [##{story_id}](#{story.url}) in project *#{project.name}*:"
141
141
  description = story.description.split("\n").map { |line| "> #{line}" }.join("\n")
142
- body = "#{headline}\n\n#{description}"
142
+ body = "TODO: describe your changes\n\n===\n\n#{headline}\n\n#{description}"
143
143
  title = "#{project.name}: #{story.name} [##{story.id}]"
144
144
  query.merge! :subject => story.name, :"pull_request[body]" => body, :"pull_request[title]" => title
145
145
  return
@@ -4,7 +4,7 @@ require 'pathname'
4
4
 
5
5
  module Git
6
6
  module Whistles
7
- VERSION = "0.9.1"
7
+ VERSION = "0.10.0"
8
8
  GEMDIR = Pathname.new(__FILE__).parent.parent.parent
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-whistles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
5
- prerelease:
4
+ version: 0.10.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Julien Letessier
@@ -10,102 +9,90 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-01-07 00:00:00.000000000 Z
12
+ date: 2014-09-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: bundler
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - ">="
21
19
  - !ruby/object:Gem::Version
22
20
  version: 1.0.0
23
21
  type: :development
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: 1.0.0
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: rake
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - ">="
37
33
  - !ruby/object:Gem::Version
38
34
  version: '0'
39
35
  type: :development
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - ">="
45
40
  - !ruby/object:Gem::Version
46
41
  version: '0'
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: pry
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - ">="
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0'
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - ">="
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: pry-nav
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - ">="
69
61
  - !ruby/object:Gem::Version
70
62
  version: '0'
71
63
  type: :development
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - ">="
77
68
  - !ruby/object:Gem::Version
78
69
  version: '0'
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: pivotal-tracker
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ~>
74
+ - - "~>"
85
75
  - !ruby/object:Gem::Version
86
76
  version: 0.5.6
87
77
  type: :runtime
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ~>
81
+ - - "~>"
93
82
  - !ruby/object:Gem::Version
94
83
  version: 0.5.6
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: term-ansicolor
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
- - - ! '>='
88
+ - - ">="
101
89
  - !ruby/object:Gem::Version
102
90
  version: '0'
103
91
  type: :runtime
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
- - - ! '>='
95
+ - - ">="
109
96
  - !ruby/object:Gem::Version
110
97
  version: '0'
111
98
  description: A few helpers for classic Git workflows
@@ -120,13 +107,14 @@ executables:
120
107
  - git-merge-po
121
108
  - git-outstanding-features
122
109
  - git-pivotal-branch
110
+ - git-pivotal-open
123
111
  - git-pull-request
124
112
  - git-select
125
113
  - git-stash-and-checkout
126
114
  extensions: []
127
115
  extra_rdoc_files: []
128
116
  files:
129
- - .gitignore
117
+ - ".gitignore"
130
118
  - Gemfile
131
119
  - Gemfile.lock
132
120
  - HISTORY
@@ -141,6 +129,7 @@ files:
141
129
  - bin/git-merge-po
142
130
  - bin/git-outstanding-features
143
131
  - bin/git-pivotal-branch
132
+ - bin/git-pivotal-open
144
133
  - bin/git-pull-request
145
134
  - bin/git-select
146
135
  - bin/git-stash-and-checkout
@@ -158,30 +147,26 @@ files:
158
147
  homepage: http://github.com/mezis/git-whistles
159
148
  licenses:
160
149
  - MIT
150
+ metadata: {}
161
151
  post_install_message:
162
152
  rdoc_options: []
163
153
  require_paths:
164
154
  - lib
165
155
  required_ruby_version: !ruby/object:Gem::Requirement
166
- none: false
167
156
  requirements:
168
- - - ! '>='
157
+ - - ">="
169
158
  - !ruby/object:Gem::Version
170
159
  version: '0'
171
- segments:
172
- - 0
173
- hash: -500768484340958016
174
160
  required_rubygems_version: !ruby/object:Gem::Requirement
175
- none: false
176
161
  requirements:
177
- - - ! '>='
162
+ - - ">="
178
163
  - !ruby/object:Gem::Version
179
164
  version: 1.3.6
180
165
  requirements: []
181
166
  rubyforge_project:
182
- rubygems_version: 1.8.23
167
+ rubygems_version: 2.2.2
183
168
  signing_key:
184
- specification_version: 3
185
- summary: ! 'A few helpers for classic Git workflows: makes branching and merging,
186
- PO file handling, issuing pull requests slightly simpler.'
169
+ specification_version: 4
170
+ summary: 'A few helpers for classic Git workflows: makes branching and merging, PO
171
+ file handling, issuing pull requests slightly simpler.'
187
172
  test_files: []