iron_bank 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.reek.yml +4 -0
- data/lib/iron_bank/local.rb +1 -7
- data/lib/iron_bank/local_records.rb +5 -1
- data/lib/iron_bank/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91fae8e035b3b2912c560e92f1082514e24fbf53a38ea9a3b2b64afd18a363fa
|
4
|
+
data.tar.gz: 16a00f1540532b6f3c6473e8d7e66c18ef5acaed7754b3097957222db1aa27ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1194bc5b7a1fc98a4aaa20b5060fa02bc9e58b43e40c87aa8bc67b7c7728ee312c796943c4eaf6e3981d19cbfe9fe682287e2beb35302ece13a2fe47eec12877
|
7
|
+
data.tar.gz: 664e41aafd6c72aebb4930ff03e436fb9196bfc5439293cdb6d9aeb92426d7d71d23e66d05b2a4132d95fd6016ad30522b7be892e9ff2c5f07c7c16d572f40cf
|
data/.reek.yml
CHANGED
@@ -87,6 +87,10 @@ detectors:
|
|
87
87
|
- IronBank::Resources::ProductRatePlanChargeTier#self.load_records
|
88
88
|
- IronBank::Error#self.from_response
|
89
89
|
|
90
|
+
UncommunicativeVariableName:
|
91
|
+
exclude:
|
92
|
+
- IronBank::Local#csv_options
|
93
|
+
|
90
94
|
UtilityFunction:
|
91
95
|
exclude:
|
92
96
|
- IronBank::Cacheable::ClassMethods#cache
|
data/lib/iron_bank/local.rb
CHANGED
@@ -51,17 +51,11 @@ module IronBank
|
|
51
51
|
def csv_options
|
52
52
|
{
|
53
53
|
headers: true,
|
54
|
-
header_converters:
|
54
|
+
header_converters: [->(h) { IronBank::Utils.underscore(h).to_sym }],
|
55
55
|
converters: csv_converters
|
56
56
|
}
|
57
57
|
end
|
58
58
|
|
59
|
-
def header_converters
|
60
|
-
%i[
|
61
|
-
symbol
|
62
|
-
]
|
63
|
-
end
|
64
|
-
|
65
59
|
def csv_converters
|
66
60
|
%i[
|
67
61
|
decimal_integer
|
@@ -25,7 +25,7 @@ module IronBank
|
|
25
25
|
def export
|
26
26
|
CSV.open(file_path, 'w') do |csv|
|
27
27
|
# first row = CSV headers
|
28
|
-
csv
|
28
|
+
write_headers(csv)
|
29
29
|
write_records(csv)
|
30
30
|
end
|
31
31
|
end
|
@@ -46,6 +46,10 @@ module IronBank
|
|
46
46
|
File.expand_path("#{resource}.csv", self.class.directory)
|
47
47
|
end
|
48
48
|
|
49
|
+
def write_headers(csv)
|
50
|
+
csv << klass.fields
|
51
|
+
end
|
52
|
+
|
49
53
|
def write_records(csv)
|
50
54
|
klass.find_each { |record| csv << record.to_csv_row }
|
51
55
|
end
|
data/lib/iron_bank/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron_bank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mickael Pham
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2019-01-03 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bump
|
@@ -380,7 +380,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
380
380
|
version: '0'
|
381
381
|
requirements: []
|
382
382
|
rubyforge_project:
|
383
|
-
rubygems_version: 2.7.
|
383
|
+
rubygems_version: 2.7.6
|
384
384
|
signing_key:
|
385
385
|
specification_version: 4
|
386
386
|
summary: An opinionated Ruby interface to the Zuora API.
|