salesforcebulk 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,9 +1,10 @@
1
1
  language: ruby
2
2
  script: "bundle exec rake test"
3
3
  rvm:
4
+ - 1.8.7
4
5
  - 1.9.3
5
6
  - 1.9.2
6
7
  notifications:
7
8
  email:
8
9
  on_success: always
9
- on_failure: always
10
+ on_failure: always
data/Gemfile CHANGED
@@ -1,2 +1,3 @@
1
1
  source "http://rubygems.org"
2
+ gem 'fastercsv', :platforms => :ruby_18
2
3
  gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Javier Julio
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- SalesforceBulk is an easy to use Ruby gem for connecting to and using the [Salesforce Bulk API](http://www.salesforce.com/us/developer/docs/api_asynch/index.htm). This is a rewrite and separate release of Jorge Valdivia's salesforce_bulk gem (renamed `salesforcebulk`) with full unit tests and full API capability (e.g. adding multiple batches per job). This gem was built on Ruby 1.9.2 and 1.9.3. Unless requested or contributed, no support for Ruby 1.8.7 is planned.
5
+ SalesforceBulk is an easy to use Ruby gem for connecting to and using the [Salesforce Bulk API](http://www.salesforce.com/us/developer/docs/api_asynch/index.htm). This is a rewrite and separate release of Jorge Valdivia's salesforce_bulk gem (renamed `salesforcebulk`) with full unit tests and full API capability (e.g. adding multiple batches per job). This gem was built on Ruby 1.8.7, 1.9.2, and 1.9.3.
6
6
 
7
7
  ## Installation
8
8
 
@@ -145,6 +145,50 @@ Query results are handled differently as its possible that a single batch could
145
145
 
146
146
  Note: By reviewing the API docs and response format my understanding was that the API would return multiple results sets for a single batch if the query was to large but this does not seem to be the case in my live testing. It seems to be capped at 10000 records (as it when inserting data) but I haven't been able to verify through the documentation. If you know anything about that your input is appreciated. In the meantime the gem was built to support multiple result sets for a query batch but seems that will change which will simplify that method.
147
147
 
148
- ## Copyright
148
+ ## Contribution Suggestions/Ideas
149
149
 
150
- Copyright (c) 2012 Javier Julio.
150
+ - Support for other Ruby platforms
151
+ - Clean up/reorganize tests better
152
+ - Rdocs
153
+
154
+ ## Version History
155
+
156
+ **1.2.0** (October 10, 2012)
157
+
158
+ * Added Ruby 1.8.7 support (thanks to @dlee)
159
+
160
+ **1.1.0** (August 20, 2012)
161
+
162
+ * Added travis setup. Support for Ruby 1.9.2 and 1.9.3 specified.
163
+ * Removed `token` property on Client object. Specify token in `password` field.
164
+ * Accepted pull request for 1.9.3 improvements.
165
+ * Description updates in README.
166
+
167
+ **1.0.0** (August 17, 2012)
168
+
169
+ * Initial public release.
170
+
171
+ ## License
172
+
173
+ (The MIT license)
174
+
175
+ Copyright (c) 2012 Javier Julio
176
+
177
+ Permission is hereby granted, free of charge, to any person obtaining
178
+ a copy of this software and associated documentation files (the
179
+ "Software"), to deal in the Software without restriction, including
180
+ without limitation the rights to use, copy, modify, merge, publish,
181
+ distribute, sublicense, and/or sell copies of the Software, and to
182
+ permit persons to whom the Software is furnished to do so, subject to
183
+ the following conditions:
184
+
185
+ The above copyright notice and this permission notice shall be
186
+ included in all copies or substantial portions of the Software.
187
+
188
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
189
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
190
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
191
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
192
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
193
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
194
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,6 +1,10 @@
1
1
  require 'net/https'
2
2
  require 'xmlsimple'
3
- require 'csv'
3
+ if RUBY_VERSION < '1.9'
4
+ require 'fastercsv'
5
+ else
6
+ require 'csv'
7
+ end
4
8
  require 'active_support'
5
9
  require 'active_support/core_ext/object/blank'
6
10
  require 'active_support/core_ext/hash/keys'
@@ -12,4 +16,4 @@ require 'salesforce_bulk/job'
12
16
  require 'salesforce_bulk/batch'
13
17
  require 'salesforce_bulk/batch_result'
14
18
  require 'salesforce_bulk/batch_result_collection'
15
- require 'salesforce_bulk/query_result_collection'
19
+ require 'salesforce_bulk/query_result_collection'
@@ -1,4 +1,8 @@
1
1
  module SalesforceBulk
2
+ if RUBY_VERSION < "1.9"
3
+ CSV = ::FasterCSV
4
+ end
5
+
2
6
  # Interface for operating the Salesforce Bulk REST API
3
7
  class Client
4
8
  # The host to use for authentication. Defaults to login.salesforce.com.
@@ -94,7 +98,7 @@ module SalesforceBulk
94
98
  end
95
99
 
96
100
  def add_job(operation, sobject, options={})
97
- operation = operation.to_sym.downcase
101
+ operation = operation.to_s.downcase.to_sym
98
102
 
99
103
  raise ArgumentError.new("Invalid operation: #{operation}") unless @valid_operations.include?(operation)
100
104
 
@@ -1,3 +1,3 @@
1
1
  module SalesforceBulk
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -26,5 +26,4 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency "mocha"
27
27
  s.add_development_dependency "shoulda"
28
28
  s.add_development_dependency "webmock"
29
-
30
- end
29
+ end
@@ -83,6 +83,10 @@ class TestBatch < Test::Unit::TestCase
83
83
  {:Id__c => '12345', :Title__c => "This is a test video", :IsPreview__c => nil},
84
84
  {:Id__c => '23456', :Title__c => "A second test!", :IsPreview__c => true}
85
85
  ]
86
+
87
+ if RUBY_VERSION < '1.9'
88
+ data.first.stubs(:keys).returns([:Id__c, :Title__c, :IsPreview__c])
89
+ end
86
90
 
87
91
  stub_request(:post, "#{api_url(@client)}job/#{job_id}/batch").with(:body => request, :headers => @headers).to_return(:body => response, :status => 200)
88
92
 
@@ -244,4 +248,4 @@ class TestBatch < Test::Unit::TestCase
244
248
  end
245
249
  end
246
250
 
247
- end
251
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforcebulk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-20 00:00:00.000000000 Z
12
+ date: 2012-10-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -135,6 +135,7 @@ files:
135
135
  - .rbenv-version
136
136
  - .travis.yml
137
137
  - Gemfile
138
+ - LICENSE
138
139
  - README.md
139
140
  - Rakefile
140
141
  - lib/salesforce_bulk.rb
@@ -189,12 +190,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
190
  - - ! '>='
190
191
  - !ruby/object:Gem::Version
191
192
  version: '0'
193
+ segments:
194
+ - 0
195
+ hash: 801816041369968588
192
196
  required_rubygems_version: !ruby/object:Gem::Requirement
193
197
  none: false
194
198
  requirements:
195
199
  - - ! '>='
196
200
  - !ruby/object:Gem::Version
197
201
  version: '0'
202
+ segments:
203
+ - 0
204
+ hash: 801816041369968588
198
205
  requirements: []
199
206
  rubyforge_project:
200
207
  rubygems_version: 1.8.24