marty 1.0.3 → 1.0.4
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/app/components/marty/report_form.rb +0 -0
- data/app/models/marty/data_grid.rb +3 -2
- data/lib/marty/version.rb +1 -1
- data/spec/models/data_grid_spec.rb +23 -0
- 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: 9eca20c44c4ac0d2d1aee885ad3f191084430fcb
|
4
|
+
data.tar.gz: bb1d9ade2b3762cd8498d059e3d7dba62eb247a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e34d45e691a904e1823b386b8f0b0141c7b03662847706eb951375bc4a210d3d6fb1f9197f21de70601969f4028ee7fe7debdcece2d9c4f91e11f6c2e963200
|
7
|
+
data.tar.gz: d25b19be0b9a86e1fbbfe2fd617d8b64d0202d2ef1c0a21ca9136e5ccc5d0bd007ccda1f2b107bda101a9881d2954ac72595957fdd0aa6c9aeef0a050dae1eba
|
File without changes
|
@@ -9,7 +9,6 @@ class Marty::DataGrid < Marty::Base
|
|
9
9
|
"integer" => Marty::GridIndexInteger,
|
10
10
|
"string" => Marty::GridIndexString,
|
11
11
|
"boolean" => Marty::GridIndexBoolean,
|
12
|
-
"float" => true
|
13
12
|
}
|
14
13
|
|
15
14
|
ARRSEP = '|'
|
@@ -428,7 +427,7 @@ class Marty::DataGrid < Marty::Base
|
|
428
427
|
|
429
428
|
def self.maybe_get_klass(type)
|
430
429
|
begin
|
431
|
-
klass = type.constantize unless INDEX_MAP[type]
|
430
|
+
klass = type.constantize unless INDEX_MAP[type] || type == "float"
|
432
431
|
rescue NameError
|
433
432
|
raise "unknown header type/klass: #{type}"
|
434
433
|
end
|
@@ -478,6 +477,8 @@ class Marty::DataGrid < Marty::Base
|
|
478
477
|
raise "metadata elements must include attr/type/dir" unless
|
479
478
|
attr && type && dir
|
480
479
|
raise "bad dir #{dir}" unless ["h", "v"].member? dir
|
480
|
+
raise "unknown metadata type #{type}" unless
|
481
|
+
Marty::DataGrid.type_to_index(type)
|
481
482
|
|
482
483
|
res = {
|
483
484
|
"attr" => attr,
|
data/lib/marty/version.rb
CHANGED
@@ -146,6 +146,20 @@ county_name\tstring\tv
|
|
146
146
|
|
147
147
|
NY\t\t10
|
148
148
|
\tR\t8
|
149
|
+
EOS
|
150
|
+
|
151
|
+
Gi =<<EOS
|
152
|
+
units\tinteger\tv\t\t
|
153
|
+
ltv\tfloat\tv\t\t
|
154
|
+
cltv\tfloat\th\t\t
|
155
|
+
fico\tnumrange\th\t\t
|
156
|
+
|
157
|
+
\t\t80.5\t90.5\t100.5
|
158
|
+
\t\t>=600<700\t>=700<750\t>=750
|
159
|
+
1|2\t80.5\t1.1\t2.2\t3.3
|
160
|
+
1|2\t90.5\t4.4\t5.5\t6.6
|
161
|
+
3|4\t100.5\t1.2\t2.3\t3.4
|
162
|
+
3|4\t105.5\t4.5\t5.6\t6.7
|
149
163
|
EOS
|
150
164
|
|
151
165
|
before(:each) do
|
@@ -186,6 +200,15 @@ EOS
|
|
186
200
|
expect(Marty::DataGrid.lookup('infinity', "G3").name).to eq "G3"
|
187
201
|
end
|
188
202
|
|
203
|
+
it "should not allow bad axis types" do
|
204
|
+
expect {
|
205
|
+
dg_from_import("Gi", Gi)
|
206
|
+
}.to raise_error(/unknown metadata type float/)
|
207
|
+
expect {
|
208
|
+
dg_from_import("Gi", Gi.sub(/float/, 'abcdef'))
|
209
|
+
}.to raise_error(/unknown metadata type abcdef/)
|
210
|
+
end
|
211
|
+
|
189
212
|
it "should not allow dup attr names" do
|
190
213
|
g_bad = G1.sub(/fico/, "ltv")
|
191
214
|
|