abstract_importer 1.5.1 → 1.5.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: 31e3cc0171a843a214b22c3e6e3ae23cbedcd5e3
4
- data.tar.gz: 1a59ba701e8554d5961241e523ed9a6e4ef86cc8
3
+ metadata.gz: aabc536974e35a9a977a9085465100c41b62c84c
4
+ data.tar.gz: ccb6ae41decca2a9773fc94cdbbb48da55f766d0
5
5
  SHA512:
6
- metadata.gz: aa2eb7be342b3a8852019174770cae2eb20cbb71fd22ae06f2fb5f61fe0787558ab2799e368767f286430c8479ea62cb90ef233e2735bf90e0131a69291d7071
7
- data.tar.gz: 55ddab55d457e31cc62f6e17cc47e253a05c2237e37a1915b37b97feefd24aeccc27841c8e2617a5d016e324158ea10a7d0625dbb159c7b6ba9fd098397455f4
6
+ metadata.gz: 1b5eaf9e0ca602a658646d13cdf26498f7cb2a9eaa56a7b094d1df81a1c082441997401f95a58f2500c3ac13fdb2e280a1ece66b0e5f9eec2215d311f8b8510f
7
+ data.tar.gz: 469215e190e215d2c3cb6ecb30c27529835fac06168e301f1448c690dc8791ab65e69dbf9709a9fc42882b97c303bdda7a4a3f83f61b86900c4b330cf76fb264
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency "minitest-reporters-turn_reporter"
28
28
  spec.add_development_dependency "rake"
29
29
  spec.add_development_dependency "sqlite3"
30
- spec.add_development_dependency "pg"
30
+ spec.add_development_dependency "pg", "~> 0.18"
31
31
  spec.add_development_dependency "pry"
32
32
  spec.add_development_dependency "rr"
33
33
  spec.add_development_dependency "database_cleaner"
@@ -38,6 +38,9 @@ module AbstractImporter
38
38
  def record_failed(record, hash)
39
39
  end
40
40
 
41
+ def record_skipped(hash)
42
+ end
43
+
41
44
  def batch_inserted(size)
42
45
  end
43
46
 
@@ -13,6 +13,11 @@ module AbstractImporter
13
13
  super
14
14
  end
15
15
 
16
+ def record_skipped(hash)
17
+ io.print "_"
18
+ super
19
+ end
20
+
16
21
  def batch_inserted(size)
17
22
  io.print "." * size
18
23
  super
@@ -30,6 +30,10 @@ module AbstractImporter
30
30
  pbar.inc
31
31
  end
32
32
 
33
+ def record_skipped(hash)
34
+ pbar.inc
35
+ end
36
+
33
37
  def batch_inserted(size)
34
38
  pbar.inc size
35
39
  end
@@ -10,6 +10,7 @@ module AbstractImporter
10
10
 
11
11
  if already_imported?(hash)
12
12
  summary.already_imported += 1
13
+ reporter.record_skipped hash
13
14
  return
14
15
  end
15
16
 
@@ -17,6 +18,7 @@ module AbstractImporter
17
18
 
18
19
  if redundant_record?(hash)
19
20
  summary.redundant += 1
21
+ reporter.record_skipped hash
20
22
  return
21
23
  end
22
24
 
@@ -27,6 +29,7 @@ module AbstractImporter
27
29
  end
28
30
  rescue ::AbstractImporter::Skip
29
31
  summary.skipped += 1
32
+ reporter.record_skipped hash
30
33
  end
31
34
 
32
35
 
@@ -18,6 +18,7 @@ module AbstractImporter
18
18
 
19
19
  if already_imported?(hash)
20
20
  summary.already_imported += 1
21
+ reporter.record_skipped hash
21
22
  return
22
23
  end
23
24
 
@@ -25,6 +26,7 @@ module AbstractImporter
25
26
 
26
27
  if redundant_record?(hash)
27
28
  summary.redundant += 1
29
+ reporter.record_skipped hash
28
30
  return
29
31
  end
30
32
 
@@ -32,6 +34,7 @@ module AbstractImporter
32
34
 
33
35
  rescue ::AbstractImporter::Skip
34
36
  summary.skipped += 1
37
+ reporter.record_skipped hash
35
38
  end
36
39
 
37
40
 
@@ -12,6 +12,7 @@ module AbstractImporter
12
12
 
13
13
  if redundant_record?(hash)
14
14
  summary.redundant += 1
15
+ reporter.record_skipped hash
15
16
  return
16
17
  end
17
18
 
@@ -22,6 +23,7 @@ module AbstractImporter
22
23
  end
23
24
  rescue ::AbstractImporter::Skip
24
25
  summary.skipped += 1
26
+ reporter.record_skipped hash
25
27
  end
26
28
 
27
29
 
@@ -1,3 +1,3 @@
1
1
  module AbstractImporter
2
- VERSION = "1.5.1"
2
+ VERSION = "1.5.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.5.1
4
+ version: 1.5.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: 2017-10-17 00:00:00.000000000 Z
11
+ date: 2018-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -140,16 +140,16 @@ dependencies:
140
140
  name: pg
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: '0.18'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: '0.18'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: pry
155
155
  requirement: !ruby/object:Gem::Requirement