google-cloud-dns 0.26.0 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: '00983f35aaeeb1bf7adb3773db346ea4c8f02c81'
4
- data.tar.gz: b195169daabe88e53e08e6b0e0d264e2ab5e8928
2
+ SHA256:
3
+ metadata.gz: 2902040425bfc9edf2d23b29871cf6e0ad1fef4d4cd21b8f202cf273ad468ffb
4
+ data.tar.gz: ac4997dccb8fbd1c7308e1cddedfdc6f86e17210356b9f2b2aaf0b2fc09a20d1
5
5
  SHA512:
6
- metadata.gz: ea30cc747ad5cc4d2218a1e0fc3d0ef4773aff5974228a5c53ae6f12589619621d49032e571e368b1bc17203f639ef9c52dda4b22184c18a847891f06640ea5a
7
- data.tar.gz: 83dabd1c3469268bf751df28d164e8c1b9f5d7ca741fef9d73f5f3d5858d655e2176bf212c34e3cf794dfdfd960883d2e3d16ad778b8e884f0870fe350099653
6
+ metadata.gz: 65e7eac5bfbc6bdcc5cc90f0c342b1d8c2a95fa8a2fb5b67a2c39eb1acf59ae4f0cf35db6a1d6290f5134d33515a091c1c9e759a03c4a3c46a193682855b4ba1
7
+ data.tar.gz: 26810cfcf5449c54b746aa780dca37193c706219de9a30fb37ba348fe3bade65b9cbd2772d24c026384ad53bc188f71890bc3a0bb95b370a436b2576748c33e0
@@ -13,9 +13,9 @@
13
13
  # limitations under the License.
14
14
 
15
15
  ##
16
- # This file is here to be autorequired by bundler, so that the .bigquery and
17
- # #bigquery methods can be available, but the library and all dependencies won't
18
- # be loaded until required and used.
16
+ # This file is here to be autorequired by bundler, so that the Google::Cloud.dns
17
+ # and Google::Cloud#dns methods can be available, but the library and all
18
+ # dependencies won't be loaded until required and used.
19
19
 
20
20
 
21
21
  gem "google-cloud-core"
@@ -74,10 +74,11 @@ module Google
74
74
  # For more information on connecting to Google Cloud see the [Authentication
75
75
  # Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/guides/authentication).
76
76
  #
77
- # @param [String] project Identifier for a DNS project. If not present, the
78
- # default project for the credentials is used.
79
- # @param [String, Hash] keyfile Keyfile downloaded from Google Cloud. If
80
- # file path the file must be readable.
77
+ # @param [String] project_id Identifier for a DNS project. If not present,
78
+ # the default project for the credentials is used.
79
+ # @param [String, Hash, Google::Auth::Credentials] credentials The path to
80
+ # the keyfile as a String, the contents of the keyfile as a Hash, or a
81
+ # Google::Auth::Credentials object. (See {Dns::Credentials})
81
82
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
82
83
  # set of resources and operations that the connection can access. See
83
84
  # [Using OAuth 2.0 to Access Google
@@ -95,15 +96,15 @@ module Google
95
96
  # @example
96
97
  # require "google/cloud"
97
98
  #
98
- # dns = Google::Cloud.dns "my-project-id", "/path/to/keyfile.json"
99
+ # dns = Google::Cloud.dns "my-project", "/path/to/keyfile.json"
99
100
  #
100
101
  # zone = dns.zone "example-com"
101
102
  #
102
- def self.dns project = nil, keyfile = nil, scope: nil, retries: nil,
103
+ def self.dns project_id = nil, credentials = nil, scope: nil, retries: nil,
103
104
  timeout: nil
104
105
  require "google/cloud/dns"
105
- Google::Cloud::Dns.new project: project, keyfile: keyfile, scope: scope,
106
- retries: retries, timeout: timeout
106
+ Google::Cloud::Dns.new project_id: project_id, credentials: credentials,
107
+ scope: scope, retries: retries, timeout: timeout
107
108
  end
