effective_developer 0.2.9 → 0.2.10
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c950de342d073c07427aa516389a9271a7c4c44
|
4
|
+
data.tar.gz: d95f82b1f7219b99bf542576b96f17a9d507118b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0e19413a78e4902b85702ad599b69c40c4f47904e587061f9087ab6f96f1ecd95d7c25415760746205cf61cda317491e9885e3d42da4582934f472e21894c01
|
7
|
+
data.tar.gz: a5cfae5b14be51933f1d03b7c5890a855aadd506d4b8e8e2798c53296d6d19d6bbd4b01e3b0ae9a1a1eb0912b00aab9bdb3eba2403848066f160de74332b464c
|
@@ -9,11 +9,11 @@ module Effective
|
|
9
9
|
AA=26;AB=27;AC=28;AD=29;AE=30;AF=31;AG=32;AH=33;AI=34;AJ=35;
|
10
10
|
AK=36;AL=37;AM=38;AN=39;AO=40;AP=41;AQ=42;AR=43;AS=44;AT=45;
|
11
11
|
|
12
|
-
def initialize(csv_file =
|
12
|
+
def initialize(csv_file = default_csv_files(), header: true)
|
13
13
|
@has_header_row = header
|
14
14
|
|
15
|
-
@csv_file = csv_file
|
16
|
-
raise "#{
|
15
|
+
@csv_file = Array(csv_file).find { |csv_file| File.exists?(csv_file) }
|
16
|
+
raise "#{csv_file} does not exist" unless @csv_file
|
17
17
|
end
|
18
18
|
|
19
19
|
def columns
|
@@ -217,8 +217,12 @@ module Effective
|
|
217
217
|
|
218
218
|
private
|
219
219
|
|
220
|
-
def
|
221
|
-
|
220
|
+
def default_csv_files
|
221
|
+
[
|
222
|
+
("lib/csv_importers/data/#{self.class.name.gsub('CsvImporters::', '').underscore.gsub('_importer', '')}.csv"),
|
223
|
+
("lib/csv_importers/data/#{self.class.name.gsub('CsvImporters::', '').underscore.gsub('_importer', '').singularize}.csv"),
|
224
|
+
("lib/csv_importers/data/#{self.class.name.gsub('CsvImporters::', '').underscore.gsub('s_importer', '').split('_').map.with_index { |str, index| (index == 0 ? str : str.upcase) }.join}.csv")
|
225
|
+
]
|
222
226
|
end
|
223
227
|
|
224
228
|
end
|
@@ -2,7 +2,7 @@ module CsvImporters
|
|
2
2
|
class <%= klass %>Importer < Effective::CSVImporter
|
3
3
|
def columns
|
4
4
|
{<% columns.each_with_index do |column, index| %>
|
5
|
-
<%= column %>: <%= (letters[index] || index) %><%= ',' unless (index+1) == columns.length %><% end %>
|
5
|
+
<%= column.to_s.underscore.gsub(' ', '_').to_sym %>: <%= (letters[index] || index) %><%= ',' unless (index+1) == columns.length %><% end %>
|
6
6
|
}
|
7
7
|
end
|
8
8
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_developer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|