advance 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/split_csv.rb +6 -4
- data/lib/advance/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d6824d2bd08741ba6ed16ab23cb41a7dca837d92db6717042818487966a8b5b
|
4
|
+
data.tar.gz: fc5f112f2ff89a59d9652d5f6b9550065f97248024c27a1a958389189ef58471
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d85241eb22e3fa4ef1806e13a4fead076cb199855127788fad7e243e113dd9785618850010d08a22a319de1322e63befb2ad19337779f8e0630566958794a95
|
7
|
+
data.tar.gz: a57345fb3b0b3d3f5835731efeb0fdaf49f42434dd2223782fce6a2c8c4be31037fecb7ecc23f974fc1ca6266c0c4b559f6d936b39082bba7a45d6d2ddd25ec3
|
data/Gemfile.lock
CHANGED
data/bin/split_csv.rb
CHANGED
@@ -9,13 +9,15 @@ end
|
|
9
9
|
csv_file = ARGV[0]
|
10
10
|
lines = ARGV[1]
|
11
11
|
csv_file_name = File.basename(csv_file)
|
12
|
-
|
12
|
+
header_file_name = "#{csv_file_name}_header"
|
13
|
+
system "head -n 1 #{csv_file} > #{header_file_name}"
|
13
14
|
system "tail -n +2 #{csv_file} | split -l #{lines} -a 3 - #{csv_file_name}_"
|
14
|
-
files = Dir.entries(".").reject { |f| f =~ %r{^(\.\.?|log)$} }
|
15
|
+
files = Dir.entries(".").reject { |f| f.end_with?(header_file_name) || f =~ %r{^(\.\.?|log)$} }
|
15
16
|
TeamEffort.work(files, 1) do |file|
|
16
17
|
tmp_file = "tmp_#{file}"
|
17
|
-
do_cmd "cat #{
|
18
|
+
do_cmd "cat #{header_file_name} #{file} >> #{tmp_file}"
|
18
19
|
do_cmd "mv #{tmp_file} #{file}"
|
19
20
|
end
|
20
|
-
do_cmd "rm #{
|
21
|
+
do_cmd "rm #{header_file_name}"
|
22
|
+
do_cmd "rename 's/^(.*)\.csv_(.*)$/$1_$2.csv/' *csv*"
|
21
23
|
puts ""
|
data/lib/advance/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: advance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- janemacfarlane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: team_effort
|
@@ -121,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
|
125
|
-
rubygems_version: 2.7.9
|
124
|
+
rubygems_version: 3.0.6
|
126
125
|
signing_key:
|
127
126
|
specification_version: 4
|
128
127
|
summary: A framework for building data transformation pipelines
|