jls-grok 0.10.6 → 0.10.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/grok-pure.rb +5 -1
- metadata +10 -5
data/lib/grok-pure.rb
CHANGED
@@ -5,6 +5,8 @@ require "cabin"
|
|
5
5
|
|
6
6
|
# TODO(sissel): Check if 'grok' c-ext has been loaded and abort?
|
7
7
|
class Grok
|
8
|
+
class PatternError < StandardError; end
|
9
|
+
|
8
10
|
# The pattern input
|
9
11
|
attr_accessor :pattern
|
10
12
|
|
@@ -88,7 +90,7 @@ class Grok
|
|
88
90
|
# Replace any instances of '%{FOO}' with that pattern.
|
89
91
|
loop do
|
90
92
|
if iterations_left == 0
|
91
|
-
raise "Deep recursion pattern compilation of #{pattern.inspect} - expanded: #{@expanded_pattern.inspect}"
|
93
|
+
raise PatternError, "Deep recursion pattern compilation of #{pattern.inspect} - expanded: #{@expanded_pattern.inspect}"
|
92
94
|
end
|
93
95
|
iterations_left -= 1
|
94
96
|
m = PATTERN_RE.match(@expanded_pattern)
|
@@ -125,6 +127,8 @@ class Grok
|
|
125
127
|
#puts "m[0]: #{m[0]}"
|
126
128
|
#puts "replacement_pattern => #{replacement_pattern}"
|
127
129
|
index += 1
|
130
|
+
else
|
131
|
+
raise PatternError, "pattern #{m[0]} not defined"
|
128
132
|
end
|
129
133
|
end
|
130
134
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jls-grok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-06-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cabin
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,7 +22,12 @@ dependencies:
|
|
22
22
|
version: 0.4.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 0.4.0
|
26
31
|
description: Grok ruby bindings - pattern match/extraction tool
|
27
32
|
email:
|
28
33
|
- jls@semicomplete.com
|
@@ -60,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
65
|
version: '0'
|
61
66
|
requirements: []
|
62
67
|
rubyforge_project:
|
63
|
-
rubygems_version: 1.8.
|
68
|
+
rubygems_version: 1.8.24
|
64
69
|
signing_key:
|
65
70
|
specification_version: 3
|
66
71
|
summary: grok bindings for ruby
|