watson-ruby 1.0.2 → 1.0.3

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: 28e8e2c2c044559ea4323048b26193e7a442441b
4
- data.tar.gz: 7506151d5e976c6c5bfd043d16e27008dea49d5c
3
+ metadata.gz: 8c844168342cec7be1e4f91e7e13c875a43ba57e
4
+ data.tar.gz: fa9e80a9cc46fe538a7cd7526a65eca20c072262
5
5
  SHA512:
6
- metadata.gz: c06babe56fbd2dc01e0886d556a6c8aa9c3af9aefc3bb0472d64117ccf38f33d808c14c37b849e84c198b20a109adf0b75f8e0e8ee25e4318ecdb18c27343ee3
7
- data.tar.gz: a1b4c656fe5a0aa690b15887ef346943708a3a732412e3d13d99eb8aa4e9b392d52a359ad880b3dc566de129f57b45b360237d59794d46491843fff0b377d886
6
+ metadata.gz: a33eed2db55fe71083e6bf4f7bbf3a48d820b671d4830ea8cd08faa2804f5ad8b321340a937d6e70c14b47607dc672a97c92c4265b43e3e1dd11ab77f1b1cb3f
7
+ data.tar.gz: 8c2ae5068a18f17685a42d752b444e51e6205fbafcf120315037543183237e7147281577c366c3cf95d5603d978d451e1c8b01965bfcf1c5179a03a48c52577e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- watson (1.0.0)
4
+ watson-ruby (1.0.1)
5
5
  json
6
6
 
7
7
  GEM
@@ -25,4 +25,4 @@ PLATFORMS
25
25
  DEPENDENCIES
26
26
  rake
27
27
  rspec
28
- watson!
28
+ watson-ruby!
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # watson-ruby
2
2
  ### an inline issue manager
3
3
  [watson](http://goosecode.com/watson) ([mirror](http://nhmood.github.io/watson-ruby)) is a tool for creating and tracking bug reports, issues, and internal notes in code.
4
- It is avaliable in two flavors, [watson-ruby](http://github.com/nhmood/watson-ruby) and [watson-perl](http://github.com/watson-perl)
4
+ It is avaliable in two flavors, [watson-ruby](http://github.com/nhmood/watson-ruby) and [watson-perl](http://github.com/nhmood/watson-perl)
5
5
 
6
6
  ### See watson in action [here](http://goosecode.com/watson) ([mirror](http://nhmood.github.io/watson-ruby))
7
7
  ### See the RDoc documentation [here](http://goosecode.com/watson/ruby/doc/) ([mirror](http://nhmood.github.io/watson-ruby/ruby/doc/))
data/lib/watson/config.rb CHANGED
@@ -176,7 +176,7 @@ module Watson
176
176
 
177
177
  # Generate full path since File doesn't care about the LOAD_PATH
178
178
  # [review] - gsub uses (.?)+ to grab anything after lib (optional), better regex?
179
- _full_path = __dir__.gsub(/\/lib(.?)+/, '') + "/" + "assets/defaultConf"
179
+ _full_path = __dir__.gsub(%r!/lib/watson(.?)+!, '') + "/assets/defaultConf"
180
180
  debug_print "Full path to defaultConf (in gem): #{ _full_path }\n"
181
181
 
182
182
  # Check to make sure we can access the default file
data/lib/watson/parser.rb CHANGED
@@ -207,8 +207,15 @@ module Watson
207
207
  _data = Array.new()
208
208
  File.open(_absolute_path, 'r').read.each_line do | _line |
209
209
  _data.push(_line)
210
+ # If we can't encode (ever) to UTF-8, clear _data and break
211
+ begin
212
+ _line.encode('UTF-8', :invalid => :replace)
213
+ rescue ArgumentError
214
+ debug_print "Could not encode to UTF-8, non-text\n"
215
+ _data = Array.new()
216
+ break
217
+ end
210
218
  end
211
-
212
219
 
213
220
  # Initialize issue list hash
214
221
  _issue_list = Hash.new()
@@ -227,7 +234,7 @@ module Watson
227
234
  # Find any comment line with [tag] - text (any comb of space and # acceptable)
228
235
  # Using if match to stay consistent (with config.rb) see there for
229
236
  # explanation of why I do this (not a good good one persay...)
230
- _mtch = _line.encode('UTF-8', :invalid => :replace).match(/^[#{ _comment_type }+?\s+?]+\[(\w+)\]\s+-\s+(.+)/)
237
+ _mtch = _line.match(/^[#{ _comment_type }+?\s+?]+\[(\w+)\]\s+-\s+(.+)/)
231
238
  if !_mtch
232
239
  debug_print "No valid tag found in line, skipping\n"
233
240
  next
@@ -378,9 +385,17 @@ module Watson
378
385
  ".java", ".class", ".cs", ".js", ".php"
379
386
  debug_print "Comment type is: //\n"
380
387
  return "//"
388
+
389
+ when ".hs"
390
+ debug_print "Comment type is: --\n"
391
+ return "--"
392
+
393
+ when ".erl"
394
+ debug_print "Comment type is: %\n"
395
+ return "%"
381
396
 
382
397
  # Bash, Ruby, Perl, Python
383
- when ".sh", ".rb", ".pl", ".py"
398
+ when ".sh", ".rb", ".pl", ".py", ".coffee"
384
399
  debug_print "Comment type is: #\n"
385
400
  return "#"
386
401
 
@@ -1,3 +1,3 @@
1
1
  module Watson
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
data/spec/parser_spec.rb CHANGED
@@ -22,6 +22,10 @@ describe Parser do
22
22
  @parser.get_comment_type('lib/watson.rb').should eql '#'
23
23
  end
24
24
 
25
+ it 'return correct extension (# for coffee)' do
26
+ @parser.get_comment_type('lib/watson.coffee').should eql '#'
27
+ end
28
+
25
29
  it 'return correct extension (// for c/c++)' do
26
30
  @parser.get_comment_type('lib/watson.cpp').should eql '//'
27
31
  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.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - nhmood