bmg 0.9.0 → 0.9.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb470e183450764deb107abde24e74ab37889bb1
4
- data.tar.gz: 5ee77b5b2ad43e0bd433768dd909ddc7038a8e7a
3
+ metadata.gz: 8dd18a64aa1408889e2decc14ddb3a51bd0ec73d
4
+ data.tar.gz: 561af2cc9d8793ac79b1011c23c4e6c721cd26d3
5
5
  SHA512:
6
- metadata.gz: 22a0903f17bb116601e3c8a40946b516269f21fd334e38f29b11f30fc8db39c97d1db83fc295f30709c921b6f25c2953dea6acd627affb65f17e0a56af442822
7
- data.tar.gz: 1773884867ab4c693405711dbbb85f92a2cbcff8d802876b3cd09ec75fc88f28975b4ac905c262f1970e71e651ec974f4edf4bf38dcd5befab20b655d7449f67
6
+ metadata.gz: 1870b9fcb76b2667ed83967ff80c7776f40d9622f55195aee8428a06fdeca4d298e014a82f1db904bbd3acc985fc0be94e9e1dc3ae1f47a0e06a6d5b753f2fb9
7
+ data.tar.gz: 49107701d07c644f7f6eed57b6c28c8a5dc61a38beda056d4a9b18bc0bfdd489627239f0ec944ac3933e00ebe8552a0c36c568cee6672bc938c1acdae0a9df6f
@@ -9,7 +9,9 @@ module Bmg
9
9
  class Rxmatch
10
10
  include Operator::Unary
11
11
 
12
- DEFAULT_OPTIONS = {}
12
+ DEFAULT_OPTIONS = {
13
+ case_sensitive: false
14
+ }
13
15
 
14
16
  def initialize(type, operand, attrs, matcher, options)
15
17
  @type = type
@@ -23,11 +25,20 @@ module Bmg
23
25
 
24
26
  attr_reader :attrs, :matcher, :options
25
27
 
28
+ def case_sensitive?
29
+ !!options[:case_sensitive]
30
+ end
31
+
26
32
  public
27
33
 
28
34
  def each
29
35
  @operand.each do |tuple|
30
36
  against = attrs.map{|a| tuple[a] }.join(" ")
37
+ matcher = self.matcher
38
+ unless case_sensitive?
39
+ against = against.downcase
40
+ matcher = matcher.downcase if matcher.is_a?(String)
41
+ end
31
42
  yield(tuple) if against.match(matcher)
32
43
  end
33
44
  end
data/lib/bmg/version.rb CHANGED
@@ -2,7 +2,7 @@ module Bmg
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 9
5
- TINY = 0
5
+ TINY = 1
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau