abstract_importer 1.3.1 → 1.3.2

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: 13db5e1dffb81295899859bceffe4ff4e61cd396
4
- data.tar.gz: 85ce8e0ead69302fd451916c94ec41b94ea8abd3
3
+ metadata.gz: 48e21131bf98cff4d6e2c9bd6d26d1250081f23a
4
+ data.tar.gz: 1f213fef44ac6fa850a87405118807708071dadc
5
5
  SHA512:
6
- metadata.gz: 48e5803f18514f2538d3f16d5ab5a7dabb4b609658e5db991b59c645a37f61680f0a56746e6022a49045a7fdf492cd9136b4a2db76fe39d31fcf474874a92b00
7
- data.tar.gz: 6faffa2d0d5ad9b3c6fa2f6fd0e20e4dbbd3eb0c8a5c2d45b3796bc659bada94b031c8c6c375de0cd558ce1f0f7e5f8e6d067a3d0aa7051471baf4bcb336895c
6
+ metadata.gz: df926ba45f927f96b45f70acbd156244a32db2bb91052befbaba386ff3f624b019ade75d01eb65698aa305ab7dd675b1888a2528bae7afe8d70e9b37c095ed84
7
+ data.tar.gz: e48bf3593a2a36dcde98084ea43c574f41707a2e458e373feed19a8be97383428668c6b70c87e75b608ad8b9d21cfc97342f332d0c8d2b5d16fee61edd626869
@@ -206,7 +206,14 @@ module AbstractImporter
206
206
  case ENV["IMPORT_REPORTER"].to_s.downcase
207
207
  when "none" then Reporters::NullReporter.new(io)
208
208
  when "performance" then Reporters::PerformanceReporter.new(io)
209
- else Reporters::DebugReporter.new(io)
209
+ when "debug" then Reporters::DebugReporter.new(io)
210
+ when "dot" then Reporters::DotReporter.new(io)
211
+ else
212
+ if Rails.env.production?
213
+ Reporters::DebugReporter.new(io)
214
+ else
215
+ Reporters::DotReporter.new(io)
216
+ end
210
217
  end
211
218
  end
212
219
 
@@ -49,13 +49,7 @@ module AbstractImporter
49
49
 
50
50
 
51
51
 
52
- def record_created(record)
53
- io.print "." unless production?
54
- end
55
-
56
52
  def record_failed(record, hash)
57
- io.print "×" unless production?
58
-
59
53
  error_messages = invalid_params[record.class.name] ||= {}
60
54
  record.errors.full_messages.each do |error_message|
61
55
  error_messages[error_message] = hash unless error_messages.key?(error_message)
@@ -0,0 +1,19 @@
1
+ module AbstractImporter
2
+ module Reporters
3
+ class DotReporter < DebugReporter
4
+
5
+
6
+ def record_created(record)
7
+ io.print "."
8
+ super
9
+ end
10
+
11
+ def record_failed(record, hash)
12
+ io.print "×"
13
+ super
14
+ end
15
+
16
+
17
+ end
18
+ end
19
+ end
@@ -1,4 +1,5 @@
1
1
  require 'abstract_importer/reporters/base_reporter'
2
2
  require 'abstract_importer/reporters/debug_reporter'
3
+ require 'abstract_importer/reporters/dot_reporter'
3
4
  require 'abstract_importer/reporters/null_reporter'
4
5
  require 'abstract_importer/reporters/performance_reporter'
@@ -1,3 +1,3 @@
1
1
  module AbstractImporter
2
- VERSION = "1.3.1"
2
+ VERSION = "1.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstract_importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Lail
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-03 00:00:00.000000000 Z
11
+ date: 2015-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -217,6 +217,7 @@ files:
217
217
  - lib/abstract_importer/reporters.rb
218
218
  - lib/abstract_importer/reporters/base_reporter.rb
219
219
  - lib/abstract_importer/reporters/debug_reporter.rb
220
+ - lib/abstract_importer/reporters/dot_reporter.rb
220
221
  - lib/abstract_importer/reporters/null_reporter.rb
221
222
  - lib/abstract_importer/reporters/performance_reporter.rb
222
223
  - lib/abstract_importer/strategies.rb