sql-jarvis 2.0.4 → 2.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25be2a6a0d6cc1e011d670352cea22b1aedff43f51fcb184462d6ae57e5ac464
4
- data.tar.gz: 6a22c94bd8c898e2c9e0bdea8b178a09de3b40663c691b9b5c5cd6c2d75b9503
3
+ metadata.gz: e469ba7d576c25611eb5c323c2e9da0aec4dce044a4ecae7d43c648ac918faff
4
+ data.tar.gz: 5fd46cef2f53af2956685559e8c32bc29fe365f684c25342eea9a9ada13120c1
5
5
  SHA512:
6
- metadata.gz: 6cffad21db8437dc63e980d21b9a273b7b00cecbee674b8ce78ffe17ada67484adbeeff49ca3338aaa0a0b8ece38ad0af0aed87b12f817be08a604b804b490f4
7
- data.tar.gz: 902cf9b1b26ab4dea83b2e39cbfbe4db9d00a5bade0136fc394bd7febba25120b1d992d596acc30163d985a3587bd1f85dceed0a8c62e734d117e4b4a55a023e
6
+ metadata.gz: 2026a11120566feb528bd204a8d47b93e9d662fad291d8585a3bbb2efac56c010f60b6e3f193e15c6adbd7c22e3170fe28b60638be01ce6b0b1e70108d6e6fcf
7
+ data.tar.gz: d0730f29e831bae5abe7edfc91a9e39083ff1c24e8b323210cf0804616d83c6a4e8d7140bf12c1dd6852368fe38574fd2c0d17dfa25f5fcf539f75f15bfc8c86
@@ -365,7 +365,17 @@ module Blazer
365
365
  end
366
366
 
367
367
  def blazer_time_value(data_source, k, v)
368
- data_source.local_time_suffix.any? { |s| k.ends_with?(s) } ? v.to_s.sub(" UTC", "") : v.in_time_zone(Blazer.time_zone)
368
+ if k.end_with?('_date')
369
+ v.in_time_zone(Blazer.time_zone).strftime("%Y/%m/%d")
370
+ elsif k.end_with?('_time')
371
+ v.in_time_zone(Blazer.time_zone).strftime("%H:%M")
372
+ elsif data_source.local_time_suffix.any? { |s| k.ends_with?(s) }
373
+ v.to_s.sub(" UTC", "")
374
+ else
375
+ v.in_time_zone(Blazer.time_zone)
376
+ end
377
+ rescue
378
+ return v
369
379
  end
370
380
  helper_method :blazer_time_value
371
381
 
@@ -23,6 +23,10 @@ module Blazer
23
23
  else
24
24
  link_to value, value, target: "_blank"
25
25
  end
26
+ elsif key.end_with?("_date")
27
+ value.in_time_zone(Blazer.time_zone).strftime('%Y/%m/%d') rescue value
28
+ elsif key.end_with?("_time")
29
+ value.in_time_zone(Blazer.time_zone).strftime('%H:%M') rescue value
26
30
  else
27
31
  value
28
32
  end
@@ -61,7 +61,7 @@ module Blazer
61
61
  end
62
62
 
63
63
  def self.query_url(id)
64
- Blazer::Engine.routes.url_helpers.query_url(id, ActionMailer::Base.default_url_options)
64
+ Blazer::Engine.routes.url_helpers.query_url(id, ActionMailer::Base.default_url_options, subdomain: Blazer.subdomain)
65
65
  end
66
66
 
67
67
  def self.post(url, payload)
@@ -25,7 +25,7 @@ module Blazer
25
25
  excel.workbook.add_worksheet(name: "ID #{query.id}") do |sheet|
26
26
  sheet.add_row @columns
27
27
  @rows.each do |row|
28
- sheet.add_row row
28
+ sheet.add_row row.each_with_index.map { |v, i| v.is_a?(Time) ? blazer_time_value(@columns[i], v) : v }
29
29
  end
30
30
  end
31
31
  end
@@ -36,5 +36,20 @@ module Blazer
36
36
  return tmp_file
37
37
  end
38
38
 
39
+ def blazer_time_value(key, value)
40
+ value_with_time_zone = (value.in_time_zone(Blazer.time_zone) rescue value)
41
+ if key.end_with?('_date')
42
+ value_with_time_zone.strftime("%Y/%m/%d")
43
+ elsif key.end_with?('_time')
44
+ value_with_time_zone.strftime("%H:%M")
45
+ elsif data_source.local_time_suffix.any? { |s| key.ends_with?(s) }
46
+ value.to_s.sub(" UTC", "")
47
+ else
48
+ value_with_time_zone
49
+ end
50
+ rescue
51
+ return value
52
+ end
53
+
39
54
  end
40
55
  end
@@ -1,3 +1,3 @@
1
1
  module Blazer
2
- VERSION = '2.0.4'
2
+ VERSION = '2.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sql-jarvis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-20 00:00:00.000000000 Z
11
+ date: 2019-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties