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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/watson/fs.rb +2 -2
- data/lib/watson/parser.rb +10 -3
- data/lib/watson/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7bda617cab8b88201fc641200b445d7e2bb00ca
|
4
|
+
data.tar.gz: 0495fbacaf6082fbfae13bca095049f120913667
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6beb97591a44614b91c4b3a9b326889da79894c809abf65d0ecbafe7c41eaa9ca5b475b55cb6f38da8c1efcd98a4386e9e846b9e2b886b0b7537947f4872ee0b
|
7
|
+
data.tar.gz: 1bdc123198f253ed08333773b2f38fd2e2bed481004f58fc395cb1e060a9cc9eba7d6dcf6683f1ad083bb1504393cba9b8718be36c28bbc90409b7e66bed849c
|
data/Gemfile.lock
CHANGED
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' => ['---', '//', '#' ]
|
420
|
+
'.sql' => ['---', '//', '#' ], # SQL and PL types
|
421
|
+
'.lua' => ['--', '--[['] # Lua
|
415
422
|
}
|
416
423
|
|
417
424
|
loop do
|
data/lib/watson/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2013-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|