advance 0.3.18 → 0.4.1
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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/advance.rb +19 -11
- data/lib/advance/version.rb +1 -1
- metadata +3 -9
- data/bin/console +0 -14
- data/bin/remove_logs_and_sub_dirs +0 -4
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04bcff52a5d936e0a93127116ace3eb0f47354b645ed05de6e68cf281765d04c
|
4
|
+
data.tar.gz: 5729aff69b7bb72c11eb337e54007552240112311bce5d8e878882e1ddd7a3c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2938d12bf9c47fd3c5e9320b4a7e116c70cd6b95a8981b8c03a3c6429aa619265bfe382e02688fdc89dadad38ecbe3ed9e56356e97dfcfbaca1af993f26ac879
|
7
|
+
data.tar.gz: '07790af69ba69662154f9fc51969517708893a9f0492e2cc593a869f5ea1cddaa457458b5e95afa0d0b1a7025e30bff98e5861d988510aa808ae95c9be8833bc'
|
data/Gemfile.lock
CHANGED
data/lib/advance.rb
CHANGED
@@ -80,8 +80,9 @@ module Advance
|
|
80
80
|
end
|
81
81
|
|
82
82
|
if File.exist?(".meta")
|
83
|
-
read_column_names_from_meta
|
84
|
-
|
83
|
+
if read_column_names_from_meta
|
84
|
+
return
|
85
|
+
end
|
85
86
|
end
|
86
87
|
|
87
88
|
previous_dir_path = get_previous_dir_path
|
@@ -98,10 +99,11 @@ module Advance
|
|
98
99
|
run.each do |step|
|
99
100
|
if step["columns"]
|
100
101
|
$column_names = step["columns"].map(&:to_sym)
|
101
|
-
return
|
102
|
+
return true
|
102
103
|
end
|
103
104
|
end
|
104
105
|
end
|
106
|
+
false
|
105
107
|
end
|
106
108
|
|
107
109
|
def advance(processing_mode, label, command)
|
@@ -137,6 +139,11 @@ module Advance
|
|
137
139
|
end
|
138
140
|
end
|
139
141
|
|
142
|
+
def pipeline(pipeline_path)
|
143
|
+
expanded_path = File.expand_path(pipeline_path)
|
144
|
+
load expanded_path
|
145
|
+
end
|
146
|
+
|
140
147
|
def count_files(dir)
|
141
148
|
file_count = 0
|
142
149
|
Find.find(dir) do |path|
|
@@ -194,14 +201,15 @@ module Advance
|
|
194
201
|
|
195
202
|
def single(command, previous_dir_path, dir_name)
|
196
203
|
work_in_sub_dir(dir_name) do
|
197
|
-
input_file_path = previous_file_path(previous_dir_path)
|
198
|
-
basename = File.basename(input_file_path)
|
199
|
-
root_file_name = basename.gsub(%r(\.[^.]+$), '')
|
200
204
|
command.gsub!("{input_dir}", previous_dir_path)
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
+
input_file_path = previous_file_path(previous_dir_path)
|
206
|
+
if input_file_path
|
207
|
+
basename = File.basename(input_file_path)
|
208
|
+
root_file_name = basename.gsub(%r(\.[^.]+$), '')
|
209
|
+
command.gsub!("{input_file}", input_file_path)
|
210
|
+
command.gsub!("{file_name}", basename)
|
211
|
+
command.gsub!("{file_name_without_extension}", root_file_name)
|
212
|
+
end
|
205
213
|
do_command command
|
206
214
|
end
|
207
215
|
end
|
@@ -301,7 +309,7 @@ module Advance
|
|
301
309
|
end
|
302
310
|
|
303
311
|
def do_command(command, feedback = true)
|
304
|
-
puts "#{YELLOW}#{command}#{RESET} " if feedback
|
312
|
+
puts "#{YELLOW}#{command}#{RESET} " #if feedback
|
305
313
|
start_time = Time.now
|
306
314
|
stdout, stderr, status = Open3.capture3(command)
|
307
315
|
elapsed_time = Time.now - start_time
|
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
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- janemacfarlane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: team_effort
|
@@ -77,12 +77,9 @@ email:
|
|
77
77
|
executables:
|
78
78
|
- concat_csv.rb
|
79
79
|
- concat_csv_nh.rb
|
80
|
-
- console
|
81
80
|
- csv_select.rb
|
82
81
|
- csv_select_nh.rb
|
83
82
|
- csv_split_on_change_nh.rb
|
84
|
-
- remove_logs_and_sub_dirs
|
85
|
-
- setup
|
86
83
|
- split_csv.rb
|
87
84
|
extensions: []
|
88
85
|
extra_rdoc_files: []
|
@@ -97,12 +94,9 @@ files:
|
|
97
94
|
- advance.gemspec
|
98
95
|
- bin/concat_csv.rb
|
99
96
|
- bin/concat_csv_nh.rb
|
100
|
-
- bin/console
|
101
97
|
- bin/csv_select.rb
|
102
98
|
- bin/csv_select_nh.rb
|
103
99
|
- bin/csv_split_on_change_nh.rb
|
104
|
-
- bin/remove_logs_and_sub_dirs
|
105
|
-
- bin/setup
|
106
100
|
- bin/split_csv.rb
|
107
101
|
- lib/advance.rb
|
108
102
|
- lib/advance/version.rb
|
@@ -128,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
122
|
version: '0'
|
129
123
|
requirements: []
|
130
124
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.7.
|
125
|
+
rubygems_version: 2.7.8
|
132
126
|
signing_key:
|
133
127
|
specification_version: 4
|
134
128
|
summary: A framework for building data transformation pipelines
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "advance"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|