ruco 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Gemfile.lock +14 -12
- data/Rakefile +2 -17
- data/Readme.md +1 -1
- data/lib/ruco/syntax_parser.rb +7 -2
- data/lib/ruco/version.rb +1 -1
- data/spec/ruco/syntax_parser_spec.rb +4 -0
- metadata +4 -4
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruco (0.2.
|
4
|
+
ruco (0.2.18)
|
5
5
|
clipboard (>= 0.9.8)
|
6
6
|
language_sniffer
|
7
7
|
textpow (>= 1.3.0)
|
@@ -9,27 +9,29 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
+
bump (0.3.9)
|
12
13
|
clipboard (1.0.1)
|
13
|
-
diff-lcs (1.1.
|
14
|
-
language_sniffer (1.0.
|
14
|
+
diff-lcs (1.1.3)
|
15
|
+
language_sniffer (1.0.2)
|
15
16
|
oniguruma (1.1.0)
|
16
17
|
plist (3.1.0)
|
17
18
|
rake (0.9.2.2)
|
18
|
-
rspec (2.
|
19
|
-
rspec-core (~> 2.
|
20
|
-
rspec-expectations (~> 2.
|
21
|
-
rspec-mocks (~> 2.
|
22
|
-
rspec-core (2.
|
23
|
-
rspec-expectations (2.
|
24
|
-
diff-lcs (~> 1.1.
|
25
|
-
rspec-mocks (2.
|
26
|
-
textpow (1.3.
|
19
|
+
rspec (2.12.0)
|
20
|
+
rspec-core (~> 2.12.0)
|
21
|
+
rspec-expectations (~> 2.12.0)
|
22
|
+
rspec-mocks (~> 2.12.0)
|
23
|
+
rspec-core (2.12.2)
|
24
|
+
rspec-expectations (2.12.1)
|
25
|
+
diff-lcs (~> 1.1.3)
|
26
|
+
rspec-mocks (2.12.2)
|
27
|
+
textpow (1.3.1)
|
27
28
|
plist (>= 3.0.1)
|
28
29
|
|
29
30
|
PLATFORMS
|
30
31
|
ruby
|
31
32
|
|
32
33
|
DEPENDENCIES
|
34
|
+
bump
|
33
35
|
ffi
|
34
36
|
oniguruma
|
35
37
|
rake
|
data/Rakefile
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
require 'bundler/setup'
|
2
3
|
require 'bundler/gem_tasks'
|
4
|
+
require 'bump/tasks'
|
3
5
|
|
4
6
|
task :default do
|
5
7
|
sh "rspec spec/"
|
@@ -28,20 +30,3 @@ task :key do
|
|
28
30
|
Curses.addstr("#{key.inspect} ");
|
29
31
|
end
|
30
32
|
end
|
31
|
-
|
32
|
-
# extracted from https://github.com/grosser/project_template
|
33
|
-
rule /^version:bump:.*/ do |t|
|
34
|
-
sh "git status | grep 'nothing to commit'" # ensure we are not dirty
|
35
|
-
index = ['major', 'minor','patch'].index(t.name.split(':').last)
|
36
|
-
file = 'lib/ruco/version.rb'
|
37
|
-
|
38
|
-
version_file = File.read(file)
|
39
|
-
old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
|
40
|
-
version_parts[index] = version_parts[index].to_i + 1
|
41
|
-
version_parts[2] = 0 if index < 2 # remove patch for minor
|
42
|
-
version_parts[1] = 0 if index < 1 # remove minor for major
|
43
|
-
new_version = version_parts * '.'
|
44
|
-
File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
|
45
|
-
|
46
|
-
sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
|
47
|
-
end
|
data/Readme.md
CHANGED
@@ -161,4 +161,4 @@ Authors
|
|
161
161
|
[Michael Grosser](http://grosser.it)<br/>
|
162
162
|
grosser.michael@gmail.com<br/>
|
163
163
|
License: MIT<br/>
|
164
|
-
[![Build Status](https://
|
164
|
+
[![Build Status](https://travis-ci.org/grosser/ruco.png)](https://travis-ci.org/grosser/ruco)
|
data/lib/ruco/syntax_parser.rb
CHANGED
@@ -13,8 +13,13 @@ module Ruco
|
|
13
13
|
|
14
14
|
def self.syntax_for_lines(lines, languages)
|
15
15
|
if syntax = syntax_node(languages)
|
16
|
-
|
17
|
-
|
16
|
+
begin
|
17
|
+
processor = syntax.parse(lines.join("\n"), Ruco::ArrayProcessor.new)
|
18
|
+
processor.lines
|
19
|
+
rescue RegexpError
|
20
|
+
$stderr.puts $!
|
21
|
+
[]
|
22
|
+
end
|
18
23
|
else
|
19
24
|
[]
|
20
25
|
end
|
data/lib/ruco/version.rb
CHANGED
@@ -64,6 +64,10 @@ describe Ruco::SyntaxParser do
|
|
64
64
|
it "can handle unfound syntaxes" do
|
65
65
|
parse('aaaa', ['fooo']).should == []
|
66
66
|
end
|
67
|
+
|
68
|
+
it "can handle RegexpErrors" do
|
69
|
+
parse(["(?# 2: NIL )(NIL)(?=[\\x80-\\xff(){ \\x00-\\x1f\\x7f%*\#{'\"'}\\\\\\[\\]+])|\\"])
|
70
|
+
end
|
67
71
|
end
|
68
72
|
|
69
73
|
describe :syntax_nodes do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: clipboard
|
@@ -145,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
segments:
|
147
147
|
- 0
|
148
|
-
hash:
|
148
|
+
hash: 169951991926027466
|
149
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
151
|
requirements:
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
segments:
|
156
156
|
- 0
|
157
|
-
hash:
|
157
|
+
hash: 169951991926027466
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
160
|
rubygems_version: 1.8.24
|