watson-ruby 1.4.0 → 1.4.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/watson/parser.rb +8 -8
- data/lib/watson/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 010d18c7699c27eecd4b22d22c47561ea9d06165
|
4
|
+
data.tar.gz: 5a74c7c250c89de84952b769a118d62629b614c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cd17d98b5f73e7d417900a50f1dcaabbbb5b6b433328237d233540eaed3dacf97a1006cdc9c0bf1aefc5f681f059e176dbfcf701e28e4862df98e8ebb5354d0
|
7
|
+
data.tar.gz: b8ae589570ee13514d4932fb5346eee2f77503e3db64da2ad1e0991fb36f2ba555ad23c92ef7d8ac651d498ea8c63162c26d69b2c8734d07d97b89d614d508b4
|
data/Gemfile.lock
CHANGED
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 =
|
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(
|
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
|
|
data/lib/watson/version.rb
CHANGED