DanaDanger-data_transport 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -35,13 +35,13 @@ module DataTransport
35
35
  raise(TypeError, "batch size must be an integer") unless batch_size.is_a?(Integer)
36
36
  raise(RangeError, "batch size must be greater than zero") if batch_size < 1
37
37
  unless options.empty?
38
- raise(ArgumentError, "unrecognized options: `#{options.join("', `")}'")
38
+ raise(ArgumentError, "unrecognized options: `#{options.keys.join("', `")}'")
39
39
  end
40
40
  # Run the transport.
41
41
  output.reset
42
42
  source = DataTransport::Record::Source.new
43
43
  destination = DataTransport::Record::Destination.new
44
- input.each_record do |record|
44
+ input.each_record(batch_size) do |record|
45
45
  source.record = record
46
46
  destination.reset!
47
47
  yield source, destination
@@ -8,7 +8,7 @@ module DataTransport
8
8
  raise NotImplementedError
9
9
  end
10
10
 
11
- def each_record(batch_size = 1000)
11
+ def each_record(batch_size = nil)
12
12
  raise NotImplementedError
13
13
  end
14
14
 
@@ -121,7 +121,7 @@ module DataTransport
121
121
  @class.count(:conditions => @conditions)
122
122
  end
123
123
 
124
- def each_record(batch_size) # :nodoc:
124
+ def each_record(batch_size = nil) # :nodoc:
125
125
  conn = @class.connection
126
126
  column_names = conn.columns(@class.table_name).collect {|c| c.name}
127
127
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: DanaDanger-data_transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dana Danger