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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 590aee564323d53ed712ae142ef36c3e9b11fe29
4
- data.tar.gz: 0a29017031beffc990469bd71b486f42a2749f27
3
+ metadata.gz: 4506d586d2e1744bb829ee3b0def8bbe96b58856
4
+ data.tar.gz: bc1c5a139f20a668111719691395f2d0123a206a
5
5
  SHA512:
6
- metadata.gz: db6a6a3baf2d102578a78c9112b775ebabfd42534df44e8246dc2ef61f39c3c5f88f19f3e0c8249402395226187b5ce867fc4b125876a5e75224a2aaea712f0e
7
- data.tar.gz: 1aa5208607ef35eb9be55a32015d197e5cfa2dd6e766bf03a821c59bf36e77f0fa7f4e0f7fdd0414ff13fbeddef99fe9b0a5994176e72f0f78e94e960d78cfae
6
+ metadata.gz: abe7e65630fc9c06207a2fd545e2142888d9efa896cd668a43b1ad2f6076a6749d8e659324484b830d2b4d01e74ce641caa4c61197495f3569fa24cc98d311b1
7
+ data.tar.gz: 09fee8ddd8f65b74b6ad135b261ff514872e442dea8eb339fc9642e0b125b27e9c3963eb0497f4034ada524815b7dc8c461c06c2d5ac55c3399024070492cff5
@@ -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 falure was: #{runner.failure_message}"
93
+ puts "The resulting failure was: #{runner.failure_message}"
90
94
  else
91
- puts "The falure message was not set. Find #{runner.owner} to help investigate"
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
@@ -1,3 +1,3 @@
1
1
  module Schlepper
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
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.0
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-05 00:00:00.000000000 Z
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.5.1
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.