schlepper 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/schlepper/process.rb +7 -3
- data/lib/schlepper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4506d586d2e1744bb829ee3b0def8bbe96b58856
|
4
|
+
data.tar.gz: bc1c5a139f20a668111719691395f2d0123a206a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abe7e65630fc9c06207a2fd545e2142888d9efa896cd668a43b1ad2f6076a6749d8e659324484b830d2b4d01e74ce641caa4c61197495f3569fa24cc98d311b1
|
7
|
+
data.tar.gz: 09fee8ddd8f65b74b6ad135b261ff514872e442dea8eb339fc9642e0b125b27e9c3963eb0497f4034ada524815b7dc8c461c06c2d5ac55c3399024070492cff5
|
data/lib/schlepper/process.rb
CHANGED
@@ -4,6 +4,8 @@ require 'active_record'
|
|
4
4
|
module Schlepper
|
5
5
|
class Process
|
6
6
|
def run_all
|
7
|
+
old_sync = STDOUT.sync
|
8
|
+
STDOUT.sync = true
|
7
9
|
create_table_if_necessary
|
8
10
|
fetch_script_numbers_from_database
|
9
11
|
load_tasks_that_need_run
|
@@ -16,6 +18,8 @@ module Schlepper
|
|
16
18
|
offending_file = e.send(:caller_locations).first.path.split("/").last
|
17
19
|
puts "#{offending_file} caused an error: "
|
18
20
|
raise e
|
21
|
+
ensure
|
22
|
+
STDOUT.sync = old_sync
|
19
23
|
end
|
20
24
|
|
21
25
|
private def create_table_if_necessary
|
@@ -81,14 +85,14 @@ module Schlepper
|
|
81
85
|
if runner.run
|
82
86
|
ActiveRecord::Base.connection.execute <<-SQL
|
83
87
|
INSERT INTO schlepper_tasks (version, owner, description, completed_at)
|
84
|
-
VALUES (#{runner.version_number}, #{ActiveRecord::Base.sanitize(runner.owner)}, #{ActiveRecord::Base.sanitize(runner.description)}, #{ActiveRecord::Base.connection.quote(Time.now.to_s)});
|
88
|
+
VALUES (#{runner.version_number}, #{ActiveRecord::Base.sanitize(runner.owner)}, #{ActiveRecord::Base.sanitize(runner.description)}, #{ActiveRecord::Base.connection.quote(Time.now.to_s(:db))});
|
85
89
|
SQL
|
86
90
|
else
|
87
91
|
puts "#{klass.name} ran without errors, but was not successful"
|
88
92
|
if runner.failure_message
|
89
|
-
puts "The resulting
|
93
|
+
puts "The resulting failure was: #{runner.failure_message}"
|
90
94
|
else
|
91
|
-
puts "The
|
95
|
+
puts "The failure message was not set. Find #{runner.owner} to help investigate"
|
92
96
|
end
|
93
97
|
fail ActiveRecord::Rollback
|
94
98
|
end
|
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.9.
|
4
|
+
version: 0.9.1
|
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: 2017-01-
|
11
|
+
date: 2017-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
173
|
rubyforge_project:
|
174
|
-
rubygems_version: 2.
|
174
|
+
rubygems_version: 2.2.2
|
175
175
|
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: Adds tracking of one off data scripts for Rails.
|