Permalink
Browse files

move salesforce credentials into separate configuration namespace

  • Loading branch information...
1 parent 11a5bf1 commit 1a6d7dcc4bf1fd7bdf226c21ce3a5615316f0ddf @DerGuteMoritz DerGuteMoritz committed Dec 2, 2010
Showing with 8 additions and 6 deletions.
  1. +5 −4 examples/config.yml
  2. +3 −2 lib/salesforce_sync/salesforce.rb
View
@@ -1,10 +1,11 @@
lock_file: /tmp/asd
salesforce:
- url: https://www.salesforce.com/services/Soap/u/20.0
- username: foo
- password: bar
- token: baz
+ connection:
+ url: https://www.salesforce.com/services/Soap/u/20.0
+ username: foo
+ password: bar
+ token: baz
database:
@@ -16,6 +16,7 @@ class SalesforceSync::Salesforce
def initialize(options)
@options = options
+ @connection = options[:connection].symbolize_keys
end
def schema
@@ -105,8 +106,8 @@ def call(method, arg = nil)
end
def rforce
- @rforce ||= RForce::Binding.new(@options[:url]).tap do |b|
- b.login(@options[:username], "#{@options[:password]}#{@options[:token]}")
+ @rforce ||= RForce::Binding.new(@connection[:url]).tap do |b|
+ b.login(@connection[:username], "#{@connection[:password]}#{@connection[:token]}")
b.batch_size = @options[:batch_size] || 2000
end
end

0 comments on commit 1a6d7dc

Please sign in to comment.