108
109
  end
109
110
  end
@@ -278,10 +278,11 @@ module Google
278
278
  # [Authentication
279
279
  # Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/guides/authentication).
280
280
  #
281
- # @param [String] project Identifier for a DNS project. If not present,
281
+ # @param [String] project_id Identifier for a DNS project. If not present,
282
282
  # the default project for the credentials is used.
283
- # @param [String, Hash] keyfile Keyfile downloaded from Google Cloud. If
284
- # file path the file must be readable.
283
+ # @param [String, Hash, Google::Auth::Credentials] credentials The path to
284
+ # the keyfile as a String, the contents of the keyfile as a Hash, or a
285
+ # Google::Auth::Credentials object. (See {Dns::Credentials})
285
286
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling
286
287
  # the set of resources and operations that the connection can access.
287
288
  # See [Using OAuth 2.0 to Access Google
@@ -293,6 +294,9 @@ module Google
293
294
  # @param [Integer] retries Number of times to retry requests on server
294
295
  # error. The default value is `3`. Optional.
295
296
  # @param [Integer] timeout Default timeout to use in requests. Optional.
297
+ # @param [String] project Alias for the `project_id` argument. Deprecated.
298
+ # @param [String] keyfile Alias for the `credentials` argument.
299
+ # Deprecated.
296
300
  #
297
301
  # @return [Google::Cloud::Dns::Project]
298
302
  #
@@ -300,28 +304,26 @@ module Google
300
304
  # require "google/cloud/dns"
301
305
  #
302
306
  # dns = Google::Cloud::Dns.new(
303
- # project: "my-dns-project",
304
- # keyfile: "/path/to/keyfile.json"
307
+ # project_id: "my-dns-project",
308
+ # credentials: "/path/to/keyfile.json"
305
309
  # )
306
310
  #
307
311
  # zone = dns.zone "example-com"
308
312
  #
309
- def self.new project: nil, keyfile: nil, scope: nil, retries: nil,
310
- timeout: nil
311
- project ||= Google::Cloud::Dns::Project.default_project
312
- project = project.to_s # Always cast to a string
313
- fail ArgumentError, "project is missing" if project.empty?
313
+ def self.new project_id: nil, credentials: nil, scope: nil, retries: nil,
314
+ timeout: nil, project: nil, keyfile: nil
315
+ project_id ||= (project || Dns::Project.default_project_id)
316
+ project_id = project_id.to_s # Always cast to a string
317
+ fail ArgumentError, "project_id is missing" if project_id.empty?
314
318
 
315
- if keyfile.nil?
316
- credentials = Google::Cloud::Dns::Credentials.default scope: scope
317
- else
318
- credentials = Google::Cloud::Dns::Credentials.new(
319
- keyfile, scope: scope)
319
+ credentials ||= (keyfile || Dns::Credentials.default(scope: scope))
320
+ unless credentials.is_a? Google::Auth::Credentials
321
+ credentials = Dns::Credentials.new credentials, scope: scope
320
322
  end
321
323
 
322
- Google::Cloud::Dns::Project.new(
323
- Google::Cloud::Dns::Service.new(
324
- project, credentials, retries: retries, timeout: timeout))
324
+ Dns::Project.new(
325
+ Dns::Service.new(
326
+ project_id, credentials, retries: retries, timeout: timeout))
325
327
  end
326
328
  end
327
329
  end
@@ -13,18 +13,44 @@
13
13
  # limitations under the License.
14
14
 
15
15
 
16
- require "google/cloud/credentials"
16
+ require "googleauth"
17
17
 
18
18
  module Google
19
19
  module Cloud
20
20
  module Dns
21
21
  ##
