watson-ruby 1.4.0 → 1.4.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: b11a43edd74df47a900897873268d38b056c10f4
4
- data.tar.gz: 95bccd69492466cbf64102bc946d957520781c5b
3
+ metadata.gz: 010d18c7699c27eecd4b22d22c47561ea9d06165
4
+ data.tar.gz: 5a74c7c250c89de84952b769a118d62629b614c8
5
5
  SHA512:
6
- metadata.gz: 3ca841a102298b44102bc684d6e161df044c42233f28d8c7f1a39378a8e0850aa7a926b40d4f125f76ea1525c0897c2cc439f607ab5f2c9f169d14d516170b2a
7
- data.tar.gz: e978dac203b6b8f4c9e7bb75011f5cc0ac824efcf9b1a34613b6f90815b6bc40a278129ab154cf260bbd0761a58c5fee895633477bd94b99556186cbfb888d13
6
+ metadata.gz: 4cd17d98b5f73e7d417900a50f1dcaabbbb5b6b433328237d233540eaed3dacf97a1006cdc9c0bf1aefc5f681f059e176dbfcf701e28e4862df98e8ebb5354d0
7
+ data.tar.gz: b8ae589570ee13514d4932fb5346eee2f77503e3db64da2ad1e0991fb36f2ba555ad23c92ef7d8ac651d498ea8c63162c26d69b2c8734d07d97b89d614d508b4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- watson-ruby (1.4.0)
4
+ watson-ruby (1.4.1)
5
5
  json
6
6
 
7
7
  GEM
data/lib/watson/parser.rb CHANGED
@@ -212,16 +212,16 @@ module Watson
212
212
  _comment_type = '#'
213
213
  end
214
214
 
215
+ # [review] - It is possible to embed the valid tags in the regexp,
216
+ # with a ~5% performance gain, but this would loose the warning about
217
+ # unrecognized tags.
218
+ _comment_regex = /^[#{ _comment_type }+?\s+?]+\[(\w+)\]\s+-\s+(.+)/
219
+
215
220
 
216
221
  # Open file and read in entire thing into an array
217
222
  # Use an array so we can look ahead when creating issues later
218
- # [review] - Not sure if explicit file close is required here
219
223
  # [review] - Better var name than data for read in file?
220
- _data = Array.new()
221
- File.open(_absolute_path, 'r').read.each_line do |_line|
222
- _data.push(_line)
223
- _line.encode('UTF-8', :invalid => :replace)
224
- end
224
+ _data = File.read(_absolute_path).encode('UTF-8', :invalid => :replace).lines
225
225
 
226
226
  # Initialize issue list hash
227
227
  _issue_list = Hash.new()
@@ -241,13 +241,13 @@ module Watson
241
241
  # Using if match to stay consistent (with config.rb) see there for
242
242
  # explanation of why I do this (not a good good one persay...)
243
243
  begin
244
- _mtch = _line.match(/^[#{ _comment_type }+?\s+?]+\[(\w+)\]\s+-\s+(.+)/)
244
+ _mtch = _line.match(_comment_regex)
245
245
  rescue ArgumentError
246
246
  debug_print "Could not encode to UTF-8, non-text\n"
247
247
  end
248
248
 
249
249
  unless _mtch
250
- debug_print "No valid tag found in line, skipping\n"
250
+ # debug_print "No valid tag found in line, skipping\n"
251
251
  next
252
252
  end
253
253
 
@@ -1,3 +1,3 @@
1
1
  module Watson
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watson-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - nhmood