civicrm 1.3.6 → 1.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -0
- data/VERSION +1 -1
- data/civicrm.gemspec +1 -0
- data/lib/civicrm.rb +2 -1
- data/lib/civicrm/client.rb +6 -4
- data/lib/civicrm/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8368cd231e0941132210ff8bf11724816e59242958ac47d458eddb512b93aad4
|
4
|
+
data.tar.gz: 8df3d8a938b2b722c8329f2464bcb42b0e153464e1914fc21bc14721c340b707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af3a1b5c342f2d22c3da940c958c2e0e926a1097b93b5bf32da901eba25881a066ab65732fab32c77a916eae6b7ec27d49f608f01c9f102f56451a4115a8707d
|
7
|
+
data.tar.gz: 71a5213a6e9fcc38c01310b2b9a06987284bb902512c2426113df859e24947d3a038ccdfb598e976b876a7218a40e0697829b177747d7b787ed0697dc4ebb786
|
data/README.md
CHANGED
@@ -13,6 +13,9 @@ $ gem install civicrm
|
|
13
13
|
CiviCrm.api_base = "https://www.example.org/path/to/civi/codebase/"
|
14
14
|
CiviCrm.site_key = "YOUR_SITE_KEY"
|
15
15
|
CiviCrm.api_key = "..."
|
16
|
+
|
17
|
+
# Optional config
|
18
|
+
CiviCrm.timeout = 60 # Change request timeout in seconds (nil to disable)
|
16
19
|
```
|
17
20
|
|
18
21
|
## CiviCrm Objects
|
@@ -34,6 +37,27 @@ CiviCrm::Contact.find(1).delete
|
|
34
37
|
$ bundle exec rspec spec
|
35
38
|
```
|
36
39
|
|
40
|
+
## Debugging
|
41
|
+
|
42
|
+
Set these `ENV` options to a truthy value to print CiviCRM REST API data.
|
43
|
+
|
44
|
+
```DEBUG_CIVICRM_REQUEST```
|
45
|
+
|
46
|
+
Example:
|
47
|
+
|
48
|
+
```
|
49
|
+
[CiviCRM] [REQ] [FinancialType] [get] {"method":"post","timeout":null,"headers":{"user_agent":"CiviCrm RubyClient/1.3.6","request_id":"8168cbfc-36d1-4967-bf94-8fd72fd48455"},"payload":{"json":"{\"id\":12}"},"url":"..."}
|
50
|
+
```
|
51
|
+
|
52
|
+
```DEBUG_CIVICRM_RESPONSE```
|
53
|
+
|
54
|
+
Example:
|
55
|
+
|
56
|
+
```
|
57
|
+
[CiviCRM] [RES] [FinancialType] [get] {"is_error":0,"version":3,"count":1,"id":12,"values":{"12":{"id":"12","name":"Matching Gift","is_deductible":"0","is_active":"1"}}}
|
58
|
+
```
|
59
|
+
|
60
|
+
|
37
61
|
## Useful links
|
38
62
|
|
39
63
|
* https://docs.civicrm.org/dev/en/latest/api/interfaces/#rest-interface
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.7
|
data/civicrm.gemspec
CHANGED
data/lib/civicrm.rb
CHANGED
@@ -35,8 +35,9 @@ module CiviCrm
|
|
35
35
|
@@site_key = nil
|
36
36
|
@@api_base = 'https://www.example.org/path/to/civi/codebase'
|
37
37
|
@@api_version = 'v3'
|
38
|
+
@@timeout = 80
|
38
39
|
|
39
|
-
mattr_accessor :api_key, :api_base, :api_version, :site_key
|
40
|
+
mattr_accessor :api_key, :api_base, :api_version, :site_key, :timeout
|
40
41
|
|
41
42
|
def self.api_url(path = '')
|
42
43
|
base = "#{api_base}/civicrm/extern/rest.php?#{path}"
|
data/lib/civicrm/client.rb
CHANGED
@@ -10,12 +10,13 @@ module CiviCrm
|
|
10
10
|
end
|
11
11
|
|
12
12
|
headers = {
|
13
|
-
:user_agent => "CiviCrm RubyClient/#{CiviCrm::VERSION}"
|
13
|
+
:user_agent => "CiviCrm RubyClient/#{CiviCrm::VERSION}",
|
14
|
+
:request_id => SecureRandom.uuid
|
14
15
|
}
|
15
16
|
|
16
17
|
opts = {
|
17
18
|
:method => :post,
|
18
|
-
:timeout =>
|
19
|
+
:timeout => CiviCrm.timeout,
|
19
20
|
:headers => headers
|
20
21
|
}
|
21
22
|
|
@@ -34,12 +35,13 @@ module CiviCrm
|
|
34
35
|
|
35
36
|
response = nil
|
36
37
|
|
38
|
+
puts("[CiviCRM] [REQ] [#{entity}] [#{action}] #{JSON.dump(opts)}") if ENV["DEBUG_CIVICRM_REQUEST"]
|
39
|
+
|
37
40
|
CiviCrm.time(params['entity'], params['action']) do
|
38
41
|
response = execute(opts)
|
39
42
|
end
|
40
43
|
|
41
|
-
puts(
|
42
|
-
puts(response) if ENV["DEBUG_CIVICRM_RESPONSE"]
|
44
|
+
puts("[CiviCRM] [RES] [#{entity}] [#{action}] #{response}") if ENV["DEBUG_CIVICRM_RESPONSE"]
|
43
45
|
|
44
46
|
body, code = response.body, response.code
|
45
47
|
|
data/lib/civicrm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: civicrm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iskander Haziev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -160,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
160
|
requirements:
|
161
161
|
- - ">="
|
162
162
|
- !ruby/object:Gem::Version
|
163
|
-
version: '0'
|
163
|
+
version: '2.0'
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
requirements:
|
166
166
|
- - ">="
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
170
|
rubyforge_project:
|
171
|
-
rubygems_version: 2.7.
|
171
|
+
rubygems_version: 2.7.11
|
172
172
|
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: Ruby bindings for the CiviCRM API
|