22
- # @private Represents the Oauth2 signing logic for DNS.
23
- class Credentials < Google::Cloud::Credentials
22
+ # # Credentials
23
+ #
24
+ # Represents the authentication and authorization used to connect to the
25
+ # DNS API.
26
+ #
27
+ # @example
28
+ # require "google/cloud/dns"
29
+ #
30
+ # keyfile = "/path/to/keyfile.json"
31
+ # creds = Google::Cloud::Dns::Credentials.new keyfile
32
+ #
33
+ # dns = Google::Cloud::Dns.new(
34
+ # project_id: "my-project",
35
+ # credentials: creds
36
+ # )
37
+ #
38
+ # dns.project_id #=> "my-project"
39
+ #
40
+ class Credentials < Google::Auth::Credentials
24
41
  SCOPE = ["https://www.googleapis.com/auth/ndev.clouddns.readwrite"]
25
- PATH_ENV_VARS = %w(DNS_KEYFILE GOOGLE_CLOUD_KEYFILE GCLOUD_KEYFILE)
26
- JSON_ENV_VARS = %w(DNS_KEYFILE_JSON GOOGLE_CLOUD_KEYFILE_JSON
42
+ PATH_ENV_VARS = %w(DNS_CREDENTIALS
43
+ DNS_KEYFILE
44
+ GOOGLE_CLOUD_CREDENTIALS
45
+ GOOGLE_CLOUD_KEYFILE
46
+ GCLOUD_KEYFILE)
47
+ JSON_ENV_VARS = %w(DNS_CREDENTIALS_JSON
48
+ DNS_KEYFILE_JSON
49
+ GOOGLE_CLOUD_CREDENTIALS_JSON
50
+ GOOGLE_CLOUD_KEYFILE_JSON
27
51
  GCLOUD_KEYFILE_JSON)
52
+ DEFAULT_PATHS = \
53
+ ["~/.config/gcloud/application_default_credentials.json"]
28
54
  end
29
55
  end
30
56
  end
@@ -64,17 +64,17 @@ module Google
64
64
  # require "google/cloud/dns"
65
65
  #
66
66
  # dns = Google::Cloud::Dns.new(
67
- # project: "my-project-id",
68
- # keyfile: "/path/to/keyfile.json"
67
+ # project_id: "my-project",
68
+ # credentials: "/path/to/keyfile.json"
69
69
  # )
70
70
  #
71
+ # dns.project_id #=> "my-project"
71
72
  #
72
- # dns.project #=> "my-project-id"
73
- #
74
- def project
73
+ def project_id
75
74
  service.project
76
75
  end
77
- alias_method :id, :project
76
+ alias_method :project, :project_id
77
+ alias_method :id, :project_id
78
78
 
79
79
  ##
80
80
  # The project number.
@@ -127,7 +127,7 @@ module Google
127
127
 
128
128
  ##
129
129
  # @private Default project.
130
- def self.default_project
130
+ def self.default_project_id
131
131
  ENV["DNS_PROJECT"] ||
132
132
  ENV["GOOGLE_CLOUD_PROJECT"] ||
133
133
  ENV["GCLOUD_PROJECT"] ||
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Dns
19
- VERSION = "0.26.0"
19
+ VERSION = "0.27.0"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-dns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-29 00:00:00.000000000 Z
12
+ date: 2017-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -17,28 +17,42 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.0'
20
+ version: '1.1'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.0'
27
+ version: '1.1'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: google-api-client
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.14.0
34
+ version: 0.17.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 0.17.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: googleauth
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: 0.6.2
35
49
  type: :runtime
36
50
  prerelease: false
37
51
  version_requirements: !ruby/object:Gem::Requirement
38
52
  requirements:
39
53
  - - "~>"
40
54
  - !ruby/object:Gem::Version
41
- version: 0.14.0
55
+ version: 0.6.2
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: zonefile
44
58
  requirement: !ruby/object:Gem::Requirement
@@ -224,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
238
  version: '0'
225
239
  requirements: []
226
240
  rubyforge_project:
227
- rubygems_version: 2.6.13
241
+ rubygems_version: 2.7.2
228
242
  signing_key:
229
243
  specification_version: 4
230
244
  summary: API Client library for Google Cloud DNS