salesforceapi-rest 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/salesforceapi-rest/errors.rb +1 -1
- data/lib/salesforceapi-rest/version.rb +1 -1
- data/lib/salesforceapi-rest.rb +6 -3
- metadata +117 -112
data/lib/salesforceapi-rest.rb
CHANGED
@@ -108,7 +108,7 @@ module Salesforceapi
|
|
108
108
|
end
|
109
109
|
|
110
110
|
|
111
|
-
def add_custom_field(attributes)
|
111
|
+
def add_custom_field(attributes, update = false)
|
112
112
|
config_authorization!
|
113
113
|
auth_header = {
|
114
114
|
"Authorization" => "OAuth " + @access_token,
|
@@ -120,8 +120,11 @@ module Salesforceapi
|
|
120
120
|
self.class.base_uri @metadata_uri
|
121
121
|
|
122
122
|
data = (Envelope % [@access_token, custom_fields_xml(attributes)])
|
123
|
-
|
124
|
-
|
123
|
+
if update
|
124
|
+
resp = SalesforceApi::Request.do_request("POST", @metadata_uri, auth_header, data.lstrip)
|
125
|
+
else
|
126
|
+
resp = SalesforceApi::Request.do_request("PUT", @metadata_uri, auth_header, data.lstrip)
|
127
|
+
end
|
125
128
|
xml_response = Crack::XML.parse(resp.body)
|
126
129
|
|
127
130
|
if resp.code != 200
|
metadata
CHANGED
@@ -1,161 +1,166 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: salesforceapi-rest
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Lucas Allan Amorim
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2012-07-23 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: rspec
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :development
|
23
22
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: rforce
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
33
24
|
none: false
|
34
|
-
requirements:
|
35
|
-
- -
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
38
32
|
type: :development
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: rforce
|
39
36
|
prerelease: false
|
40
|
-
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
38
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
54
46
|
type: :development
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: omniauth
|
55
50
|
prerelease: false
|
56
|
-
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
52
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
70
60
|
type: :development
|
61
|
+
version_requirements: *id003
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: httparty
|
71
64
|
prerelease: false
|
72
|
-
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
66
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ! '>='
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
86
74
|
type: :development
|
75
|
+
version_requirements: *id004
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: activeresource
|
87
78
|
prerelease: false
|
88
|
-
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ! '>='
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: crack
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
97
80
|
none: false
|
98
|
-
requirements:
|
99
|
-
- -
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 3
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
version: "0"
|
102
88
|
type: :development
|
89
|
+
version_requirements: *id005
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: crack
|
103
92
|
prerelease: false
|
104
|
-
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: builder
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
113
94
|
none: false
|
114
|
-
requirements:
|
115
|
-
- -
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
hash: 3
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
version: "0"
|
118
102
|
type: :development
|
103
|
+
version_requirements: *id006
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: builder
|
119
106
|
prerelease: false
|
120
|
-
|
107
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
121
108
|
none: false
|
122
|
-
requirements:
|
123
|
-
- -
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
113
|
+
segments:
|
114
|
+
- 0
|
115
|
+
version: "0"
|
116
|
+
type: :development
|
117
|
+
version_requirements: *id007
|
126
118
|
description: Ruby wrapper to access salesforce rest api
|
127
|
-
email:
|
119
|
+
email:
|
128
120
|
- lucas.allan@gmail.com
|
129
121
|
executables: []
|
122
|
+
|
130
123
|
extensions: []
|
124
|
+
|
131
125
|
extra_rdoc_files: []
|
132
|
-
|
126
|
+
|
127
|
+
files:
|
133
128
|
- lib/salesforceapi-rest/errors.rb
|
134
129
|
- lib/salesforceapi-rest/request.rb
|
135
130
|
- lib/salesforceapi-rest/version.rb
|
136
131
|
- lib/salesforceapi-rest.rb
|
137
|
-
homepage:
|
132
|
+
homepage: ""
|
138
133
|
licenses: []
|
134
|
+
|
139
135
|
post_install_message:
|
140
136
|
rdoc_options: []
|
141
|
-
|
137
|
+
|
138
|
+
require_paths:
|
142
139
|
- lib
|
143
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
144
141
|
none: false
|
145
|
-
requirements:
|
146
|
-
- -
|
147
|
-
- !ruby/object:Gem::Version
|
148
|
-
|
149
|
-
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
hash: 3
|
146
|
+
segments:
|
147
|
+
- 0
|
148
|
+
version: "0"
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
|
-
requirements:
|
152
|
-
- -
|
153
|
-
- !ruby/object:Gem::Version
|
154
|
-
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
hash: 3
|
155
|
+
segments:
|
156
|
+
- 0
|
157
|
+
version: "0"
|
155
158
|
requirements: []
|
159
|
+
|
156
160
|
rubyforge_project:
|
157
|
-
rubygems_version: 1.8.
|
161
|
+
rubygems_version: 1.8.24
|
158
162
|
signing_key:
|
159
163
|
specification_version: 3
|
160
164
|
summary: Ruby wrapper to access salesforce rest api
|
161
165
|
test_files: []
|
166
|
+
|