watson-ruby 1.4.1 → 1.4.2

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: 010d18c7699c27eecd4b22d22c47561ea9d06165
4
- data.tar.gz: 5a74c7c250c89de84952b769a118d62629b614c8
3
+ metadata.gz: b7bda617cab8b88201fc641200b445d7e2bb00ca
4
+ data.tar.gz: 0495fbacaf6082fbfae13bca095049f120913667
5
5
  SHA512:
6
- metadata.gz: 4cd17d98b5f73e7d417900a50f1dcaabbbb5b6b433328237d233540eaed3dacf97a1006cdc9c0bf1aefc5f681f059e176dbfcf701e28e4862df98e8ebb5354d0
7
- data.tar.gz: b8ae589570ee13514d4932fb5346eee2f77503e3db64da2ad1e0991fb36f2ba555ad23c92ef7d8ac651d498ea8c63162c26d69b2c8734d07d97b89d614d508b4
6
+ metadata.gz: 6beb97591a44614b91c4b3a9b326889da79894c809abf65d0ecbafe7c41eaa9ca5b475b55cb6f38da8c1efcd98a4386e9e846b9e2b886b0b7537947f4872ee0b
7
+ data.tar.gz: 1bdc123198f253ed08333773b2f38fd2e2bed481004f58fc395cb1e060a9cc9eba7d6dcf6683f1ad083bb1504393cba9b8718be36c28bbc90409b7e66bed849c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- watson-ruby (1.4.1)
4
+ watson-ruby (1.4.2)
5
5
  json
6
6
 
7
7
  GEM
data/lib/watson/fs.rb CHANGED
@@ -28,8 +28,8 @@ module Watson
28
28
  return false
29
29
  end
30
30
 
31
- # Check if file can be opened
32
- if File.readable?(file)
31
+ # Check if file is actually a file and can be opened
32
+ if File.file?(file) && File.readable?(file)
33
33
  debug_print "#{ file } exists and opened successfully\n"
34
34
  return true
35
35
  else
data/lib/watson/parser.rb CHANGED
@@ -209,13 +209,18 @@ module Watson
209
209
  _comment_type = get_comment_type(_relative_path)
210
210
  unless _comment_type
211
211
  debug_print "Using default (#) comment type\n"
212
- _comment_type = '#'
212
+ _comment_type = ['#']
213
213
  end
214
214
 
215
+ # Escape out comment type for safety
216
+ # [review] - Is there a way to do inplace join?
217
+ _comment_type = _comment_type.map { |comment| Regexp.escape(comment) }.join("|")
218
+ debug_print "Comment type #{ _comment_type }\n"
219
+
215
220
  # [review] - It is possible to embed the valid tags in the regexp,
216
221
  # with a ~5% performance gain, but this would loose the warning about
217
222
  # unrecognized tags.
218
- _comment_regex = /^[#{ _comment_type }+?\s+?]+\[(\w+)\]\s+-\s+(.+)/
223
+ _comment_regex = /^[[#{ _comment_type }]+?\s+?]+\[(\w+)\]\s+-\s+(.+)/
219
224
 
220
225
 
221
226
  # Open file and read in entire thing into an array
@@ -390,6 +395,7 @@ module Watson
390
395
  '.java' => ['//', '/*', '/**'], # Java
391
396
  '.class' => ['//', '/*', '/**'],
392
397
  '.cs' => ['//', '/*'], # C#
398
+ '.scss' => ['//', '/*'], # SASS SCSS
393
399
  '.js' => ['//', '/*'], # JavaScript
394
400
  '.php' => ['//', '/*', '#'], # PHP
395
401
  '.m' => ['//', '/*'], # ObjectiveC
@@ -411,7 +417,8 @@ module Watson
411
417
  '.coffee' => ['#'], # CoffeeScript
412
418
  '.zsh' => ['#'], # Zsh
413
419
  '.clj' => [';;'], # Clojure
414
- '.sql' => ['---', '//', '#' ] # SQL and PL types
420
+ '.sql' => ['---', '//', '#' ], # SQL and PL types
421
+ '.lua' => ['--', '--[['] # Lua
415
422
  }
416
423
 
417
424
  loop do
@@ -1,3 +1,3 @@
1
1
  module Watson
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watson-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - nhmood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-05 00:00:00.000000000 Z
11
+ date: 2013-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json