scripterator 1.3.0 → 1.3.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42473644a78bcc8e3175774fb6b6783a93ee1ac1
4
- data.tar.gz: ca62a4ba9252989df7090cd4a31aa8692b23262d
3
+ metadata.gz: 84c395b5214ac475e3763c5bda472573e92d1361
4
+ data.tar.gz: c707c8e28c4359292895d4fa3e18fbb939ec3f65
5
5
  SHA512:
6
- metadata.gz: 76076d599c2f543d563a35c1770056a400fad021cfd8894f87588aec0bdefb268f8cf5d0609cba6dc4308ca6594a4e4aaf55314840ea4c603fad13682fd45ad1
7
- data.tar.gz: 7d0c093432672e53539b50f6c7613a37fcb08a20f8a9df168d90fcfe095b74e964b68ff58a8b136d1a0ab66c3e6048d8192e0fc5128504f01e08edfd5819048f
6
+ metadata.gz: c31e0e84edea8cdb24d48ce7390c28f9fa0c27dcb0663e941b78b1d55f398c1ff6f7bdd06693b8af3a8cb75e8d94a127ee75ab8bcac456241c8937c01b671635
7
+ data.tar.gz: dcfedbcc6041a308b9cadc1ca56b2c04b48f5d40a171a35af6151410c27340731246f0baeb4009ea415c6e1ab9a4fbbc969ee31027807185307a60dad923d370
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 1.3.1
2
+ - Fix things from 1.3.0 that didn't work
3
+
1
4
  # 1.3.0
2
5
  - Add support for changing batch size
3
6
  - Add support for `after_batch` and `before_batch` callbacks
data/README.md CHANGED
@@ -101,6 +101,7 @@ Environment variable options:
101
101
 
102
102
  - `START`: first model ID to scripterate
103
103
  - `END`: last model ID to scripterate
104
+ - `BATCH_SIZE`: how many records to process in a batch
104
105
  - `ID_LIST`: comma-delimited list of IDs to scripterate (e.g. "ID_LIST=1,99,440,23")
105
106
  - `REDIS_EXPIRATION`: amount of time (in seconds) before Redis result sets (checked IDs and failed IDs) are expired
106
107
 
@@ -109,7 +109,7 @@ module Scripterator
109
109
  batch_size: @batch_size
110
110
  }
111
111
 
112
- if @id_list.empty?
112
+ if @id_list.count < 1
113
113
  opts[:start] = @start_id
114
114
  else
115
115
  relation = model_finder.where(id: @id_list)
@@ -1,3 +1,3 @@
1
1
  module Scripterator
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
data/lib/scripterator.rb CHANGED
@@ -18,6 +18,7 @@ module Scripterator
18
18
  options = {}.tap do |o|
19
19
  o[:start_id] = ENV['START'].try(:to_i)
20
20
  o[:end_id] = ENV['END'].try(:to_i)
21
+ o[:batch_size] = ENV['BATCH_SIZE'].try(:to_i)
21
22
  o[:id_list] = ENV['ID_LIST'].try(:split, ',')
22
23
  o[:redis_expiration] = ENV['REDIS_EXPIRATION'].try(:to_i) || config.redis_expiration
23
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scripterator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ted Dumitrescu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-24 00:00:00.000000000 Z
12
+ date: 2017-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord