akamai_api 0.4.0 → 0.4.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 357ad26a6a5da39a595170949bbb7fb84226ce87
4
- data.tar.gz: 9c14d311812d842102696154f90c902c423d0bde
3
+ metadata.gz: eb09444b44c9dcc6d38ae14de3a5adcce70cae50
4
+ data.tar.gz: 485a448a35dad5ae5d44067346aa38ed481dc8de
5
5
  SHA512:
6
- metadata.gz: 3d384c9b6755b5e8c74c0cdb266f42a5575e54f83a3b693ccf6b9910c428ba5a40ac43b8f7f1c42fbfae43ed162707585bd8f1262f714e48e270b89a450d58c3
7
- data.tar.gz: c083205f44b3bf0019f8775c7557eeb176fd6f0cc5fdd306b704b7bbf7cf498a243cd23fd3f7afd3dd836930687484646f331cc508658aa6d04f8544cd79c403
6
+ metadata.gz: 0fa0004f9cd6adb99bd416924662bbf0ecc30e4878d717c4853b1c80014980ed54202af49a625b80d819d89518d476840212ba2f4b47dc69d91affb4417260f8
7
+ data.tar.gz: 706da63b0feb903d26c5db010ee7962d589618f68bfbfb43772c06288ab6b14693bc5d43fe6607cd1a7a88a33da66db1c2068c6368e73ab08e50ec06365eee81
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gemspec
6
6
  group :test do
7
7
  gem 'rspec', '>= 3.0.0'
8
8
  gem 'cucumber'
9
- gem 'aruba'
9
+ gem 'aruba', '= 0.5.4'
10
10
  gem 'webmock'
11
11
  gem 'vcr'
12
12
  gem 'coveralls'
@@ -20,6 +20,6 @@ Gem::Specification.new do |gem|
20
20
  gem.add_dependency 'httparty', '~> 0.13.1'
21
21
  gem.add_dependency 'activesupport', '>= 2.3.9', '< 5.0'
22
22
  gem.add_dependency 'thor', '>= 0.14.0', '< 2.0'
23
- gem.add_dependency 'savon', '~> 2.5.0'
23
+ gem.add_dependency 'savon', '~> 2.5'
24
24
  gem.add_dependency 'builder', '~> 3.0'
25
25
  end
@@ -45,7 +45,7 @@ module AkamaiApi::ECCU
45
45
  :version => :version_string
46
46
  }.each do |local_field, soap_field|
47
47
  define_method local_field do
48
- get_if_string(raw[soap_field])
48
+ get_if_handleable(raw[soap_field])
49
49
  end
50
50
  end
51
51
 
@@ -61,12 +61,12 @@ module AkamaiApi::ECCU
61
61
  # - :name [String] file name
62
62
  # - :md5 [String] MD5 digest of the file content
63
63
  def file
64
- content64 = get_if_string(raw[:contents])
64
+ content64 = get_if_handleable(raw[:contents])
65
65
  {
66
66
  :content => content64 ? Base64.decode64(content64) : nil,
67
67
  :size => raw[:file_size].to_i,
68
- :name => get_if_string(raw[:filename]),
69
- :md5 => get_if_string(raw[:md5_digest])
68
+ :name => get_if_handleable(raw[:filename]),
69
+ :md5 => get_if_handleable(raw[:md5_digest])
70
70
  }.reject { |k, v| v.nil? }
71
71
  end
72
72
 
@@ -78,10 +78,10 @@ module AkamaiApi::ECCU
78
78
  # - :updated_at [String] last time the status has been updated
79
79
  def status
80
80
  {
81
- :extended => get_if_string(raw[:extended_status_message]),
81
+ :extended => get_if_handleable(raw[:extended_status_message]),
82
82
  :code => raw[:status_code].to_i,
83
- :message => get_if_string(raw[:status_message]),
84
- :updated_at => get_if_string(raw[:status_update_date])
83
+ :message => get_if_handleable(raw[:status_message]),
84
+ :updated_at => get_if_handleable(raw[:status_update_date])
85
85
  }.reject { |k, v| v.nil? }
86
86
  end
87
87
 
@@ -92,9 +92,9 @@ module AkamaiApi::ECCU
92
92
  # - :type [String]
93
93
  def property
94
94
  {
95
- :name => get_if_string(raw[:property_name]),
95
+ :name => get_if_handleable(raw[:property_name]),
96
96
  :exact_match => (raw[:property_name_exact_match] == true),
97
- :type => get_if_string(raw[:property_type])
97
+ :type => get_if_handleable(raw[:property_type])
98
98
  }.reject { |k, v| v.nil? }
99
99
  end
100
100
 
@@ -103,8 +103,12 @@ module AkamaiApi::ECCU
103
103
  # This method is used because, for nil values, savon will respond with an hash containing all other attributes.
104
104
  # If we check that the expected type is matched, we can
105
105
  # prevent to retrieve wrong values
106
- def get_if_string value
107
- value.kind_of?(String) && value || nil
106
+ def get_if_handleable value
107
+ case value
108
+ when String then value
109
+ when DateTime then value.to_time.utc.xmlschema(3)
110
+ else nil
111
+ end
108
112
  end
109
113
  end
110
114
  end
@@ -1,3 +1,3 @@
1
1
  module AkamaiApi
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: akamai_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicola Racco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-12 00:00:00.000000000 Z
11
+ date: 2015-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -70,14 +70,14 @@ dependencies:
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: 2.5.0
73
+ version: '2.5'
74
74
  type: :runtime
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: 2.5.0
80
+ version: '2.5'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: builder
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -283,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
283
283
  version: '0'
284
284
  requirements: []
285
285
  rubyforge_project:
286
- rubygems_version: 2.4.6
286
+ rubygems_version: 2.4.7
287
287
  signing_key:
288
288
  specification_version: 4
289
289
  summary: Ruby toolkit to work with Akamai Content Control Utility API