sprig-reap 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
data/lib/sprig/reap/model.rb
CHANGED
@@ -70,8 +70,8 @@ module Sprig::Reap
|
|
70
70
|
|
71
71
|
def records
|
72
72
|
@records ||= klass.all.map { |record| Record.new(record, self) }
|
73
|
-
rescue
|
74
|
-
log_error "Encountered an error when pulling the database records for #{to_s}
|
73
|
+
rescue => e
|
74
|
+
log_error "Encountered an error when pulling the database records for #{to_s}:\r#{e.message}"
|
75
75
|
[]
|
76
76
|
end
|
77
77
|
|
data/lib/sprig/reap/seed_file.rb
CHANGED
@@ -45,8 +45,8 @@ module Sprig::Reap
|
|
45
45
|
yield file, namespace
|
46
46
|
end
|
47
47
|
|
48
|
-
rescue
|
49
|
-
log_error "There was an issue writing to the file for #{model}
|
48
|
+
rescue => e
|
49
|
+
log_error "There was an issue writing to the file for #{model}:\r#{e.message}"
|
50
50
|
end
|
51
51
|
|
52
52
|
def existing_sprig_ids(yaml)
|
data/lib/sprig/reap/version.rb
CHANGED
data/spec/db/activerecord.db
CHANGED
Binary file
|
@@ -191,11 +191,11 @@ describe Sprig::Reap::Model do
|
|
191
191
|
|
192
192
|
context "when there's an error accessing the database table for a given model" do
|
193
193
|
before do
|
194
|
-
Post.stub(:all).and_raise(StandardError)
|
194
|
+
Post.stub(:all).and_raise(StandardError, 'Oh snap')
|
195
195
|
end
|
196
196
|
|
197
197
|
it "logs an error message" do
|
198
|
-
log_should_receive :error, :with => "Encountered an error when pulling the database records for Post
|
198
|
+
log_should_receive :error, :with => "Encountered an error when pulling the database records for Post:\rOh snap"
|
199
199
|
|
200
200
|
subject.records
|
201
201
|
end
|
@@ -134,11 +134,11 @@ describe Sprig::Reap::SeedFile do
|
|
134
134
|
|
135
135
|
context "when there are errors writing to the file" do
|
136
136
|
before do
|
137
|
-
File.stub(:open).and_raise(StandardError)
|
137
|
+
File.stub(:open).and_raise(StandardError, 'Oh snap')
|
138
138
|
end
|
139
139
|
|
140
140
|
it "logs an error for the given model" do
|
141
|
-
log_should_receive :error, :with => "There was an issue writing to the file for Comment
|
141
|
+
log_should_receive :error, :with => "There was an issue writing to the file for Comment:\rOh snap"
|
142
142
|
|
143
143
|
subject.write
|
144
144
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprig-reap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|