sprig-reap 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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}...\r"
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
 
@@ -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}...\r"
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)
@@ -1,5 +1,5 @@
1
1
  module Sprig
2
2
  module Reap
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
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...\r"
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...\r"
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.8
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-08-15 00:00:00.000000000 Z
12
+ date: 2014-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails