errata 1.0.2 → 1.0.3

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.
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ coverage
4
4
  rdoc
5
5
  pkg
6
6
  Gemfile.lock
7
+ *.gem
@@ -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
- if matching_expression.is_a? ::Regexp
40
+ case matching_expression
41
+ when ::Regexp
41
42
  matching_expression.match row[section].to_s
42
- else
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?('/') and options['x'].end_with?('/')) or options['x'].start_with?('%r{')
57
- if as_regexp = options['x'].as_regexp
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
@@ -1,3 +1,3 @@
1
1
  class Errata
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Seamus Abshere