strict_open_struct 0.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: f58b827f4e82e5e0040523c40ec0578c82468319
4
- data.tar.gz: 3055dd189141a68ae81d639eb461239908726dbe
3
+ metadata.gz: 8472c72ec447b974aa0492d24169d22184bf1102
4
+ data.tar.gz: 29145adf654bb7b8596e69e501f2b6a61d3b94f9
5
5
  SHA512:
6
- metadata.gz: ce49ec0361161ab61ea143f9b4be9ade8f4b60b225464dc8aa8c18fc00d1376971d0d3a12b95e46ed6ec2c965e55a8c8fc79f7647d4fc989a5d3d185c7d7d308
7
- data.tar.gz: 7dde80b12614ef34b271065df8e8af88f3765795eb9fbae61c83190dc8191c054c92f1fe6f3a756ff402a08e539e493878ff0d7dfb056a9ac249ee70a394298d
6
+ metadata.gz: b1d6318a21c1fa2261b6d8f11f91f176f15cba2d629e070fcda81b70d3b1f8a3734ea1670f3cfa18e4d04576dd9e1bf489ca2a9714204d17a54c03619036c98b
7
+ data.tar.gz: 5073b4ad0687ff0ba253b8c0c2782ccdbbd74c5010e89dfe1df6e679fe0a35c397a67418e7383c1dd899056a701779f1713c759646fa972c827a4e369e09ab06
data/README.md CHANGED
@@ -7,13 +7,17 @@ A thin layer on top of OpenStruct that raises an exception when you access undef
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'strict_open_struct', github: 'Preferral/strict_open_struct'
10
+ gem 'strict_open_struct'
11
11
  ```
12
12
 
13
13
  And then execute:
14
14
 
15
15
  $ bundle
16
16
 
17
+ Or install it yourself as:
18
+
19
+ $ gem install strict_open_struct
20
+
17
21
  ## Usage
18
22
 
19
23
  Use it just like you would use OpenStruct, but if you try to access a key that has not been defined, an exception will be raised.
@@ -15,4 +15,8 @@ class StrictOpenStruct
15
15
  fail NoMethodError, "undefined method `#{method_name}' for #{self}"
16
16
  end
17
17
  end
18
+
19
+ def ==(other)
20
+ @open_struct == other.instance_variable_get("@open_struct")
21
+ end
18
22
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "strict_open_struct"
7
- spec.version = "0.0.1"
7
+ spec.version = "0.0.1.1"
8
8
  spec.authors = ["Nathan Wenneker"]
9
9
  spec.email = ["nathan@preferral.com"]
10
10
  spec.summary = %q{Thin layer on top of OpenStruct to raise exceptions for undefined keys.}
data/test/basic_test.rb CHANGED
@@ -33,5 +33,18 @@ describe StrictOpenStruct do
33
33
  end
34
34
  end
35
35
 
36
+ describe "#==" do
37
+ specify "equal if insantiated with same data" do
38
+ assert_equal StrictOpenStruct.new(a: 'a'), StrictOpenStruct.new(a: 'a')
39
+ end
40
+
41
+ specify "equal if has same data" do
42
+ sos1 = StrictOpenStruct.new
43
+ sos1.a = 'a'
44
+ sos2 = StrictOpenStruct.new(a: 'a')
45
+ assert_equal sos1, sos2
46
+ end
47
+ end
48
+
36
49
  end
37
50
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strict_open_struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Wenneker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-21 00:00:00.000000000 Z
11
+ date: 2016-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -73,10 +73,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  requirements: []
75
75
  rubyforge_project:
76
- rubygems_version: 2.4.8
76
+ rubygems_version: 2.4.5.1
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: Thin layer on top of OpenStruct to raise exceptions for undefined keys.
80
80
  test_files:
81
81
  - test/basic_test.rb
82
- has_rdoc: