dynahash 0.3.1 → 0.3.2

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.
Files changed (3) hide show
  1. data/lib/dynahash.rb +1 -1
  2. data/test/test.rb +4 -0
  3. metadata +1 -1
@@ -24,7 +24,7 @@ class Hash
24
24
  # caller handle it.
25
25
  name = m.to_s
26
26
  self.keys.find(name) { |key|
27
- key.to_s.gsub(/(@+|:+|\-+|\*+\.+)/, ' ').gsub(/(?<before>[a-z])(?<after>[A-Z])/, '\k<before>_\k<after>').scan(/\w+/).join('_').casecmp(name) == 0
27
+ key.to_s.gsub(/(@+|:+|\-+|\*+|\.+|\?+)/, ' ').gsub(/(?<before>[a-z])(?<after>[A-Z])/, '\k<before>_\k<after>').scan(/\w+/).join('_').casecmp(name.gsub(/\?+/, '')) == 0
28
28
  }
29
29
  end
30
30
  end
@@ -61,6 +61,10 @@ class TestDynaHash < Test::Unit::TestCase
61
61
  assert_equal('A million bucks', h.something_great)
62
62
  end
63
63
 
64
+ def test_ignore_question_mark_on_end
65
+ h = {'Display' => true}
66
+ assert_equal(true, h.display?)
67
+ end
64
68
  def test_all_removals_and_replacements_together
65
69
  h = {'@name' => 'Tony', 'Person Gender' => :male, :dude_type => 'coolness', '-w:T@@F--' => 'um, ok' }
66
70
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dynahash
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.1
5
+ version: 0.3.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tony Heupel