tarvit-helpers 0.0.21 → 0.0.22
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/tarvit-helpers/modules/hash_presenter/simple.rb +5 -1
- data/spec/modules/hash_presenter/custom_spec.rb +10 -1
- data/tarvit-helpers.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caa66ce8ca236d132715e53cc7895f433a0755e4
|
4
|
+
data.tar.gz: 4ecc3de185ae7a4e57bbf938c67e5d51ddb73ab6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe34c1d4c4ac253edf4bd2eb4ab3ab585af0d121d91715c4adddd4c80155bf3461f8db68a37b8800c57eeb667c15cf4bdfa69be8a4c06ec0b3b3997ef18d46ad
|
7
|
+
data.tar.gz: 6503d663d1c6cc53c259c1abb134b3cc9f2f3d52bf3cf880e1d3c1ac27f55eaf7cb483bfcb191a1638d34b34bdf800a23b478afb9192d8b99fba778d83a6696e
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.22
|
@@ -7,7 +7,7 @@ module TarvitHelpers
|
|
7
7
|
attr_reader :_hash, :_levels, :_parent
|
8
8
|
|
9
9
|
def initialize(hash, levels=[], parent=nil)
|
10
|
-
@_hash = _prepare_keys(hash)
|
10
|
+
@_hash = _modify_hash(_prepare_keys(hash))
|
11
11
|
@_levels = levels
|
12
12
|
@_parent = parent
|
13
13
|
end
|
@@ -62,6 +62,10 @@ module TarvitHelpers
|
|
62
62
|
def _new_level_presenter_klass
|
63
63
|
self.class
|
64
64
|
end
|
65
|
+
|
66
|
+
def _modify_hash(hash)
|
67
|
+
hash
|
68
|
+
end
|
65
69
|
end
|
66
70
|
end
|
67
71
|
end
|
@@ -73,6 +73,12 @@ describe HashPresenter::Custom do
|
|
73
73
|
|
74
74
|
class AccountsPresenter < HashPresenter::Custom
|
75
75
|
|
76
|
+
def _modify_hash(hash)
|
77
|
+
res = super(hash)
|
78
|
+
res[:extra] = :value
|
79
|
+
res
|
80
|
+
end
|
81
|
+
|
76
82
|
def _add_rules(rules)
|
77
83
|
rules.when([:accounts, :name]) do |value|
|
78
84
|
value.to_s
|
@@ -110,6 +116,8 @@ describe HashPresenter::Custom do
|
|
110
116
|
expect(account.collections[1].folder).to eq('folders/BestCollection')
|
111
117
|
expect(account.collections[1].global_folder).to eq('director/folders/BestCollection')
|
112
118
|
|
119
|
+
expect(@presenter.extra).to eq(:value)
|
120
|
+
|
113
121
|
expect(@presenter._custom_hash).to eq({
|
114
122
|
:accounts => [
|
115
123
|
{
|
@@ -121,7 +129,8 @@ describe HashPresenter::Custom do
|
|
121
129
|
],
|
122
130
|
:website=>'www.johndoe.com/director'
|
123
131
|
}
|
124
|
-
]
|
132
|
+
],
|
133
|
+
:extra => :value,
|
125
134
|
})
|
126
135
|
end
|
127
136
|
end
|
data/tarvit-helpers.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: tarvit-helpers 0.0.
|
5
|
+
# stub: tarvit-helpers 0.0.22 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "tarvit-helpers"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.22"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|