hashie 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,9 +1,10 @@
1
1
  # A sample Gemfile
2
- source :gemcutter
2
+ source 'http://rubygems.org'
3
3
 
4
4
  group :development do
5
5
  gem 'rake'
6
6
  gem 'json'
7
+ gem 'jeweler'
7
8
  end
8
9
 
9
10
  group :test do
@@ -1,25 +1,24 @@
1
- ---
2
- dependencies:
3
- rake:
4
- group:
5
- - :development
6
- version: ">= 0"
7
- rspec:
8
- group:
9
- - :test
10
- version: ">= 0"
11
- json:
12
- group:
13
- - :development
14
- version: ">= 0"
15
- specs:
16
- - rake:
17
- version: 0.8.7
18
- - json:
19
- version: 1.4.3
20
- - rspec:
21
- version: 1.3.0
22
- hash: d9c314ac1790a9ac25dfdaf7574b86d62b88f1d5
23
- sources:
24
- - Rubygems:
25
- uri: http://gemcutter.org
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ gemcutter (0.6.1)
5
+ git (1.2.5)
6
+ jeweler (1.4.0)
7
+ gemcutter (>= 0.1.0)
8
+ git (>= 1.2.5)
9
+ rubyforge (>= 2.0.0)
10
+ json (1.4.3)
11
+ json_pure (1.4.3)
12
+ rake (0.8.7)
13
+ rspec (1.3.0)
14
+ rubyforge (2.0.4)
15
+ json_pure (>= 1.1.7)
16
+
17
+ PLATFORMS
18
+ ruby
19
+
20
+ DEPENDENCIES
21
+ jeweler
22
+ json
23
+ rake
24
+ rspec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hashie}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Bleigh"]
12
- s.date = %q{2010-06-22}
12
+ s.date = %q{2010-07-28}
13
13
  s.description = %q{Hashie is a small collection of tools that make hashes more powerful. Currently includes Mash (Mocking Hash) and Dash (Discrete Hash).}
14
14
  s.email = %q{michael@intridea.com}
15
15
  s.extra_rdoc_files = [
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
42
42
  s.homepage = %q{http://github.com/intridea/hashie}
43
43
  s.rdoc_options = ["--charset=UTF-8"]
44
44
  s.require_paths = ["lib"]
45
- s.rubygems_version = %q{1.3.6}
45
+ s.rubygems_version = %q{1.3.7}
46
46
  s.summary = %q{Your friendly neighborhood hash toolkit.}
47
47
  s.test_files = [
48
48
  "spec/hashie/clash_spec.rb",
@@ -56,7 +56,7 @@ Gem::Specification.new do |s|
56
56
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
57
57
  s.specification_version = 3
58
58
 
59
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
59
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
60
60
  s.add_development_dependency(%q<rspec>, [">= 0"])
61
61
  else
62
62
  s.add_dependency(%q<rspec>, [">= 0"])
@@ -111,7 +111,13 @@ module Hashie
111
111
  alias_method :update, :deep_update
112
112
  alias_method :merge!, :update
113
113
 
114
-
114
+ # Will return true if the Mash has had a key
115
+ # set in addition to normal respond_to? functionality.
116
+ def respond_to?(method_name)
117
+ return true if key?(method_name)
118
+ super
119
+ end
120
+
115
121
  def method_missing(method_name, *args, &blk)
116
122
  return self[method_name] if key?(method_name)
117
123
  match = method_name.to_s.match(/(.*?)([?=!]?)$/)
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Hashie::Clash do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  class DashTest < Hashie::Dash
4
4
  property :first_name
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Hash do
4
4
  it "should be convertible to a Hashie::Mash" do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Hashie::Mash do
4
4
  before(:each) do
@@ -82,6 +82,16 @@ describe Hashie::Mash do
82
82
  record.son = MyMash.new
83
83
  record.son.class.should == MyMash
84
84
  end
85
+
86
+ describe '#respond_to?' do
87
+ it 'should respond to a normal method' do
88
+ Hashie::Mash.new.should be_respond_to(:key?)
89
+ end
90
+
91
+ it 'should respond to a set key' do
92
+ Hashie::Mash.new(:abc => 'def').should be_respond_to(:abc)
93
+ end
94
+ end
85
95
 
86
96
  context "#initialize" do
87
97
  it "should convert an existing hash to a Hashie::Mash" do
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashie
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 19
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 2
8
- - 1
9
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Michael Bleigh
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-06-22 00:00:00 -04:00
18
+ date: 2010-07-28 00:00:00 -05:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: rspec
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 3
27
30
  segments:
28
31
  - 0
29
32
  version: "0"
@@ -70,23 +73,27 @@ rdoc_options:
70
73
  require_paths:
71
74
  - lib
72
75
  required_ruby_version: !ruby/object:Gem::Requirement
76
+ none: false
73
77
  requirements:
74
78
  - - ">="
75
79
  - !ruby/object:Gem::Version
80
+ hash: 3
76
81
  segments:
77
82
  - 0
78
83
  version: "0"
79
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
+ none: false
80
86
  requirements:
81
87
  - - ">="
82
88
  - !ruby/object:Gem::Version
89
+ hash: 3
83
90
  segments:
84
91
  - 0
85
92
  version: "0"
86
93
  requirements: []
87
94
 
88
95
  rubyforge_project:
89
- rubygems_version: 1.3.6
96
+ rubygems_version: 1.3.7
90
97
  signing_key:
91
98
  specification_version: 3
92
99
  summary: Your friendly neighborhood hash toolkit.