git-whistles 1.1.0 → 1.1.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: 4304a8f417f4f756f4c2522288980894837415ce
4
- data.tar.gz: d295f0cbd94e9d4dc09a3ab957928324809c122d
3
+ metadata.gz: 87996c40ec0e8b2b61588e2d12335de5963e5c59
4
+ data.tar.gz: 82e9c8d08e76cbd9d9f083daebb6ceb067e44e35
5
5
  SHA512:
6
- metadata.gz: 51ad1985a2f3fe9cf36a5eb55672f2a434d522407b0eed62e0fff7daeb1ccaed6ea0636700705b101f32cabddfac24309ef8ffd8059c4659503abc2e69f15e13
7
- data.tar.gz: 754aa0292b9ad21327a127b9e1815854fd767f95e1f51b4b021f49ca4a944308a13880222b2791eceb12d4abe7d12833d07a119d070197a37e41df2db69d9513
6
+ metadata.gz: 5b8922895876a447737931ff47f7bfe5bb492d5f2db89c1108631c60cc488e2c66a75aa929f42ca640a29ff311b816705cc51f223f2b3cf92c02deb7ec3a53e7
7
+ data.tar.gz: 66bb0f204cf4da2cd7ed47dc91df475ed8b05da373e55847a89ce4eb5812923cfba872aaefd7528a5884a82b5c89480537408708813eb51ae67ee9b9edb9ada4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git-whistles (1.1.0)
4
+ git-whistles (1.1.1)
5
5
  jira-ruby
6
6
  pivotal-tracker (~> 0.5.6)
7
7
  term-ansicolor
@@ -93,4 +93,4 @@ DEPENDENCIES
93
93
  rspec
94
94
 
95
95
  BUNDLED WITH
96
- 1.11.2
96
+ 1.12.3
data/bin/git-jira-pr CHANGED
@@ -122,12 +122,8 @@ class App < Git::Whistles::App
122
122
 
123
123
  title = "#{issue_id}: #{issue.summary}"
124
124
  headline = "Jira story [##{issue_id}](#{@client.options[:site]}/browse/#{issue_id}) in project *#{issue.project.name}*:"
125
- description = issue.description.split("\n").map do |line|
126
- (1..6).each { |i| line.gsub!(/(h#{i}.)/, '#' * i) }
127
- line.gsub!(/({{)|(}})/, '`')
128
- "> #{line}"
129
- end.join("\n")
130
125
 
126
+ description = safe_description(issue.description)
131
127
  query.merge! subject: issue.summary, :"pull_request[title]" => title
132
128
 
133
129
  if (headline.length + description.length) > SAFE_QUERY_STRING_SIZE
@@ -149,6 +145,16 @@ class App < Git::Whistles::App
149
145
  end
150
146
  end
151
147
 
148
+ def safe_description(description)
149
+ return '' unless description
150
+
151
+ description.split("\n").map do |line|
152
+ (1..6).each { |i| line.gsub!(/(h#{i}.)/, '#' * i) }
153
+ line.gsub!(/({{)|(}})/, '`')
154
+ "> #{line}"
155
+ end.join("\n")
156
+ end
157
+
152
158
  def launch_browser(url)
153
159
  BROWSERS.each do |command|
154
160
  next if run("which #{command}").strip.empty?
@@ -4,7 +4,7 @@ require 'pathname'
4
4
 
5
5
  module Git
6
6
  module Whistles
7
- VERSION = "1.1.0"
7
+ VERSION = "1.1.1"
8
8
  GEMDIR = Pathname.new(__FILE__).parent.parent.parent
9
9
  end
10
10
  end
@@ -8,7 +8,7 @@ PROGNAME=$(basename $0)
8
8
 
9
9
 
10
10
  _has_git() {
11
- git rev-parse head > /dev/null 2>&1
11
+ git rev-parse HEAD > /dev/null 2>&1
12
12
  }
13
13
 
14
14
  _check_branches_format() {
@@ -128,7 +128,7 @@ shift $((OPTIND-1))
128
128
 
129
129
  [ $# -gt 0 ] && _usage && _die "Too many arguments."
130
130
 
131
- _has_git || die "Not in a git repository !"
131
+ _has_git || _die "Not in a git repository !"
132
132
 
133
133
  : ${porcelain:=no}
134
134
  : ${where:=local}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-whistles
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Letessier
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-10 00:00:00.000000000 Z
12
+ date: 2016-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  version: 1.3.6
204
204
  requirements: []
205
205
  rubyforge_project:
206
- rubygems_version: 2.5.1
206
+ rubygems_version: 2.6.4
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: 'A few helpers for classic Git workflows: makes branching and merging, PO