magicka 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/magicka/aggregator.rb +2 -2
- data/lib/magicka/version.rb +1 -1
- data/spec/lib/magicka/display_spec.rb +27 -0
- data/spec/lib/magicka/form_spec.rb +27 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 790574b274384507133ba81bff57316fdee267695e6a86bbb36da2065d98f918
|
4
|
+
data.tar.gz: ded516626da7b9825e1711aa4d299cd0388de7293776cc20c9facc607b4ba8ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2fb23dfa2dca070216bede19831ca54bc0c9ee1340418848e647512d4ec7668ee97b0015aa8d7d3b85e6014883e263107ce8360efed4286342e714f502d93ce
|
7
|
+
data.tar.gz: 6e165bd37c83eb5d3c0c760164f2f93e9d51d05f284621960012e24b81d5b7779140cca6f1d47128bd24a4545201e77becd489fa20d9e0ac6ba816cd01dc8fdf
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Magicka
|
|
11
11
|
|
12
12
|
Yard Documentation
|
13
13
|
-------------------
|
14
|
-
[https://www.rubydoc.info/gems/magicka/0.5.
|
14
|
+
[https://www.rubydoc.info/gems/magicka/0.5.3](https://www.rubydoc.info/gems/magicka/0.5.3)
|
15
15
|
|
16
16
|
Installation
|
17
17
|
---------------
|
data/lib/magicka/aggregator.rb
CHANGED
@@ -23,8 +23,8 @@ module Magicka
|
|
23
23
|
@model = model
|
24
24
|
end
|
25
25
|
|
26
|
-
def with_model(model)
|
27
|
-
new_model = [
|
26
|
+
def with_model(model, base: self.model)
|
27
|
+
new_model = [base, model].compact.join('.')
|
28
28
|
|
29
29
|
yield self.class.new(renderer, new_model)
|
30
30
|
end
|
data/lib/magicka/version.rb
CHANGED
@@ -139,4 +139,31 @@ describe Magicka::Display do
|
|
139
139
|
end
|
140
140
|
end
|
141
141
|
end
|
142
|
+
|
143
|
+
describe '#with_form' do
|
144
|
+
it do
|
145
|
+
form.with_model('sub') do |new_form|
|
146
|
+
expect(new_form)
|
147
|
+
.to eq(described_class.new(renderer, 'my_model.sub'))
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
context 'when passing a new base' do
|
152
|
+
it do
|
153
|
+
form.with_model('sub', base: :other_model) do |new_form|
|
154
|
+
expect(new_form)
|
155
|
+
.to eq(described_class.new(renderer, 'other_model.sub'))
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
context 'when passing an empty base' do
|
161
|
+
it do
|
162
|
+
form.with_model('sub', base: nil) do |new_form|
|
163
|
+
expect(new_form)
|
164
|
+
.to eq(described_class.new(renderer, 'sub'))
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
142
169
|
end
|
@@ -153,4 +153,31 @@ describe Magicka::Form do
|
|
153
153
|
end
|
154
154
|
end
|
155
155
|
end
|
156
|
+
|
157
|
+
describe '#with_form' do
|
158
|
+
it do
|
159
|
+
form.with_model('sub') do |new_form|
|
160
|
+
expect(new_form)
|
161
|
+
.to eq(described_class.new(renderer, 'my_model.sub'))
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
context 'when passing a new base' do
|
166
|
+
it do
|
167
|
+
form.with_model('sub', base: :other_model) do |new_form|
|
168
|
+
expect(new_form)
|
169
|
+
.to eq(described_class.new(renderer, 'other_model.sub'))
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
context 'when passing an empty base' do
|
175
|
+
it do
|
176
|
+
form.with_model('sub', base: nil) do |new_form|
|
177
|
+
expect(new_form)
|
178
|
+
.to eq(described_class.new(renderer, 'sub'))
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
156
183
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magicka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DarthJee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|