civicrm 1.0.2 → 1.0.4

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: 608968f5678017833a98105dbd51d3da51c98f8a
4
- data.tar.gz: 4993a15314c5d0be867f60baad7d20f32b595029
3
+ metadata.gz: 143b0aefa1019de0e853e547d89fbaf371fab98c
4
+ data.tar.gz: df819c01e2da40b91474212f2d6ba5a2b4519268
5
5
  SHA512:
6
- metadata.gz: ddea2392172c99b6141bd0ac5a68c0d8cfc0dc878193022c8467ef5d41266b7eb4518e2798e7d81fda2543aa31a49c13a484a0ae0cd356e7322a8add3cb2f3a4
7
- data.tar.gz: e54c3ee7263b88bfcf975b8a22862a6d851684fa34014e31d0aa7a9c5537bae2d40feeb5608d1229eeef1c7b5c35b0ae3c786a10d4b49c1a018f64fc0685db85
6
+ metadata.gz: 8531df4d6d31486fba83848a8578c6025c81248d66eaf4409021fef2e26550d051c7687701a440d86b5571451271cedd85d75662647a541fb19460dce565696e
7
+ data.tar.gz: ffec48ab95b8f5cc0ba5dc2d1584a317e9ff151a37ee8a0401e6d61c978e54b579fdfa9fd995d825c4c6f0e49ee67bcda8a79a84943ef9b0e375060d6506e4ff
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- civicrm (1.0.1)
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 (3.2.13)
14
- activesupport (= 3.2.13)
15
- builder (~> 3.0.0)
16
- activesupport (3.2.13)
17
- i18n (= 0.6.1)
18
- multi_json (~> 1.0)
19
- builder (3.0.4)
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
- i18n (0.6.1)
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 (1.22)
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
- multi_json (1.7.2)
27
- nokogiri (1.5.9)
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.6.7)
30
- mime-types (>= 1.16)
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
@@ -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
- libs << " -r #{File.dirname(__FILE__) + '/../lib/civicrm'}"
4
+ libs = " -r irb/completion -rcivicrm"
5
+
6
6
  puts "Loading CiviCrm gem"
7
+ ENV["RUBYLIB"] = 'lib'
7
8
  exec "#{irb} #{libs} --simple-prompt"
@@ -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' => 'getsingle', 'id' => id}
6
+ params = {'entity' => entity_class_name, 'action' => 'get', 'id' => id}
7
7
  response = CiviCrm::Client.request(:get, params)
8
8
 
9
- if response.first.nil?
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
 
@@ -1,4 +1,5 @@
1
- require 'active_model/dirty'
1
+ require 'active_model'
2
+
2
3
  module CiviCrm
3
4
  class Resource
4
5
  include ActiveModel::Dirty
@@ -1,3 +1,3 @@
1
1
  module CiviCrm
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.4'
3
3
  end
@@ -2,7 +2,12 @@ module CiviCrm
2
2
  class XML
3
3
  class << self
4
4
  def parse(text)
5
- doc = Nokogiri::XML.parse(text.to_s.gsub("\n", ''))
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.2
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-06-11 00:00:00.000000000 Z
11
+ date: 2018-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client