advance 0.1.7 → 0.1.8

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
  SHA1:
3
- metadata.gz: b166e2a0085ffed66ce977b7132e7bfbe889b626
4
- data.tar.gz: 6edbd6f384d97b5343ae02e9973eed99d43c5e7b
3
+ metadata.gz: d7b1b12dbeb531d66a40b83bfffeaa3397575901
4
+ data.tar.gz: ea187e16e67de40ecdb17568e13a31e4da72b281
5
5
  SHA512:
6
- metadata.gz: b8c2c740c5b7bd7e71bb63e8de4038489373ce85b134d0721e986628b333ce4d68d444ebf59732b65227baf72f1b3e983885b5d2a0847fd65689d60e8c0f90f5
7
- data.tar.gz: 4d6228006af6bb753e8dc6dccbfc697c3df444ef405b8d694189e4f3428d9fc0aa142bb1f3f840220791106a9ba9f146b6722993c281055c5028559faa2ed973
6
+ metadata.gz: a6af8adf8ea0c2ffae6c73d0ad1e36761f1877ea1916a7dff7b994d2ae8b5ec6eac4f4f5c04ed66a56658a71a74643375e232f93465011d134dd92f2f2416ea8
7
+ data.tar.gz: 4ce3b33cc80446665a4e823d5feca4a2b3f8f6e20038da63d945f9bc41b124141517467517f2bf0d9f5260e96c6d53879edc42350a78a129b3a86317a7e5a88f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- advance (0.1.7)
4
+ advance (0.1.8)
5
5
  team_effort
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -139,15 +139,6 @@ When running your pipeline, it is helpful to have a directory with the single, i
139
139
  1. Move to your data directory with your single initial file.
140
140
  2. invoke your script from there.
141
141
 
142
- ## Questions / Answers
143
-
144
- * Q: **My script fails with `undefined local variable or method 'label' for main:Object`**
145
-
146
- A: This indicates a ruby script is running that does not have access to a ruby gem.
147
- First, make sure your script is using the expected ruby by adding to the beginning of your
148
- script `puts RUBY_VERSION`. Make sure the gem is installed by listing installed gems with
149
- `$ gem list`. Finally, check that the script requires the library with `require 'my-library'`
150
-
151
142
  ## Contributing
152
143
 
153
144
  We ♥️ contributions!
@@ -1,3 +1,3 @@
1
1
  module Advance
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/advance.rb CHANGED
@@ -107,7 +107,14 @@ module Advance
107
107
  end
108
108
 
109
109
  def work_in_sub_dir(dir_name, existing_message = nil)
110
- return if Dir.exist? dir_name
110
+ if $redo_mode == :checking && Dir.exist?(dir_name)
111
+ return :checking
112
+ end
113
+
114
+ if Dir.exist? dir_name
115
+ puts "reprocessing #{dir_name}"
116
+ FileUtils.rm_rf dir_name
117
+ end
111
118
 
112
119
  tmp_dir_name = "tmp_#{dir_name}"
113
120
  FileUtils.rm_rf tmp_dir_name
@@ -118,6 +125,7 @@ module Advance
118
125
 
119
126
  FileUtils.cd ".."
120
127
  FileUtils.mv tmp_dir_name, dir_name
128
+ :replacing
121
129
  end
122
130
 
123
131
  def step_dir_prefix(step_no)
@@ -125,13 +133,14 @@ module Advance
125
133
  end
126
134
 
127
135
  def step(label)
136
+ $redo_mode ||= :checking
128
137
  $step ||= 0
129
138
  $step += 1
130
139
  dir_name = "#{step_dir_prefix($step)}_#{label}"
131
140
  $previous_dir = File.join(FileUtils.pwd, dir_name)
132
141
  puts "#{CYAN}step #{$step} #{label}#{WHITE}... #{RESET}"
133
142
 
134
- work_in_sub_dir(dir_name, "#{GREEN}OK#{RESET}") do
143
+ $redo_mode = work_in_sub_dir(dir_name, "#{GREEN}OK#{RESET}") do
135
144
  yield
136
145
  end
137
146
  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.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - janemacfarlane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-19 00:00:00.000000000 Z
11
+ date: 2019-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: team_effort