rseed 1.0.6 → 1.0.7

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGFiYjJmNWQzZDJkNzgyM2RjZjVmNjI5ZjhmYzI3MWJhMTQxZTExZA==
4
+ OWFhM2Q5ZTEyYjhlZjhmM2Y5NzE2MzljODM5ZWQ4YzA3MWZlZTEzMg==
5
5
  data.tar.gz: !binary |-
6
- N2VjOGZkMTY3MjE1MWU5MjAyNmJlNWUzMmJiMzhkYTczMjJiZjc2OA==
6
+ YTQzMGVjZjljMWUyZDI3NDZmYjBhM2RiNmI3ODZiMTg4NjgwZjljOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjJhYjY0ZjE3YTEwZTNkNzMzYzFmZmJlM2ZlYWY1ZjllY2EwODcxNzJjMGZk
10
- YjE5MThhMTczYmE3ODhmOGQyMjMyNjcwYzFkMjg3OTk0Yjk3OWViNDljNWFl
11
- Mzg2M2JiNzRiNjVhYWJiOGVlYWNiY2E3Y2MyNDQ1NzFkODJkOGQ=
9
+ M2ZhZGNhMzY5MzQxM2NmNWUyMmFjYzAxY2FlMGNkMjJlYzliNDNhYzA5YjI5
10
+ NDk1NTc0YzdjMmE2MmVkYzU2ZTNjN2FmZjBkOTFmMmMyOTQxOTc2ZDZmYjgy
11
+ NGFiMmQzNDJiOTBlNGI5NmYyYWE1ZDJiYjdhMDQ4ZjUwNjQxZTk=
12
12
  data.tar.gz: !binary |-
13
- NjU0YmIyYmQ4ZWE1Yzc5OTI2OTE2OWQ1ZDU0ODllMzU5OGQ4MjM4NjQyODRj
14
- YmFlMTFkODM3Mzk1MmVlODQ1MDNjNDA5MWUxODBlYjVhOWEzODEwMWIyMzQ0
15
- MTFkMWU0YjQ4OTVjYmY1ZDhjYTliOTBlYmUwZWMyMWQwMTM5ODk=
13
+ MjQ4ZWZjNjRjODQ5ZWY0OGEzMzJkMWIzYjc5YTkyZDk1NjE5NTcyOGI2ZDYz
14
+ N2RkODc4ZDllZmVlN2Q5ZDc4OTRiMjUzNmQyZTE0ZmRkODEwYmExY2RjMDM1
15
+ MmZiNDVlMmFjMjBmZmRkNjQ4NTIyOTcxNmQ1ODJiZjY1YTlkNDg=
data/README.rdoc CHANGED
@@ -45,6 +45,10 @@ This will cause the generator to create a file with fewer
45
45
 
46
46
  == The Converter File
47
47
 
48
+ * For some reason that we haven't been able to pin down, Rails struggles with resolving constants within these converters.
49
+ This does not affect the converters when running in production modes. The workaround for this is to prefix any of your
50
+ constant names (such as model classes) with :: within your converters. This is done by default when using the generator*
51
+
48
52
  === Attribute Options
49
53
 
50
54
  * :header
@@ -31,6 +31,9 @@ module Rseed
31
31
  end
32
32
 
33
33
  def deserialize options = {}, &block
34
+ total_records = 0
35
+ record_count = 0
36
+
34
37
  converter.logger = logger
35
38
  adapter.logger = logger
36
39
  adapter.converter = converter
@@ -61,10 +64,12 @@ module Rseed
61
64
  result[:backtrace] = e.backtrace
62
65
  end
63
66
 
67
+ total_records = meta[:total_records] unless meta[:total_records].nil?
68
+ record_count = meta[:record_count] unless meta[:record_count].nil?
64
69
  # Calculate the ETA
65
- if meta[:record_count] and meta[:total_records]
66
- remaining = meta[:total_records] - meta[:record_count]
67
- tpr = (Time.now - start_time)/meta[:record_count]
70
+ if record_count and total_records
71
+ remaining = total_records - record_count
72
+ tpr = (Time.now - start_time)/record_count
68
73
  meta[:eta] = remaining * tpr
69
74
  end
70
75
 
@@ -84,9 +89,9 @@ module Rseed
84
89
  yield :error, {success: false, message: 'Preprocessing failed', error: @adapter.error}
85
90
  end
86
91
  rescue Exception => e
87
- yield :error, {success: false, message: 'Exception during preprocessing', error: e.message, backtrace: e.backtrace}
92
+ yield :error, {success: false, message: 'Exception during Processing', error: e.message, backtrace: e.backtrace}
88
93
  end
89
- yield :complete
94
+ yield :complete, {success: true }, {total_records: total_records, record_count: record_count}
90
95
  end
91
96
  end
92
97
  end
data/lib/rseed/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rseed
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rseed
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Monagle