paspartout-api 0.1.0 → 0.1.1

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDQ0YjJjOTUwZjE4MGNjZDc2OGI1YTc3OTNjZTZkMDM3YWMwOWYzYQ==
4
+ MmU0MTU1YjI4OTg2OWVhNDcxNWFlNjBmNjRjMTcwMzE2ZmE4YjVmMA==
5
5
  data.tar.gz: !binary |-
6
- YWYyMjAwZjFkYmZhMTI3OGJkNTZlMzg0M2ZlYWNiZmI3YmE3NDcwNw==
6
+ OTc0OGI4ODliZjI4MDk3NTJhMWQ4MTAyMmI3MzAxNzZjYzhlOWRmYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDJkMDk2ODYzNzY4NmI5ZjA4MDQ5MDEwYTkzNGU3ZTBjZWEzM2Q4ZjAyMTRm
10
- ZTRmZTJkZDliMmNkNzNmOTIyYzk3ZDBjZTYwMzRhYTEyMTE0OTllZWUzZmM3
11
- NGMzZjUxOTdjN2ZlZDY1NmI4ZWZkMDMzOWU5NmI2Y2E2NDhmNmM=
9
+ YzE1MmU0NmJkMTg4NDM3NGVlN2ZhZjVmZjM4ZmMxYzM5NmRkMDljN2Q2NzQy
10
+ NzRmNzlmNGQ3MGEzMzA1YmE5YTFiODhkNTY5MmMwZTJhZGEzY2ZkZDU4M2Ni
11
+ NzhkN2VkMjVmODUzZDRlYWYxYWI4ZDNmNThhZjU0MTNmMDNmMjM=
12
12
  data.tar.gz: !binary |-
13
- ZGY0YWUwYzYyOTNkMjgzNDMxNWM0NzYyNWE3MDE4ZTQzZWE0MjAzNjhmMjk4
14
- MjFlNjFiYTJkNDY5NTBhYWI1ZTg3YjM4ZmYyOWI0Y2FiNTRkNWM0NzUwOWU0
15
- ZDJkYzUwMjhiNWI5MzJmMGFkZTlkM2Y0NmZjMzI3OGZhYTMyNmU=
13
+ NTQyNGM1MmRkY2I2MzViMTIwM2FlZWY0Yzc4Y2ZmMjEwZjQ0N2U1NDFiNzIx
14
+ ODkwNDU1ZDczOTViMzkwNjlkMmFjNTkwYWVmNWFlOGUwNDFlOGIwNGUwNjFk
15
+ NjNhNGIzNGRjZjI5ZDBhYjdjNGViYjNkZDYwNjMxZmJhM2I4ODc=
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
+ gem 'htmlentities', '~> 4.3.1'
3
4
  gem 'httparty', '~> 0.12.0'
4
5
  gem 'hashie', '~> 2.0.5'
5
6
 
@@ -17,6 +17,7 @@ GEM
17
17
  oauth2
18
18
  hashie (2.0.5)
19
19
  highline (1.6.20)
20
+ htmlentities (4.3.1)
20
21
  httparty (0.12.0)
21
22
  json (~> 1.8)
22
23
  multi_xml (>= 0.5.2)
@@ -68,6 +69,7 @@ PLATFORMS
68
69
  DEPENDENCIES
69
70
  bundler (~> 1.0)
70
71
  hashie (~> 2.0.5)
72
+ htmlentities (~> 4.3.1)
71
73
  httparty (~> 0.12.0)
72
74
  jeweler (~> 1.8.7)
73
75
  rdoc (~> 3.12)
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ Jeweler::Tasks.new do |gem|
19
19
  gem.license = "MIT"
20
20
  gem.summary = %Q{An abstraction layer for the Paspartout API}
21
21
  gem.description = %Q{An abstraction layer for the Paspartout API}
22
- gem.email = "wout@impinc.co.uk"
22
+ gem.email = "wout@woutfierens.com"
23
23
  gem.authors = ["wout"]
24
24
  # dependencies defined in Gemfile
25
25
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,3 +1,4 @@
1
+ require 'htmlentities'
1
2
  require 'httparty'
2
3
  require 'hashie'
3
4
 
@@ -57,6 +58,10 @@ private
57
58
 
