marty 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bebe74227eb431e5b56683fb41cdf571d65ad9ae
4
- data.tar.gz: 52e50bf586ade69e69501f408ba8795d5296a108
3
+ metadata.gz: 9eca20c44c4ac0d2d1aee885ad3f191084430fcb
4
+ data.tar.gz: bb1d9ade2b3762cd8498d059e3d7dba62eb247a9
5
5
  SHA512:
6
- metadata.gz: 6f047a2e07c4c2808c7385e7558e9c1243710e62385f317a7ab472175f78e22fb4fd74119d3d30b5cb2117d0ee3e7b834f6077e1ab463b9df887dae4f28c6632
7
- data.tar.gz: 68b1e9630134ac55a561a3e9b4df22ac4e7dc0fd6bbc43fcb032ec505c4e98c70c4a521c368d317267a5687569ab851eff8b4861ca53a273afda14f89e1d153d
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
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Bostani