hotdogprincess 0.2.2 → 0.3.0
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 +4 -4
- data/README.md +8 -1
- data/hotdogprincess.gemspec +1 -0
- data/lib/hotdogprincess/client/customers.rb +2 -0
- data/lib/hotdogprincess/client/tickets.rb +2 -0
- data/lib/hotdogprincess/client.rb +21 -4
- data/lib/hotdogprincess/core_extensions/hash.rb +23 -0
- data/lib/hotdogprincess/core_extensions.rb +1 -0
- data/lib/hotdogprincess/error.rb +9 -0
- data/lib/hotdogprincess/version.rb +1 -1
- data/lib/hotdogprincess.rb +1 -0
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5098121aaf05769fa7d92fe52495805f1466010
|
4
|
+
data.tar.gz: 4b6e03266eac8930d581ebd20d2c61f6f0e5230b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b1cc8fea3b22a94352c0b059cf1accefe3214753713547925adec344bfd3be75c36ebe99da179479bd96b492521c992b8e1619ec386dec77123b2624051d4ea
|
7
|
+
data.tar.gz: 13a5d57a85f5494ee136ddd9e69712613350ae4a3ea435d33e8eadda9cc187238d8311f62261a442b21f2941bdc36c04107de5195594c563fe90e112dc699663
|
data/README.md
CHANGED
@@ -6,7 +6,10 @@ _-- "Their message says, Baby... Us... Trouble... Time."_
|
|
6
6
|
|
7
7
|
Integrate with the [Parature](http://www.parature.com/) API. It's gunna be so flippin' awesome!
|
8
8
|
|
9
|
-
|
9
|
+
## Current Modules Supported
|
10
|
+
- Customers
|
11
|
+
- SLAs
|
12
|
+
- Tickets
|
10
13
|
|
11
14
|
## Installation
|
12
15
|
|
@@ -312,6 +315,10 @@ client.get 'Customer', "First_Name_like_" => "joe"
|
|
312
315
|
=> {"?xml"=>{"@version"=>"1.0", "@encoding"=>"utf-8"}...
|
313
316
|
```
|
314
317
|
|
318
|
+
## Notes
|
319
|
+
|
320
|
+
- Nil values are stripped from hashes to be used, Parature does not accept the `xsi:nil` values.
|
321
|
+
|
315
322
|
## Contributing
|
316
323
|
|
317
324
|
1. Fork it
|
data/hotdogprincess.gemspec
CHANGED
@@ -3,6 +3,7 @@ require "hotdogprincess/version"
|
|
3
3
|
require "hotdogprincess/client/customers"
|
4
4
|
require "hotdogprincess/client/tickets"
|
5
5
|
require "hotdogprincess/client/slas"
|
6
|
+
require 'hotdogprincess/error'
|
6
7
|
|
7
8
|
module HotDogPrincess
|
8
9
|
|
@@ -26,7 +27,11 @@ module HotDogPrincess
|
|
26
27
|
_output_: @output_format,
|
27
28
|
_token_: @token
|
28
29
|
}.merge(options)
|
29
|
-
|
30
|
+
begin
|
31
|
+
@last_response = RestClient.get url, { params: options }
|
32
|
+
rescue => e
|
33
|
+
raise HotDogPrincess::Error.new(e.response, self)
|
34
|
+
end
|
30
35
|
clean_response @last_response
|
31
36
|
end
|
32
37
|
|
@@ -35,7 +40,11 @@ module HotDogPrincess
|
|
35
40
|
options = {
|
36
41
|
content_type: :xml
|
37
42
|
}.merge(options)
|
38
|
-
|
43
|
+
begin
|
44
|
+
@last_response = RestClient.post url, body, options
|
45
|
+
rescue => e
|
46
|
+
raise HotDogPrincess::Error.new(e.response, self)
|
47
|
+
end
|
39
48
|
@last_response
|
40
49
|
end
|
41
50
|
|
@@ -44,7 +53,11 @@ module HotDogPrincess
|
|
44
53
|
options = {
|
45
54
|
content_type: :xml
|
46
55
|
}.merge(options)
|
47
|
-
|
56
|
+
begin
|
57
|
+
@last_response = RestClient.put url, body, options
|
58
|
+
rescue => e
|
59
|
+
raise HotDogPrincess::Error.new(e.response, self)
|
60
|
+
end
|
48
61
|
@last_response
|
49
62
|
end
|
50
63
|
|
@@ -54,7 +67,11 @@ module HotDogPrincess
|
|
54
67
|
_output_: @output_format,
|
55
68
|
_token_: @token
|
56
69
|
}.merge(options)
|
57
|
-
|
70
|
+
begin
|
71
|
+
@last_response = RestClient.delete url, { params: options }
|
72
|
+
rescue => e
|
73
|
+
raise HotDogPrincess::Error.new(e.response, self)
|
74
|
+
end
|
58
75
|
@last_response
|
59
76
|
end
|
60
77
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module HotDogPrincess
|
2
|
+
class CoreExtensions
|
3
|
+
module Hash
|
4
|
+
|
5
|
+
def compact
|
6
|
+
# inject({}) do |new_hash, (k, v)|
|
7
|
+
# if !v.nil?
|
8
|
+
# new_hash[k] = v.class == Hash ? v.compact : v
|
9
|
+
# end
|
10
|
+
# new_hash
|
11
|
+
# end
|
12
|
+
delete_if { |k, v|
|
13
|
+
(v.is_a?(Hash) and v.respond_to?('empty?') and v.compact.empty?) or (v.nil?)
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class Hash
|
22
|
+
include HotDogPrincess::CoreExtensions::Hash
|
23
|
+
end
|
data/lib/hotdogprincess.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotdogprincess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Callis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rest-client
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: Integrate with the Parature API.
|
56
70
|
email:
|
57
71
|
- matthew.callis@gmail.com
|
@@ -69,7 +83,9 @@ files:
|
|
69
83
|
- lib/hotdogprincess/client/slas.rb
|
70
84
|
- lib/hotdogprincess/client/tickets.rb
|
71
85
|
- lib/hotdogprincess/core_extensions.rb
|
86
|
+
- lib/hotdogprincess/core_extensions/hash.rb
|
72
87
|
- lib/hotdogprincess/core_extensions/string.rb
|
88
|
+
- lib/hotdogprincess/error.rb
|
73
89
|
- lib/hotdogprincess/version.rb
|
74
90
|
homepage: https://github.com/MatthewCallis/hotdogprincess
|
75
91
|
licenses:
|
@@ -91,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
107
|
version: 1.3.5
|
92
108
|
requirements: []
|
93
109
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.4.
|
110
|
+
rubygems_version: 2.4.2
|
95
111
|
signing_key:
|
96
112
|
specification_version: 4
|
97
113
|
summary: Integrate with the Parature API. It's gunna be so flippin' awesome!
|