tengine_support 0.3.13 → 0.3.14
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/spec/tengine_support/core_ext/hash/keys_spec.rb +73 -60
- data/tengine_support.gemspec +1 -1
- metadata +18 -18
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.14
|
@@ -1,85 +1,98 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
3
3
|
|
4
|
-
require 'active_support
|
5
|
-
require 'tengine/support/core_ext/hash/keys'
|
4
|
+
require 'active_support'
|
6
5
|
|
7
|
-
|
6
|
+
# この機能は、activesupport-3.1.0から追加された active_support/core_ext/hash/deep_dup を
|
7
|
+
# 使っているので、3.1.0以下ではテストせず、pendingのメッセージを出します
|
8
|
+
if ActiveSupport::VERSION::STRING < "3.1.0"
|
9
|
+
describe "tengine/support/core_ext/hash/keys" do
|
10
|
+
pending %W[
|
11
|
+
depends on active_support/core_ext/hash/deep_dup,
|
12
|
+
but activesupport version is #{ActiveSupport::VERSION::STRING}.
|
13
|
+
If you need to use Hash#deep_stringify_keys and Hash#deep_symbolize_keys,
|
14
|
+
install tengine_support with activesupport >= 3.1.0.
|
15
|
+
].join(' ')
|
16
|
+
end
|
17
|
+
else
|
18
|
+
require 'active_support/core_ext/hash/deep_dup'
|
19
|
+
require 'tengine/support/core_ext/hash/keys'
|
20
|
+
|
21
|
+
describe "tengine/support/core_ext/hash/keys" do
|
8
22
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
23
|
+
test_hashs ={
|
24
|
+
:deep_stringify_keys_result => {
|
25
|
+
'a' => 1,
|
26
|
+
'b' => {
|
27
|
+
'foo' => 2,
|
28
|
+
'bar' => {
|
29
|
+
'hoge' => "3",
|
30
|
+
"wake" => {}.freeze,
|
31
|
+
}.freeze
|
32
|
+
}.freeze,
|
33
|
+
'c' => {
|
34
|
+
'baz' => "4"
|
17
35
|
}.freeze
|
18
36
|
}.freeze,
|
19
|
-
'c' => {
|
20
|
-
'baz' => "4"
|
21
|
-
}.freeze
|
22
|
-
}.freeze,
|
23
37
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
38
|
+
:deep_symbolize_keys_result => {
|
39
|
+
:a => 1,
|
40
|
+
:b => {
|
41
|
+
:foo => 2,
|
42
|
+
:bar => {
|
43
|
+
:hoge => "3",
|
44
|
+
:wake => {}.freeze,
|
45
|
+
}.freeze
|
46
|
+
}.freeze,
|
47
|
+
:c => {
|
48
|
+
:baz => "4"
|
31
49
|
}.freeze
|
32
50
|
}.freeze,
|
33
|
-
:c => {
|
34
|
-
:baz => "4"
|
35
|
-
}.freeze
|
36
|
-
}.freeze,
|
37
51
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
52
|
+
:mixed_key_hash => {
|
53
|
+
'a' => 1,
|
54
|
+
:b => {
|
55
|
+
:foo => 2,
|
56
|
+
'bar' => {
|
57
|
+
'hoge' => "3",
|
58
|
+
:wake => {}.freeze,
|
59
|
+
}.freeze
|
60
|
+
}.freeze,
|
61
|
+
:c => {
|
62
|
+
'baz' => "4"
|
45
63
|
}.freeze
|
46
|
-
}.freeze,
|
47
|
-
:c => {
|
48
|
-
'baz' => "4"
|
49
64
|
}.freeze
|
50
|
-
}
|
51
|
-
}
|
65
|
+
}
|
52
66
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
original.should == test_hashs[target_name]
|
67
|
+
[:deep_stringify_keys, :deep_symbolize_keys].each do |method_name|
|
68
|
+
test_hashs.keys.each do |target_name|
|
69
|
+
context target_name do
|
70
|
+
describe ".#{method_name}" do
|
71
|
+
it "should returns #{method_name}_result" do
|
72
|
+
original = test_hashs[target_name]
|
73
|
+
converted = original.send(method_name)
|
74
|
+
converted.object_id.should_not == original.object_id # object_id is changed
|
75
|
+
converted.should == test_hashs[:"#{method_name}_result"]
|
76
|
+
original.should == test_hashs[target_name]
|
77
|
+
end
|
65
78
|
end
|
66
79
|
end
|
67
80
|
end
|
68
|
-
end
|
69
81
|
|
70
82
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
83
|
+
test_hashs.keys.each do |target_name|
|
84
|
+
context target_name do
|
85
|
+
describe ".#{method_name}!" do
|
86
|
+
it "should equals :#{method_name}_result" do
|
87
|
+
original = test_hashs[target_name].deep_dup
|
88
|
+
result = original.send(:"#{method_name}!")
|
89
|
+
result.object_id.should == original.object_id
|
90
|
+
original.should == test_hashs[:"#{method_name}_result"]
|
91
|
+
end
|
79
92
|
end
|
80
93
|
end
|
81
94
|
end
|
82
95
|
end
|
83
|
-
end
|
84
96
|
|
97
|
+
end
|
85
98
|
end
|
data/tengine_support.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "tengine_support"
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.14"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["saishu", "w-irie", "taigou", "totty", "hiroshinakao", "g-morita", "guemon", "aoetk", "hattori-at-nt", "t-yamada", "y-karashima", "akm"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tengine_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -24,7 +24,7 @@ date: 2011-11-21 00:00:00.000000000Z
|
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &2155256840 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.0.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2155256840
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &2155256280 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.6.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2155256280
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: yard
|
49
|
-
requirement: &
|
49
|
+
requirement: &2155255800 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.7.2
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2155255800
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: bundler
|
60
|
-
requirement: &
|
60
|
+
requirement: &2155255300 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.0.18
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2155255300
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jeweler
|
71
|
-
requirement: &
|
71
|
+
requirement: &2155254800 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.6.4
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2155254800
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: simplecov
|
82
|
-
requirement: &
|
82
|
+
requirement: &2155254320 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 0.5.3
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *2155254320
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: autotest
|
93
|
-
requirement: &
|
93
|
+
requirement: &2155253840 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *2155253840
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: rdiscount
|
104
|
-
requirement: &
|
104
|
+
requirement: &2155253360 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *2155253360
|
113
113
|
description: tengine_support provides utility classes/modules which is not included
|
114
114
|
in active_support. It doesn't depend on other tengine gems.
|
115
115
|
email: tengine@nautilus-technologies.com
|
@@ -181,7 +181,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
181
|
version: '0'
|
182
182
|
segments:
|
183
183
|
- 0
|
184
|
-
hash:
|
184
|
+
hash: -4314659835284975712
|
185
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
186
|
none: false
|
187
187
|
requirements:
|