schlepper 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -4
- data/lib/generators/rspec/schlepper/task_generator.rb +22 -0
- data/lib/generators/rspec/schlepper/templates/onetime_script_spec.rb.erb +9 -0
- data/lib/generators/schlepper/task_generator.rb +9 -1
- data/lib/schlepper.rb +1 -0
- data/lib/schlepper/paths.rb +7 -0
- data/lib/schlepper/process.rb +1 -1
- data/lib/schlepper/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 590aee564323d53ed712ae142ef36c3e9b11fe29
|
4
|
+
data.tar.gz: 0a29017031beffc990469bd71b486f42a2749f27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db6a6a3baf2d102578a78c9112b775ebabfd42534df44e8246dc2ef61f39c3c5f88f19f3e0c8249402395226187b5ce867fc4b125876a5e75224a2aaea712f0e
|
7
|
+
data.tar.gz: 1aa5208607ef35eb9be55a32015d197e5cfa2dd6e766bf03a821c59bf36e77f0fa7f4e0f7fdd0414ff13fbeddef99fe9b0a5994176e72f0f78e94e960d78cfae
|
data/.travis.yml
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Rspec
|
2
|
+
module Schlepper
|
3
|
+
class TaskGenerator < Rails::Generators::NamedBase
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
5
|
+
|
6
|
+
def onetime_script_spec
|
7
|
+
template 'onetime_script_spec.rb.erb', "#{::Schlepper::Paths::SPEC_DIR}/#{file_name}_spec.rb"
|
8
|
+
end
|
9
|
+
|
10
|
+
def task_name
|
11
|
+
file_name.sub(/\A\d+_/, '')
|
12
|
+
end
|
13
|
+
|
14
|
+
def require_task_path
|
15
|
+
task_dir = Pathname.new(::Schlepper::Paths::TASK_DIR)
|
16
|
+
spec_dir = Pathname.new(::Schlepper::Paths::SPEC_DIR)
|
17
|
+
|
18
|
+
"#{task_dir.relative_path_from spec_dir}/#{file_name}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -4,11 +4,19 @@ module Schlepper
|
|
4
4
|
|
5
5
|
def onetime_script
|
6
6
|
@now = Time.now
|
7
|
-
template 'onetime_script.rb.erb', "
|
7
|
+
template 'onetime_script.rb.erb', "#{Paths::TASK_DIR}/#{timestamped_task_name}.rb"
|
8
8
|
end
|
9
9
|
|
10
10
|
def stringified_timestamp
|
11
11
|
@now.strftime '%Y%m%d%H%M%S'
|
12
12
|
end
|
13
|
+
|
14
|
+
def timestamped_task_name
|
15
|
+
"#{stringified_timestamp}_#{file_name}"
|
16
|
+
end
|
17
|
+
|
18
|
+
hook_for :test_framework, as: 'schlepper:task' do |instance, test_generator|
|
19
|
+
instance.invoke test_generator, [instance.timestamped_task_name]
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
data/lib/schlepper.rb
CHANGED
data/lib/schlepper/process.rb
CHANGED
@@ -62,7 +62,7 @@ module Schlepper
|
|
62
62
|
end
|
63
63
|
|
64
64
|
private def load_tasks_that_need_run
|
65
|
-
Dir.glob("#{Rails.root}
|
65
|
+
Dir.glob("#{Rails.root}/#{Paths::TASK_DIR}/*.rb").
|
66
66
|
map { |f| File.basename(f) }.
|
67
67
|
reject { |f| f.scan(/\A(\d{10,})/).empty? }.
|
68
68
|
reject { |f| @versions.has_key?(f.scan(/\A(\d{10,})/).first.first) }.
|
data/lib/schlepper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schlepper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rory O'Connell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -137,11 +137,14 @@ files:
|
|
137
137
|
- Rakefile
|
138
138
|
- bin/console
|
139
139
|
- bin/setup
|
140
|
+
- lib/generators/rspec/schlepper/task_generator.rb
|
141
|
+
- lib/generators/rspec/schlepper/templates/onetime_script_spec.rb.erb
|
140
142
|
- lib/generators/schlepper/USAGE
|
141
143
|
- lib/generators/schlepper/task_generator.rb
|
142
144
|
- lib/generators/schlepper/templates/onetime_script.rb.erb
|
143
145
|
- lib/schlepper.rb
|
144
146
|
- lib/schlepper/abstract_method_helper.rb
|
147
|
+
- lib/schlepper/paths.rb
|
145
148
|
- lib/schlepper/process.rb
|
146
149
|
- lib/schlepper/railtie.rb
|
147
150
|
- lib/schlepper/task.rb
|