testrd_gem 1.1.1 → 1.2.0

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: db69c41e21ec0be39315e531065bc967e19c429c
4
- data.tar.gz: 440f75576f7e4ffdab31ea94c70fda39a92a4258
3
+ metadata.gz: f9cc307e1b1bf78228063d94dd85b9248bbe01e1
4
+ data.tar.gz: 326943f4cebeb1e5c44e04dcb2d3f7bd35d49d18
5
5
  SHA512:
6
- metadata.gz: 8ae7c6395ccc10cb18e121c4e26c70269243a5e56ce69fe0b08689df7233e75a49a76d6c4bbd5e9b896de3bf9ea9eb878eb1db0f48bec7ba4e6dc576b2b1b51a
7
- data.tar.gz: 99c574e3f365c0bf60cd42a66112449997c0b4e35e3ed4a4b6cc3c986e0129a8c3435f1822b7f0b6b29b212b5f4b5ce15148f17fb5c5de29fa4ffa306969675e
6
+ metadata.gz: cee4712c43b779c1e7e5c8f5cc2834d1d94bc6ae15b8b22a8df97d0672a1af846c604b5f73f367b5cd7f39eef8fe6bd07e5e6506cdffb1774fdd9505984cb7a4
7
+ data.tar.gz: fca232e4a9d8df6aeb14bc7ab63094981d558116dc65e2301a3281eaca7ef211f3d612b5f39adf561b6b00b2fcb0061910f51680bb38aa1b09900f679ce0c9c8
data/README.md CHANGED
@@ -49,15 +49,16 @@ Return the number of registered leads.
49
49
 
50
50
  ### Integration with Salesforce
51
51
 
52
- TestrdGem uses a external gem for connecting to Salesforce: [salesforce-bulk](https://github.com/jorgevaldivia/salesforce_bulk)
52
+ TestrdGem uses a external gem for connecting to Salesforce: [databasedotcom](https://github.com/heroku/databasedotcom)
53
53
 
54
54
  Lead integration with Salesforce
55
55
 
56
- TestrdGem::integrate(username, password, token)
56
+ TestrdGem::integrate(username, password, token, lead_params)
57
57
 
58
58
  * Username: Salesforce identification
59
59
  * Password: Salesforce password
60
60
  * Token: Salesforce security token
61
+ * Lead_params: Lead attributes to be mapped to salesforce
61
62
 
62
63
  ## Example
63
64
 
@@ -1,10 +1,12 @@
1
- require 'salesforce_bulk'
1
+ require 'active_support'
2
+ require 'databasedotcom'
2
3
  require 'pg'
3
4
 
4
5
  module TestrdGem
5
6
  class Lead
6
7
 
7
8
  @@conn = PGconn.open(:host => 'ec2-54-235-147-211.compute-1.amazonaws.com', :dbname => 'da0t8bv4p5butg', :user => 'sowqqzffnclwat', :password => 'wJxPixjzZYuASiDjq53lqvyC_e')
9
+ #@@conn = PGconn.open(:dbname => 'testrd', :user => 'dev')
8
10
  @@index = 0
9
11
 
10
12
  def initialize(name, last_name, email, company, job_title, phone, website)
@@ -38,10 +40,14 @@ module TestrdGem
38
40
  lead_d
39
41
  end
40
42
 
41
- def self.integrate(username, password, token)
42
- puts "Salesforce Integration"
43
- #salesforce = SalesforceBulk::Api.new("YOUR_SALESFORCE_USERNAME", "YOUR_SALESFORCE_PASSWORD+YOUR_SALESFORCE_TOKEN")
44
- salesforce = SalesforceBulk::Api.new(username, password + token)
43
+ def self.integrate(username, password, token, lead_params)
44
+ client = Databasedotcom::Client.new :client_id => "3MVG9KI2HHAq33Rx7XIyfKc5aKIGHGMyvxp9bZHTRZNs1wZs_QI613iMloL9d2waIFXna4oWqvTuJmyMaFJtY", :client_secret => "6763675580231888688"
45
+
46
+ client.authenticate :username => username, :password => password + token
47
+
48
+ lead_class = client.materialize("Lead")
49
+
50
+ client.create(lead_class, lead_params)
45
51
  end
46
52
 
47
53
  end
@@ -1,5 +1,3 @@
1
- require 'salesforce_bulk'
2
-
3
1
  module TestrdGem
4
2
  class LeadStorage
5
3
 
@@ -52,10 +50,14 @@ module TestrdGem
52
50
  end
53
51
  end
54
52
 
55
- def self.integrate(username, password, token)
56
- puts "Salesforce Integration"
57
- #salesforce = SalesforceBulk::Api.new("YOUR_SALESFORCE_USERNAME", "YOUR_SALESFORCE_PASSWORD+YOUR_SALESFORCE_TOKEN")
58
- salesforce = SalesforceBulk::Api.new(username, password + token)
53
+ def self.integrate(username, password, token, lead_params)
54
+ client = Databasedotcom::Client.new :client_id => "3MVG9KI2HHAq33Rx7XIyfKc5aKIGHGMyvxp9bZHTRZNs1wZs_QI613iMloL9d2waIFXna4oWqvTuJmyMaFJtY", :client_secret => "6763675580231888688"
55
+
56
+ client.authenticate :username => username, :password => password + token
57
+
58
+ lead_class = client.materialize("Lead")
59
+
60
+ client.create(lead_class, lead_params)
59
61
  end
60
62
 
61
63
  end
@@ -1,3 +1,3 @@
1
1
  module TestrdGem
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.0"
3
3
  end
data/testrd_gem.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_runtime_dependency "salesforce_bulk"
20
+ spec.add_runtime_dependency "databasedotcom"
21
21
  spec.add_runtime_dependency "pg"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.10"
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testrd_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vicente Silveira Inácio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-02 00:00:00.000000000 Z
11
+ date: 2015-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: salesforce_bulk
14
+ name: databasedotcom
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="