civicrm 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +34 -14
- data/bin/civicrm +3 -2
- data/lib/civicrm/actions/find.rb +2 -5
- data/lib/civicrm/resource.rb +2 -1
- data/lib/civicrm/version.rb +1 -1
- data/lib/civicrm/xml.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 143b0aefa1019de0e853e547d89fbaf371fab98c
|
4
|
+
data.tar.gz: df819c01e2da40b91474212f2d6ba5a2b4519268
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8531df4d6d31486fba83848a8578c6025c81248d66eaf4409021fef2e26550d051c7687701a440d86b5571451271cedd85d75662647a541fb19460dce565696e
|
7
|
+
data.tar.gz: ffec48ab95b8f5cc0ba5dc2d1584a317e9ff151a37ee8a0401e6d61c978e54b579fdfa9fd995d825c4c6f0e49ee67bcda8a79a84943ef9b0e375060d6506e4ff
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
civicrm (1.0.
|
4
|
+
civicrm (1.0.3)
|
5
5
|
activemodel
|
6
6
|
activesupport
|
7
7
|
nokogiri
|
@@ -10,24 +10,35 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activemodel (
|
14
|
-
activesupport (=
|
15
|
-
|
16
|
-
|
17
|
-
i18n (
|
18
|
-
|
19
|
-
|
13
|
+
activemodel (5.2.0)
|
14
|
+
activesupport (= 5.2.0)
|
15
|
+
activesupport (5.2.0)
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
+
i18n (>= 0.7, < 2)
|
18
|
+
minitest (~> 5.1)
|
19
|
+
tzinfo (~> 1.1)
|
20
|
+
concurrent-ruby (1.0.5)
|
20
21
|
diff-lcs (1.2.1)
|
21
|
-
|
22
|
+
domain_name (0.5.20180417)
|
23
|
+
unf (>= 0.0.5, < 1.0.0)
|
24
|
+
http-cookie (1.0.3)
|
25
|
+
domain_name (~> 0.5)
|
26
|
+
i18n (1.0.1)
|
27
|
+
concurrent-ruby (~> 1.0)
|
22
28
|
metaclass (0.0.1)
|
23
|
-
mime-types (
|
29
|
+
mime-types (2.99.3)
|
30
|
+
mini_portile2 (2.3.0)
|
31
|
+
minitest (5.11.3)
|
24
32
|
mocha (0.10.5)
|
25
33
|
metaclass (~> 0.0.1)
|
26
|
-
|
27
|
-
nokogiri (1.
|
34
|
+
netrc (0.11.0)
|
35
|
+
nokogiri (1.8.4)
|
36
|
+
mini_portile2 (~> 2.3.0)
|
28
37
|
rake (10.0.3)
|
29
|
-
rest-client (1.
|
30
|
-
|
38
|
+
rest-client (1.8.0)
|
39
|
+
http-cookie (>= 1.0.2, < 2.0)
|
40
|
+
mime-types (>= 1.16, < 3.0)
|
41
|
+
netrc (~> 0.7)
|
31
42
|
rspec (2.13.0)
|
32
43
|
rspec-core (~> 2.13.0)
|
33
44
|
rspec-expectations (~> 2.13.0)
|
@@ -36,6 +47,12 @@ GEM
|
|
36
47
|
rspec-expectations (2.13.0)
|
37
48
|
diff-lcs (>= 1.1.3, < 2.0)
|
38
49
|
rspec-mocks (2.13.0)
|
50
|
+
thread_safe (0.3.6)
|
51
|
+
tzinfo (1.2.5)
|
52
|
+
thread_safe (~> 0.1)
|
53
|
+
unf (0.1.4)
|
54
|
+
unf_ext
|
55
|
+
unf_ext (0.0.7.5)
|
39
56
|
|
40
57
|
PLATFORMS
|
41
58
|
ruby
|
@@ -45,3 +62,6 @@ DEPENDENCIES
|
|
45
62
|
mocha
|
46
63
|
rake
|
47
64
|
rspec
|
65
|
+
|
66
|
+
BUNDLED WITH
|
67
|
+
1.12.5
|
data/bin/civicrm
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
3
3
|
|
4
|
-
libs = " -r irb/completion"
|
5
|
-
|
4
|
+
libs = " -r irb/completion -rcivicrm"
|
5
|
+
|
6
6
|
puts "Loading CiviCrm gem"
|
7
|
+
ENV["RUBYLIB"] = 'lib'
|
7
8
|
exec "#{irb} #{libs} --simple-prompt"
|
data/lib/civicrm/actions/find.rb
CHANGED
@@ -3,14 +3,11 @@ module CiviCrm
|
|
3
3
|
module Find
|
4
4
|
module ClassMethods
|
5
5
|
def find(id)
|
6
|
-
params = {'entity' => entity_class_name, 'action' => '
|
6
|
+
params = {'entity' => entity_class_name, 'action' => 'get', 'id' => id}
|
7
7
|
response = CiviCrm::Client.request(:get, params)
|
8
8
|
|
9
|
-
|
9
|
+
Resource.build_from(response, params).first or
|
10
10
|
raise Error, "Couldn't find #{entity_class_name}##{id}"
|
11
|
-
end
|
12
|
-
|
13
|
-
Resource.build_from(response.first, params)
|
14
11
|
end
|
15
12
|
end
|
16
13
|
|
data/lib/civicrm/resource.rb
CHANGED
data/lib/civicrm/version.rb
CHANGED
data/lib/civicrm/xml.rb
CHANGED
@@ -2,7 +2,12 @@ module CiviCrm
|
|
2
2
|
class XML
|
3
3
|
class << self
|
4
4
|
def parse(text)
|
5
|
-
|
5
|
+
fixed_text = text.to_s.
|
6
|
+
gsub("\n", "").
|
7
|
+
gsub(/<\d+><\/\d+>/, "")
|
8
|
+
|
9
|
+
doc = Nokogiri::XML.parse(fixed_text)
|
10
|
+
|
6
11
|
results = doc.xpath('//Result')
|
7
12
|
results.map do |result|
|
8
13
|
hash = {}
|
@@ -30,4 +35,4 @@ module CiviCrm
|
|
30
35
|
end
|
31
36
|
end
|
32
37
|
end
|
33
|
-
end
|
38
|
+
end
|
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.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iskander Haziev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|