vinyldns-ruby 0.8.1 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fea355780ee7ab55c1337a3e4535594277c8aa110a33f8c8a987a387e565e6f
4
- data.tar.gz: b4dae93a5333284838208a6af657223861ebce58954f4b6765cc418b927778f3
3
+ metadata.gz: 016b62375f76a7f10ec7ef045a4c05bc310dd278812b2890a12c63bbc0abd9c9
4
+ data.tar.gz: 93abcb7cf60c1b7bc97afffd2fd7f5d10811afefdfad3b09e8b246f2996deb70
5
5
  SHA512:
6
- metadata.gz: f0d2c26747c776ff20307cbb7079dc058a694deec582ee29b52df330fc82e72de100b7f9c876f3fc40a8544afadc0188d2bafcacd72c7fd3216383f8b322cdec
7
- data.tar.gz: 64c1b77c83ce367e64da7f66fb6feb62c94d588ffd0e40b0484a42481473145559d40ec75a5fda20caf06d05f416cb292e08d190cc8a292108c2ec7fedbd85fc
6
+ metadata.gz: e7647e8e9178a75b30b0933ecc09501746d435d034ae30f5418329ba30f8d3b9afdcd73161233c3e06369ca453c4e3d3b10d9f7f75078cc9cc9097d30eeea1aa
7
+ data.tar.gz: 2a53e6d56da7d002f6cacde261a05df58e7fb039bb5d4c115f865aab7acbbbccfdf77a42dc764988d023008152cac6cd8f3e48040c3243eb5fcedbe09827eb53
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Travis build](https://api.travis-ci.org/vinyldns/vinyldns-ruby.svg?branch=master)](https://travis-ci.org/vinyldns/vinyldns-ruby)
2
+
1
3
  # VinylDNS-Ruby
2
4
 
3
5
  Ruby gem for working with VinylDNS.
@@ -9,6 +9,7 @@
9
9
  # limitations under the License.
10
10
  require 'vinyldns/version'
11
11
  require 'vinyldns/api'
12
+
12
13
  module Vinyldns
13
14
  raise('You must have ENV[\'VINYLDNS_ACCESS_KEY_ID\'] set to use vinyldns-ruby') unless ENV['VINYLDNS_ACCESS_KEY_ID']
14
15
  raise('You must have ENV[\'VINYLDNS_SECRET_ACCESS_KEY\'] set to use vinyldns-ruby') unless ENV['VINYLDNS_SECRET_ACCESS_KEY']
@@ -7,8 +7,8 @@
7
7
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8
8
  # See the License for the specific language governing permissions and
9
9
  # limitations under the License.
10
- require 'vinyldns/api/zone/zone'
11
- require 'vinyldns/api/group/group'
10
+ require_relative 'api/zone/zone'
11
+ require_relative 'api/group/group'
12
12
  require 'net/http'
13
13
  require 'openssl'
14
14
  require 'json'
@@ -26,7 +26,7 @@ module Vinyldns
26
26
  @region = region
27
27
  if @method == 'GET'
28
28
  @content_type = content_type
29
- elsif @method == 'POST' || @method == 'PUT'
29
+ elsif @method == 'POST' || @method == 'PUT' || @method == 'DELETE'
30
30
  @content_type = 'application/json'
31
31
  end
32
32
  # Generate a signed header for our HTTP requests
@@ -61,9 +61,11 @@ module Vinyldns
61
61
  request = Net::HTTP::Post.new(uri == '/' ? uri : "/#{uri}") if signed_object.method == 'POST'
62
62
  request = Net::HTTP::Put.new(uri == '/' ? uri : "/#{uri}") if signed_object.method == 'PUT'
63
63
  request = Net::HTTP::Get.new(uri == '/' ? uri : "/#{uri}") if signed_object.method == 'GET'
64
+ request = Net::HTTP::Delete.new(uri == '/' ? uri : "/#{uri}") if signed_object.method == 'DELETE'
64
65
  signed_headers.headers.each { |k, v| request[k] = v }
65
66
  request['content-type'] = signed_object.content_type
66
67
  request.body = body == '' ? body : body.to_json
68
+
67
69
  response = https.request(request)
68
70
  case response
69
71
  when Net::HTTPSuccess
@@ -0,0 +1,18 @@
1
+ # Copyright 2018 Comcast Cable Communications Management, LLC
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
5
+ # Unless required by applicable law or agreed to in writing, software
6
+ # distributed under the License is distributed on an "AS IS" BASIS,
7
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8
+ # See the License for the specific language governing permissions and
9
+ # limitations under the License.
10
+ require_relative '../api/zone/zone'
11
+
12
+ module Vinyldns
13
+ class Util
14
+ def self.clean_request_payload(payload)
15
+ payload.delete_if { |k,v| v.to_s.empty? }
16
+ end
17
+ end
18
+ end
@@ -8,5 +8,5 @@
8
8
  # See the License for the specific language governing permissions and
9
9
  # limitations under the License.
10
10
  module Vinyldns
11
- VERSION = '0.8.1'.freeze
11
+ VERSION = '0.9.0'.freeze
12
12
  end
@@ -39,6 +39,8 @@ Gem::Specification.new do |gem|
39
39
  gem.add_development_dependency 'bundler', '~> 1.13'
40
40
  gem.add_development_dependency 'rake', '~> 12.0'
41
41
  gem.add_development_dependency 'rspec', '3.7.0'
42
+ gem.add_development_dependency 'rb-readline', '~> 0.5.5'
43
+ gem.add_development_dependency 'pry', '~> 0.10.3'
42
44
  # Dependencies
43
45
  # Licensed uses the the libgit2 bindings for Ruby provided by rugged. rugged has its own dependencies - cmake and pkg-config - which you may need to install before you can install Licensed.
44
46
  # For example, on macOS with Homebrew: brew install cmake pkg-config and on Ubuntu: apt-get install cmake pkg-config.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vinyldns-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Pierce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-09 00:00:00.000000000 Z
11
+ date: 2019-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sigv4
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 3.7.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: rb-readline
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.5.5
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.5.5
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.10.3
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.10.3
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: licensed
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -107,6 +135,7 @@ files:
107
135
  - lib/vinyldns/api.rb
108
136
  - lib/vinyldns/api/group/group.rb
109
137
  - lib/vinyldns/api/zone/zone.rb
138
+ - lib/vinyldns/util/util.rb
110
139
  - lib/vinyldns/version.rb
111
140
  - scripts/run_tests
112
141
  - scripts/start_api
@@ -131,7 +160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
160
  - !ruby/object:Gem::Version
132
161
  version: '0'
133
162
  requirements: []
134
- rubygems_version: 3.0.1
163
+ rubyforge_project:
164
+ rubygems_version: 2.7.8
135
165
  signing_key:
136
166
  specification_version: 4
137
167
  summary: Ruby gem for VinylDNS