simple_config 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/simple_struct.rb +1 -1
- data/simple_config.gemspec +1 -1
- data/spec/simple_struct_spec.rb +14 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/lib/simple_struct.rb
CHANGED
@@ -16,7 +16,7 @@ class SimpleStruct
|
|
16
16
|
|
17
17
|
def method_missing method_name, *args
|
18
18
|
return self[method_name.to_s.delete("=")] = args.first if method_name[-1] == "="
|
19
|
-
return self[method_name] if @a.has_key?(method_name)
|
19
|
+
return self[method_name] if @a.has_key?(real_key(method_name))
|
20
20
|
|
21
21
|
super method_name, *args
|
22
22
|
end
|
data/simple_config.gemspec
CHANGED
data/spec/simple_struct_spec.rb
CHANGED
@@ -17,21 +17,24 @@ describe SimpleStruct do
|
|
17
17
|
|
18
18
|
describe "indexer" do
|
19
19
|
before :each do
|
20
|
-
@simple_struct = SimpleStruct.create({ :key => "value" })
|
20
|
+
@simple_struct = SimpleStruct.create({ :key => "value", "str_key" => "value" })
|
21
21
|
end
|
22
22
|
|
23
23
|
describe "read" do
|
24
24
|
describe "existing key" do
|
25
25
|
it "index - like" do
|
26
26
|
@simple_struct[:key].should == "value"
|
27
|
+
@simple_struct[:str_key].should == "value"
|
27
28
|
end
|
28
29
|
|
29
30
|
it "does not depends on key type" do
|
30
31
|
@simple_struct["key"].should == "value"
|
32
|
+
@simple_struct["str_key"].should == "value"
|
31
33
|
end
|
32
34
|
|
33
35
|
it "as property" do
|
34
36
|
@simple_struct.key.should == "value"
|
37
|
+
@simple_struct.str_key.should == "value"
|
35
38
|
end
|
36
39
|
end
|
37
40
|
|
@@ -52,17 +55,27 @@ describe SimpleStruct do
|
|
52
55
|
it "index - like" do
|
53
56
|
@simple_struct[:key] = "value1"
|
54
57
|
@simple_struct[:key].should == "value1"
|
58
|
+
|
59
|
+
@simple_struct[:str_key] = "value1"
|
60
|
+
@simple_struct[:str_key].should == "value1"
|
55
61
|
end
|
56
62
|
|
57
63
|
it "does not depends on key type" do
|
58
64
|
@simple_struct["key"] = "value1"
|
59
65
|
@simple_struct[:key].should == "value1"
|
66
|
+
|
67
|
+
@simple_struct["str_key"] = "value1"
|
68
|
+
@simple_struct[:str_key].should == "value1"
|
60
69
|
end
|
61
70
|
|
62
71
|
it "as property" do
|
63
72
|
@simple_struct.key = "value1"
|
64
73
|
@simple_struct.key.should == "value1"
|
65
74
|
@simple_struct[:key].should == "value1"
|
75
|
+
|
76
|
+
@simple_struct.str_key = "value1"
|
77
|
+
@simple_struct.str_key.should == "value1"
|
78
|
+
@simple_struct[:str_key].should == "value1"
|
66
79
|
end
|
67
80
|
end
|
68
81
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Valeriy Prokopchuk
|
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
hash: -
|
117
|
+
hash: -4036705009870281067
|
118
118
|
segments:
|
119
119
|
- 0
|
120
120
|
version: "0"
|