marty 1.1.2 → 1.1.3

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: 617dd635afba9c6d1b56fc1c2db3be5f713f312f
4
- data.tar.gz: 1d6f98bf730650667a75a6fe91bb928a8717bba3
3
+ metadata.gz: df53e49739260b578673a704246805ddfdfe299a
4
+ data.tar.gz: 192942a02df9fd61b9062311a55d5a3fecb72bc0
5
5
  SHA512:
6
- metadata.gz: 79f5da757ad9b8873fa4fbe78f4e7bc1dba68c5fd940d0d446ecda38aa08837c587cac13d2e2023b8e461290c7605f98468653df818ee3cf54870d554ed68cc1
7
- data.tar.gz: e0bdc4190a5e0ffb17924b36c03bf34455a189a79835242dc1a7c93aa9fb3add286caa13af377f206458be647182caaaac881c5595ef9b85f04b2502ad10e39c
6
+ metadata.gz: b4ca86582715a4d856d5aecceda3c85d30be2adafdd586bf0bdda524d35cbbc668cb797bbfe7e5b4bb3c2e4bf4c7b621aaf54be533b958a2315169525dc3ecf7
7
+ data.tar.gz: 5e720b5bc6a02a55bf2e3db22a07ecfe0167f42f7710df2fcbb5e4cef216c357f4b5dba2e3df429082b89b5056a5c9569dca01253cc893cc0502cc733196f3cc
data/Gemfile CHANGED
@@ -18,7 +18,7 @@ group :development, :test do
18
18
  gem 'pry-rails'
19
19
  gem 'rspec-rails', '~>3.0'
20
20
  gem 'capybara'
21
- gem 'selenium-webdriver'
21
+ gem "selenium-webdriver", '~> 2.53.4'
22
22
  gem 'timecop'
23
23
  gem 'database_cleaner'
24
24
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- marty (1.1.2)
4
+ marty (1.1.3)
5
5
  axlsx (= 2.1.0pre)
6
6
  coderay
7
7
  delorean_lang (~> 0.3.24)
@@ -184,9 +184,10 @@ GEM
184
184
  rspec-support (~> 3.7.0)
185
185
  rspec-support (3.7.0)
186
186
  rubyzip (1.1.7)
187
- selenium-webdriver (3.7.0)
187
+ selenium-webdriver (2.53.4)
188
188
  childprocess (~> 0.5)
189
189
  rubyzip (~> 1.0)
190
+ websocket (~> 1.0)
190
191
  sprockets (3.7.1)
191
192
  concurrent-ruby (~> 1.0)
192
193
  rack (> 1, < 3)
@@ -204,6 +205,7 @@ GEM
204
205
  thread_safe (~> 0.1)
205
206
  uglifier (3.2.0)
206
207
  execjs (>= 0.3.0, < 3)
208
+ websocket (1.2.5)
207
209
  xpath (2.1.0)
208
210
  nokogiri (~> 1.3)
209
211
 
@@ -226,7 +228,7 @@ DEPENDENCIES
226
228
  rails (~> 4.2.10)
227
229
  rspec-instafail
228
230
  rspec-rails (~> 3.0)
229
- selenium-webdriver
231
+ selenium-webdriver (~> 2.53.4)
230
232
  sqlite3
231
233
  timecop
232
234
 
@@ -269,17 +269,24 @@ SQL
269
269
  upd_count = update_start_and_end
270
270
  if upd_count > 0 ||
271
271
  time_now_i - @all_finished[:timestamp] > @poll_secs
