advance 0.3.18 → 0.4.1

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: 1e0ac05e79a457d37a7bf18aae36c8276ecb029493bbc19a03c6410d9774dd3e
4
- data.tar.gz: b915a139b4d433be5c3751c3b9cb980bd6d4a0352d6f2fe7900d459dda962080
3
+ metadata.gz: 04bcff52a5d936e0a93127116ace3eb0f47354b645ed05de6e68cf281765d04c
4
+ data.tar.gz: 5729aff69b7bb72c11eb337e54007552240112311bce5d8e878882e1ddd7a3c7
5
5
  SHA512:
6
- metadata.gz: bd189c4214a299871a06704bd4424dc6b0e6ef8b41acf8bfdac5e02400af80d916909b88e80d1c3e44688292282ad549090fc8f432ab0b79cbd743e13b28f4ff
7
- data.tar.gz: 4f8e340937f6801a90a02f9d700fbab7502e8e021dc6138b6b54fb544cc662d79fba449d82bc8eaeb7ed47c6cb2ed3c88ee486f4d345f92d3178c1288895696c
6
+ metadata.gz: 2938d12bf9c47fd3c5e9320b4a7e116c70cd6b95a8981b8c03a3c6429aa619265bfe382e02688fdc89dadad38ecbe3ed9e56356e97dfcfbaca1af993f26ac879
7
+ data.tar.gz: '07790af69ba69662154f9fc51969517708893a9f0492e2cc593a869f5ea1cddaa457458b5e95afa0d0b1a7025e30bff98e5861d988510aa808ae95c9be8833bc'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- advance (0.3.18)
4
+ advance (0.4.1)
5
5
  team_effort
6
6
 
7
7
  GEM
@@ -21,4 +21,4 @@ DEPENDENCIES
21
21
  rake (~> 10.0)
22
22
 
23
23
  BUNDLED WITH
24
- 1.17.1
24
+ 1.17.3
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
- return
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
- command.gsub!("{input_file}", input_file_path)
202
- command.gsub!("{file_name}", basename)
203
- command.gsub!("{file_name_without_extension}", root_file_name)
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
@@ -1,3 +1,3 @@
1
1
  module Advance
2
- VERSION = "0.3.18"
2
+ VERSION = "0.4.1"
3
3
  end
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.3.18
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-05-04 00:00:00.000000000 Z
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.9
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__)
@@ -1,4 +0,0 @@
1
- #!/bin/bash
2
- input_dir="$1"
3
- find $input_dir -type f \! -name 'log' -exec cp -vn {} . \;
4
-
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here