58
59
  request = HTTParty.get("http://api.paspartout.com/public/v2/#{ @api_key }#{ path }.json")
59
60
  result = Hashie::Mash.new({ body: JSON.parse(request.body) })
61
+
62
+ if ''.respond_to?(:html_safe)
63
+ result = make_html_safe(result)
64
+ end
60
65
 
61
66
  if result.error
62
67
  @errors.push(result.error)
@@ -67,4 +72,22 @@ private
67
72
  end
68
73
  end
69
74
 
75
+ def make_html_safe value
76
+ case value.class.to_s
77
+ when 'String'
78
+ value = HTMLEntities.new.decode(value).html_safe
79
+ when 'Array'
80
+ value.each.with_index do |v, i|
81
+ value[i] = make_html_safe(v)
82
+ end
83
+ when 'Hash'
84
+ when 'Hashie::Mash'
85
+ value.each_pair do |k, v|
86
+ value[k] = make_html_safe(v)
87
+ end
88
+ end
89
+
90
+ value
91
+ end
92
+
70
93
  end
@@ -0,0 +1,72 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: paspartout-api 0.1.1 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "paspartout-api"
9
+ s.version = "0.1.1"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.authors = ["wout"]
13
+ s.date = "2014-02-22"
14
+ s.description = "An abstraction layer for the Paspartout API"
15
+ s.email = "wout@woutfierens.com"
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE.txt",
25
+ "README.md",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "lib/paspartout-api.rb",
29
+ "paspartout-api.gemspec",
30
+ "spec/helper.rb",
31
+ "spec/paspartout-api_spec.rb"
32
+ ]
33
+ s.homepage = "http://github.com/wout/paspartout-api"
34
+ s.licenses = ["MIT"]
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = "2.1.9"
37
+ s.summary = "An abstraction layer for the Paspartout API"
38
+
39
+ if s.respond_to? :specification_version then
40
+ s.specification_version = 4
41
+
42
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
43
+ s.add_runtime_dependency(%q<htmlentities>, ["~> 4.3.1"])
44
+ s.add_runtime_dependency(%q<httparty>, ["~> 0.12.0"])
45
+ s.add_runtime_dependency(%q<hashie>, ["~> 2.0.5"])
46
+ s.add_development_dependency(%q<rspec>, ["~> 2.14.1"])
47
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
48
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
49
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.7"])
50
+ s.add_development_dependency(%q<simplecov>, ["~> 0.8.2"])
51
+ else
52
+ s.add_dependency(%q<htmlentities>, ["~> 4.3.1"])
53
+ s.add_dependency(%q<httparty>, ["~> 0.12.0"])
54
+ s.add_dependency(%q<hashie>, ["~> 2.0.5"])
55
+ s.add_dependency(%q<rspec>, ["~> 2.14.1"])
56
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
57
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
58
+ s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
59
+ s.add_dependency(%q<simplecov>, ["~> 0.8.2"])
60
+ end
61
+ else
62
+ s.add_dependency(%q<htmlentities>, ["~> 4.3.1"])
63
+ s.add_dependency(%q<httparty>, ["~> 0.12.0"])
64
+ s.add_dependency(%q<hashie>, ["~> 2.0.5"])
65
+ s.add_dependency(%q<rspec>, ["~> 2.14.1"])
66
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
67
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
68
+ s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
69
+ s.add_dependency(%q<simplecov>, ["~> 0.8.2"])
70
+ end
71
+ end
72
+
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paspartout-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - wout
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-01 00:00:00.000000000 Z
11
+ date: 2014-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: htmlentities
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 4.3.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 4.3.1
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: httparty
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +123,7 @@ dependencies:
109
123
  - !ruby/object:Gem::Version
110
124
  version: 0.8.2
111
125
  description: An abstraction layer for the Paspartout API
112
- email: wout@impinc.co.uk
126
+ email: wout@woutfierens.com
113
127
  executables: []
114
128
  extensions: []
115
129
  extra_rdoc_files:
@@ -124,6 +138,7 @@ files:
124
138
  - Rakefile
125
139
  - VERSION
126
140
  - lib/paspartout-api.rb
141
+ - paspartout-api.gemspec
127
142
  - spec/helper.rb
128
143
  - spec/paspartout-api_spec.rb
129
144
  homepage: http://github.com/wout/paspartout-api