errata 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/lib/errata/erratum.rb +5 -6
- data/lib/errata/version.rb +1 -1
- metadata +3 -3
data/.gitignore
CHANGED
data/lib/errata/erratum.rb
CHANGED
@@ -37,9 +37,10 @@ class Errata
|
|
37
37
|
|
38
38
|
def expression_matches?(row)
|
39
39
|
return true if matching_expression.blank? or section.blank?
|
40
|
-
|
40
|
+
case matching_expression
|
41
|
+
when ::Regexp
|
41
42
|
matching_expression.match row[section].to_s
|
42
|
-
|
43
|
+
when ::String
|
43
44
|
row[section].to_s.include? matching_expression
|
44
45
|
end
|
45
46
|
end
|
@@ -53,10 +54,8 @@ class Errata
|
|
53
54
|
@matching_expression = []
|
54
55
|
@matching_expression[0] = if options['x'].blank?
|
55
56
|
nil
|
56
|
-
elsif (options['x'].start_with?('/')
|
57
|
-
|
58
|
-
::Regexp.new(*as_regexp)
|
59
|
-
end
|
57
|
+
elsif (options['x'].start_with?('/') or options['x'].start_with?('%r{')) and as_regexp = options['x'].as_regexp
|
58
|
+
::Regexp.new(*as_regexp)
|
60
59
|
elsif /\Aabbr\((.*)\)\z/.match options['x']
|
61
60
|
abbr = $1.split(/(\w\??)/).reject { |a| a == '' }.join('\.?\s?') + '\.?([^\w\.]|\z)'
|
62
61
|
expr = '(\A|\s)' + abbr
|
data/lib/errata/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: errata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Seamus Abshere
|