step-up 0.9.14 → 0.9.15

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: 23a083c3d4432283633740caa8eec67b28f4c3d8
4
- data.tar.gz: 136320f6af4575bbcb89c785d55b8e016c6d28ef
3
+ metadata.gz: 1d03c89014d133140d42ebf3ba3a7d7f356cc947
4
+ data.tar.gz: e4ceeb620cc75fb5b6917b25de5e3cce7f772e92
5
5
  SHA512:
6
- metadata.gz: 04328a299e7fecedf4eb867604f17ac6cfcf96ef0f3ac719be636334d6737f1521388aa063af3a3e1dc104cc756b7db34e20e40c5fd3256fd02c70c62755f6f9
7
- data.tar.gz: 52d5f3174b2d3cd92248795aed87379d01b8a90ccc446086df9e8ea6eaa035a83cf0164c2d1cee04082050e8181233519b7bcf7d5a6ead27d122485db0de42d2
6
+ metadata.gz: 1cd9801df478ea2e50fb8e55ac4569080f3057196989771c4a6ca3d874b333cb15f95a4f04ecee60a069f82bac1d1112d96f672d7b535109ef27a4a2bd34de15
7
+ data.tar.gz: 93e1f951fa329f7f352742303c583b5142bfdad275e16c7c032a7c27e07b5f2178780e43d9a67e11f6d85e993e1c4f206159009e6a654a28682e5683ab5d46b7
@@ -1 +1 @@
1
- v0.9.14
1
+ v0.9.15
@@ -492,7 +492,8 @@ module StepUp
492
492
  puts "Make sure of having set the editor as appropriate."
493
493
  exit 1
494
494
  end
495
- File.read(temp_file).gsub(/^\#.*/m, '').rstrip
495
+ f = File.read(temp_file)
496
+ NotesUtil.safe_gsub(f){ |m| m.gsub(/^\#.*/m, '').rstrip }
496
497
  else
497
498
  puts <<-TEXT
498
499
  No editor found.
@@ -1,12 +1,24 @@
1
1
  module StepUp
2
2
  module NotesUtil
3
3
  def parse_message(message)
4
- message = message.rstrip.force_encoding('utf-8').gsub(/^((?: )*)( )?([^ \-\n])/){ "%s %s %s" % [$1, $2 || '-', $3] }
4
+ message = safe_gsub(message.rstrip.force_encoding("UTF-8")){ |m| m.gsub(/^((?: )*)( )?([^ \-\n])/){ "%s %s %s" % [$1, $2 || '-', $3] } }
5
5
  begin
6
6
  changed = message.sub!(/^(\s*-\s.*?\n)(?:\s*\n)+(\s*-\s)/, '\1\2')
7
7
  end until changed.nil?
8
8
  message
9
9
  end
10
+
11
+ def safe_gsub(message)
12
+ begin
13
+ yield message
14
+ rescue Exception => e
15
+ if e.message.start_with?('invalid byte')
16
+ yield(message.force_encoding('ISO-8859-1').encode('UTF-8'))
17
+ else
18
+ raise e
19
+ end
20
+ end
21
+ end
10
22
  extend self
11
23
  end
12
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: step-up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.14
4
+ version: 0.9.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Manzan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-16 00:00:00.000000000 Z
12
+ date: 2018-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -142,13 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: 1.3.6
143
143
  requirements: []
144
144
  rubyforge_project: step-up
145
- rubygems_version: 2.5.1
145
+ rubygems_version: 2.5.2
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: The best way to manage your project's versioning
149
- test_files:
150
- - spec/lib/config_spec.rb
151
- - spec/lib/step-up/driver/git_spec.rb
152
- - spec/lib/step-up/parser/version_mask_spec.rb
153
- - spec/lib/step-up/ranged_notes_spec.rb
154
- - spec/spec_helper.rb
149
+ test_files: []