salesforce_connector 0.0.12 → 0.0.13
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.
- data/lib/salesforce_connector.rb +2 -1
- data/lib/salesforce_connector/account.rb +1 -1
- data/lib/salesforce_connector/contact.rb +1 -5
- data/lib/salesforce_connector/lead.rb +1 -1
- data/lib/salesforce_connector/oauth_object.rb +6 -0
- data/lib/salesforce_connector/opportunity.rb +1 -1
- data/lib/salesforce_connector/profile.rb +12 -0
- data/lib/salesforce_connector/user.rb +11 -0
- data/lib/salesforce_connector/version.rb +1 -1
- data/lib/salesforce_connector/visitor.rb +1 -1
- data/salesforce_connector.gemspec +0 -1
- metadata +52 -41
- data/lib/forcedotcom.rb +0 -41
data/lib/salesforce_connector.rb
CHANGED
@@ -5,7 +5,8 @@ require "salesforce_connector/visitor"
|
|
5
5
|
require "salesforce_connector/lead"
|
6
6
|
require "salesforce_connector/contact"
|
7
7
|
require "salesforce_connector/opportunity"
|
8
|
-
require "
|
8
|
+
require "salesforce_connector/user"
|
9
|
+
require "salesforce_connector/profile"
|
9
10
|
|
10
11
|
module SalesforceConnector
|
11
12
|
|
@@ -2,7 +2,7 @@ module SalesforceConnector
|
|
2
2
|
|
3
3
|
class Account < OauthObject
|
4
4
|
def self.get_first_hundred
|
5
|
-
Account.query('SELECT Name, Id
|
5
|
+
Account.query('SELECT Name, Id from Account LIMIT 100')
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.get_all_by_last_name(last_name)
|
@@ -2,11 +2,7 @@ module SalesforceConnector
|
|
2
2
|
|
3
3
|
class Contact < OauthObject
|
4
4
|
def self.get_first_hundred
|
5
|
-
Contact.query('SELECT Name, Id
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.set_satisfaction(id,value)
|
9
|
-
Contact.query("update Contact set satisfaction__c='#{value}' where Id='#{id}'")
|
5
|
+
Contact.query('SELECT Name, Id from Contact LIMIT 100')
|
10
6
|
end
|
11
7
|
|
12
8
|
def self.get_all_by_last_name(last_name)
|
@@ -19,5 +19,11 @@ module SalesforceConnector
|
|
19
19
|
return result.parsed_response["records"] || []
|
20
20
|
end
|
21
21
|
|
22
|
+
def self.find(str)
|
23
|
+
self.set_headers
|
24
|
+
result = get(self.root_url+"/#{self.class}/#{CGI::escape(str)}")
|
25
|
+
return result.parsed_response["records"] || []
|
26
|
+
end
|
27
|
+
|
22
28
|
end
|
23
29
|
end
|
@@ -2,7 +2,7 @@ module SalesforceConnector
|
|
2
2
|
|
3
3
|
class Opportunity < OauthObject
|
4
4
|
def self.get_first_hundred
|
5
|
-
Opportunity.query('SELECT Name, Id
|
5
|
+
Opportunity.query('SELECT Name, Id from Opportunity LIMIT 100')
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.get_all_by_last_name(last_name)
|
metadata
CHANGED
@@ -1,81 +1,92 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: salesforce_connector
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 13
|
9
|
+
version: 0.0.13
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Vzmind
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.2.4
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: *2160860420
|
25
|
-
- !ruby/object:Gem::Dependency
|
16
|
+
|
17
|
+
date: 2012-07-12 00:00:00 +01:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
26
21
|
name: httparty
|
27
|
-
|
28
|
-
|
29
|
-
requirements:
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
30
25
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 7
|
30
|
+
- 7
|
32
31
|
version: 0.7.7
|
33
32
|
type: :runtime
|
34
|
-
|
35
|
-
version_requirements: *2160859960
|
33
|
+
version_requirements: *id001
|
36
34
|
description: Use Omniauth OAuth authentification strategy and REST API with httparty
|
37
|
-
email:
|
35
|
+
email:
|
38
36
|
- vzmind@gmail.com
|
39
37
|
executables: []
|
38
|
+
|
40
39
|
extensions: []
|
40
|
+
|
41
41
|
extra_rdoc_files: []
|
42
|
-
|
42
|
+
|
43
|
+
files:
|
43
44
|
- .gitignore
|
44
45
|
- Gemfile
|
45
46
|
- README.rdoc
|
46
47
|
- Rakefile
|
47
|
-
- lib/forcedotcom.rb
|
48
48
|
- lib/salesforce_connector.rb
|
49
49
|
- lib/salesforce_connector/account.rb
|
50
50
|
- lib/salesforce_connector/contact.rb
|
51
51
|
- lib/salesforce_connector/lead.rb
|
52
52
|
- lib/salesforce_connector/oauth_object.rb
|
53
53
|
- lib/salesforce_connector/opportunity.rb
|
54
|
+
- lib/salesforce_connector/profile.rb
|
55
|
+
- lib/salesforce_connector/user.rb
|
54
56
|
- lib/salesforce_connector/version.rb
|
55
57
|
- lib/salesforce_connector/visitor.rb
|
56
58
|
- salesforce_connector.gemspec
|
59
|
+
has_rdoc: true
|
57
60
|
homepage: http://github.com/vzmind
|
58
61
|
licenses: []
|
62
|
+
|
59
63
|
post_install_message:
|
60
64
|
rdoc_options: []
|
61
|
-
|
65
|
+
|
66
|
+
require_paths:
|
62
67
|
- lib
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
segments:
|
80
|
+
- 1
|
81
|
+
- 3
|
82
|
+
- 6
|
74
83
|
version: 1.3.6
|
75
84
|
requirements: []
|
85
|
+
|
76
86
|
rubyforge_project: salesforce_connector
|
77
|
-
rubygems_version: 1.
|
87
|
+
rubygems_version: 1.3.6
|
78
88
|
signing_key:
|
79
89
|
specification_version: 3
|
80
90
|
summary: Connect your Rails 3 app to a Salesforce account
|
81
91
|
test_files: []
|
92
|
+
|
data/lib/forcedotcom.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
#require "salesforce_connector/version"
|
2
|
-
require 'omniauth/oauth'
|
3
|
-
require 'multi_json'
|
4
|
-
|
5
|
-
|
6
|
-
# Omniauth strategy for using oauth2 and force.com
|
7
|
-
# Author: vzmind@gmail.com
|
8
|
-
#
|
9
|
-
module OmniAuth
|
10
|
-
module Strategies
|
11
|
-
class Forcedotcom < OAuth2
|
12
|
-
# Initialize the middleware
|
13
|
-
#
|
14
|
-
def initialize(app, client_id = nil, client_secret = nil, options = {}, &block)
|
15
|
-
client_options = {
|
16
|
-
:site => "https://login.salesforce.com",
|
17
|
-
:authorize_path => "/services/oauth2/authorize",
|
18
|
-
:access_token_path => "/services/oauth2/token"
|
19
|
-
}
|
20
|
-
super(app, :forcedotcom, client_id, client_secret, client_options, &block)
|
21
|
-
end
|
22
|
-
|
23
|
-
def request_phase
|
24
|
-
options[:response_type] ||= 'code'
|
25
|
-
super
|
26
|
-
end
|
27
|
-
|
28
|
-
def callback_phase
|
29
|
-
options[:grant_type] ||= 'authorization_code'
|
30
|
-
super
|
31
|
-
end
|
32
|
-
|
33
|
-
def auth_hash
|
34
|
-
OmniAuth::Utils.deep_merge(super, {
|
35
|
-
'instance_url' => @access_token['instance_url']
|
36
|
-
})
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|