attentive 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f08339af1a0af46d0ed601f66c0fa93196d3921
4
- data.tar.gz: 77b5040ac0c4b37a9dad94a60e7e8d196f9718ea
3
+ metadata.gz: 96872811cbdc5d9db062e11cca2471dc4079a26d
4
+ data.tar.gz: 0df0336e5edf492c51048473605c69a7e9fe1886
5
5
  SHA512:
6
- metadata.gz: 5d81240212f8cef0eeaf6f69f3cbf1512b3870dc11e8205555384b2bbb1584717b8f23795ad1d38de1fbd486c3d34e4090d143f37f31ce8ac5d82268cc327565
7
- data.tar.gz: 34dff8d29cc4b5b1f674a29032dabcd9d0bbd50068616ea2fe9e09e0ae05f77818d94ddaa431363f4aeedcf2a5348256f4dddd57cd296f46a40a4ccf954cb123
6
+ metadata.gz: 61869eae6aacb6c2a66aca38e55ef1ca927236d8239ad402c761744e88a8a9dad99006b5fec14648fe740d43df83a2678c45fad1403ce0f3444fa444261971c2
7
+ data.tar.gz: 4305e44d30e464ff734a72aa3326b9525776ba35f45330cbef4018d8541f754300bd41e4395531831cc628b6ba58ed7f1f7f26511f29d2bdfcd5f87680e3dec5
@@ -55,8 +55,12 @@ module Attentive
55
55
 
56
56
  def matches?(cursor)
57
57
  self.class.phrases.each do |phrase|
58
- match = Attentive::Matcher.new(phrase, cursor.dup).match!
59
- return { variable_name => _value_from_match(match) } if match
58
+ cursor_copy = cursor.dup
59
+ match = Attentive::Matcher.new(phrase, cursor_copy).match!
60
+ if match
61
+ cursor.instance_variable_set :@pos, cursor_copy.pos
62
+ return { variable_name => _value_from_match(match) }
63
+ end
60
64
  end
61
65
  false
62
66
  end
@@ -1,3 +1,3 @@
1
1
  module Attentive
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attentive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Lail