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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8234b3d722f4748c284fd3d3e0a1e813e9f41835156937971cb8777e6fb3df94
4
- data.tar.gz: 3009116645a7c107b0d046993d4b75df937f04c0ef68e6547fb5aebcff3ce873
3
+ metadata.gz: 91fae8e035b3b2912c560e92f1082514e24fbf53a38ea9a3b2b64afd18a363fa
4
+ data.tar.gz: 16a00f1540532b6f3c6473e8d7e66c18ef5acaed7754b3097957222db1aa27ba
5
5
  SHA512:
6
- metadata.gz: e327dc8139567cec93b02a5dce35bce8f83031f6481b78d6f021a4556415b3a1e2a04aeb789e49eca4e32c70efabb0759396ec276b5bba5337d99115b8c78adc
7
- data.tar.gz: caaf42d97da52409e99c1f777a1b2b2f200a49728ad9aa3a4b0bf892ca6f1fac17ce67dbf29f109d4fb129161d1c116b36fb5d30a2a8bc09161f184e30e5c733
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
@@ -51,17 +51,11 @@ module IronBank
51
51
  def csv_options
52
52
  {
53
53
  headers: true,
54
- header_converters: 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 << klass.fields.map { |field| IronBank::Utils.underscore(field) }
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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IronBank
4
- VERSION = '2.0.1'
4
+ VERSION = '2.0.2'
5
5
  API_VERSION = 'v1'
6
6
  end
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.1
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: 2018-12-21 00:00:00.000000000 Z
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.8
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.