272
- raw = get_data(
273
- "SELECT * FROM
274
- (SELECT ROW_NUMBER() OVER (PARTITION BY klass,
275
- subject_id,
276
- enum_event_operation
277
- ORDER BY end_dt DESC) rownum, *
278
- FROM (#{BASE_QUERY}) sub2
279
- WHERE end_dt IS NOT NULL and end_dt > '#{cutoff}') sub1
280
- WHERE rownum = 1
281
- ORDER BY end_dt"
282
- )
272
+ raw = get_data("
273
+ SELECT * FROM (SELECT id
274
+ , klass
275
+ , subject_id
276
+ , enum_event_operation
277
+ , start_dt
278
+ , end_dt
279
+ , expire_secs
280
+ , comment
281
+ , error
282
+ , ROW_NUMBER() OVER (PARTITION BY
283
+ klass
284
+ , subject_id
285
+ , enum_event_operation
286
+ ORDER BY end_dt DESC) row_num
287
+ FROM marty_events
288
+ WHERE end_dt > '#{cutoff}') sub
289
+ WHERE row_num = 1")
283
290
  @all_finished[:timestamp] = time_now_i
284
291
  raw.each_with_object(@all_finished[:data]) do |ev, hash|
285
292
  if ev["end_dt"] && ev["error"].nil?
@@ -46,8 +46,6 @@ class Marty::DataConversion
46
46
  end
47
47
  when :string, :text, :enum
48
48
  v
49
- when :enum_array, :string_array, :integer_array
50
- "'{#{v}}'"
51
49
  when :integer
52
50
  v.to_i
53
51
  when :float
@@ -71,7 +69,7 @@ class Marty::DataConversion
71
69
  end
72
70
  when :numrange, :int4range, :int8range
73
71
  v.to_s
74
- when :float_array, :json, :jsonb
72
+ when :float_array, :json, :jsonb, :enum_array, :string_array, :integer_array
75
73
  # v might be base64 or might be a readable string
76
74
  JSON.parse Marty::DataExporter.decode_json(v) rescue JSON.parse(v)
77
75
  else
data/lib/marty/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
@@ -54,16 +54,24 @@ EOF
54
54
 
55
55
  loan_programs =<<EOF
56
56
  name amortization_type mortgage_type streamline_type high_balance_indicator state_array test_int_array test_string_array
57
- Conv Fixed 30 Year Fixed Conventional Not Streamlined false 1 foo
58
- Conv Fixed 30 Year HB Fixed Conventional Not Streamlined true TN "1,2" foo,bar
59
- Conv Fixed 30 Year DURP <=80 Fixed Conventional DURP false TN,CT 1,2,3 "foo,bar"
60
- Conv Fixed 30 Year DURP <=80 HB Fixed Conventional DURP true "CA,NY" foo,hi mom
57
+ Conv Fixed 30 Year Fixed Conventional Not Streamlined false [1] "[""foo""]"
58
+ Conv Fixed 30 Year HB Fixed Conventional Not Streamlined true "[""TN""]" [1,2] "[""foo"",""bar""]"
59
+ Conv Fixed 30 Year DURP <=80 Fixed Conventional DURP false "[""TN"",""CT""]" [1,2,3] "[""foo"",""bar""]"
60
+ Conv Fixed 30 Year DURP <=80 HB Fixed Conventional DURP true "[""CA"",""NY""]" "[""foo"",""hi mom""]"
61
61
  EOF
62
62
 
63
63
  loan_programs_comma =<<EOF
64
64
  name,amortization_type,mortgage_type,state_array,test_string_array,streamline_type,high_balance_indicator
65
- FHA Fixed 15 Year,Fixed,FHA,"FL,NV,ME","ABC,DEF",Not Streamlined,false
66
- FHA Fixed 100 Year,Fixed,FHA,"FL,NV,ME","XYZ,""hi mom""",Not Streamlined,false
65
+ FHA Fixed 15 Year,Fixed,FHA,"[""FL"",""NV"",""ME""]","[""ABC"",""DEF""]",Not Streamlined,false
66
+ FHA Fixed 100 Year,Fixed,FHA,"[""FL"",""NV"",""ME""]","[""XYZ,"",""hi mom""]",Not Streamlined,false
67
+ EOF
68
+
69
+ loan_programs_encoded =<<EOF
70
+ name,amortization_type,mortgage_type,conforming,ltv_ratio_percent_range,high_balance_indicator,loan_amortization_period_count,streamline_type,extra_feature_type_id,arm_initial_reset_period_count,arm_initial_cap_percent,arm_periodic_cap_percent,arm_lifetime_cap_percent,arm_index_type_id,arm_margin_rate_percent,enum_state,state_array,test_int_array,test_string_array
71
+ VA Fixed 30 Year,Fixed,VA,true,,false,360,Not Streamlined,,,,,,,,,,eJyLNowFAAHTAOo=,eJyLVkrLz1eKBQAI+AJB
72
+ VA Fixed 30 Year HB,Fixed,VA,true,,true,360,Not Streamlined,,,,,,,,,eJyLVgrxU4oFAAWtAZ8=,eJyLNtQxigUAA9UBSA==,eJyLVkrLz1fSUUpKLFKKBQAbWAPm
73
+ VA Fixed 30 Year DURP <=80,Fixed,VA,true,,false,360,DURP,,,,,,,,,eJyLVgrxU9JRcg5RigUAD/UCpg==,eJyLNtQx0jGOBQAGlQGn,eJyLVkrLz1fSUUpKLFKKBQAbWAPm
74
+ VA Fixed 30 Year DURP <=80 HB,Fixed,VA,true,,true,360,DURP,,,,,,,,,eJyLVnJ2VNJR8otUigUADy8CmA==,,eJyLVkrLz1fSUcrIVMjNz1WKBQApLQTr
67
75
  EOF
68
76
 
69
77
  fannie_bup4 =<<EOF
@@ -348,10 +356,12 @@ EOF
348
356
  end
349
357
  end
350
358
 
351
- it "should load array types" do
359
+ it "should load array types (incl encoded)" do
352
360
  Marty::DataImporter.do_import(Gemini::LoanProgram, loan_programs)
353
361
  Marty::DataImporter.do_import(Gemini::LoanProgram, loan_programs_comma,
354
362
  'infinity', nil, nil, ',')
363
+ Marty::DataImporter.do_import(Gemini::LoanProgram, loan_programs_encoded,
364
+ 'infinity', nil, nil, ',')
355
365
  lpset = Gemini::LoanProgram.all.pluck(:name, :state_array,
356
366
  :test_int_array,
357
367
  :test_string_array).to_set
@@ -365,7 +375,14 @@ EOF
365
375
  ["FHA Fixed 15 Year", ["FL","NV","ME"], nil,
366
376
  ['ABC', 'DEF']],
367
377
  ["FHA Fixed 100 Year", ["FL","NV","ME"], nil,
368
- ['XYZ', 'hi mom']]
378
+ ['XYZ,', 'hi mom']],
379
+ ["VA Fixed 30 Year", nil, [1], ['foo']],
380
+ ["VA Fixed 30 Year HB", ["TN"], [1, 2],
381
+ ['foo', 'bar']],
382
+ ["VA Fixed 30 Year DURP <=80", ["TN", "CT"],
383
+ [1, 2, 3], ['foo', 'bar']],
384
+ ["VA Fixed 30 Year DURP <=80 HB", ["CA", "NY"],
385
+ nil, ['foo', 'hi mom']],
369
386
  ].to_set)
370
387
 
371
388
  end
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.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Bostani
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2017-12-04 00:00:00.000000000 Z
17
+ date: 2017-12-19 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: pg