google-cloud-resource_manager 0.39.0 → 1.0.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/.yardopts +5 -9
- data/AUTHENTICATION.md +81 -141
- data/LICENSE.md +201 -0
- data/MIGRATING.md +194 -0
- data/README.md +131 -0
- data/lib/google/cloud/resource_manager/version.rb +6 -2
- data/lib/google/cloud/resource_manager.rb +546 -84
- data/lib/google-cloud-resource_manager.rb +5 -120
- metadata +14 -49
- data/CHANGELOG.md +0 -175
- data/CODE_OF_CONDUCT.md +0 -40
- data/CONTRIBUTING.md +0 -189
- data/LICENSE +0 -201
- data/LOGGING.md +0 -27
- data/OVERVIEW.md +0 -188
- data/TROUBLESHOOTING.md +0 -31
- data/lib/google/cloud/resource_manager/credentials.rb +0 -53
- data/lib/google/cloud/resource_manager/manager.rb +0 -300
- data/lib/google/cloud/resource_manager/policy.rb +0 -191
- data/lib/google/cloud/resource_manager/project/list.rb +0 -166
- data/lib/google/cloud/resource_manager/project/updater.rb +0 -151
- data/lib/google/cloud/resource_manager/project.rb +0 -502
- data/lib/google/cloud/resource_manager/resource.rb +0 -119
- data/lib/google/cloud/resource_manager/service.rb +0 -139
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2025 Google LLC
|
2
4
|
#
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
6
|
# you may not use this file except in compliance with the License.
|
@@ -12,123 +14,6 @@
|
|
12
14
|
# See the License for the specific language governing permissions and
|
13
15
|
# limitations under the License.
|
14
16
|
|
15
|
-
|
16
|
-
# This file is here to be autorequired by bundler, so that the
|
17
|
-
# Google::Cloud.resource_manager and Google::Cloud#resource_manager methods can
|
18
|
-
# be available, but the library and all dependencies won't be loaded until
|
19
|
-
# required and used.
|
20
|
-
|
21
|
-
|
22
|
-
gem "google-cloud-core"
|
23
|
-
require "google/cloud" unless defined? Google::Cloud.new
|
24
|
-
require "google/cloud/config"
|
25
|
-
require "googleauth"
|
26
|
-
|
27
|
-
module Google
|
28
|
-
module Cloud
|
29
|
-
##
|
30
|
-
# Creates a new object for connecting to the Resource Manager service.
|
31
|
-
# Each call creates a new connection.
|
32
|
-
#
|
33
|
-
# For more information on connecting to Google Cloud see the
|
34
|
-
# {file:AUTHENTICATION.md Authentication Guide}.
|
35
|
-
#
|
36
|
-
# @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
|
37
|
-
# set of resources and operations that the connection can access. See
|
38
|
-
# [Using OAuth 2.0 to Access Google
|
39
|
-
# APIs](https://developers.google.com/identity/protocols/OAuth2).
|
40
|
-
#
|
41
|
-
# The default scope is:
|
42
|
-
#
|
43
|
-
# * `https://www.googleapis.com/auth/cloud-platform`
|
44
|
-
# @param [Integer] retries Number of times to retry requests on server
|
45
|
-
# error. The default value is `3`. Optional.
|
46
|
-
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
47
|
-
#
|
48
|
-
# @return [Google::Cloud::ResourceManager::Manager]
|
49
|
-
#
|
50
|
-
# @example
|
51
|
-
# require "google/cloud"
|
52
|
-
#
|
53
|
-
# gcloud = Google::Cloud.new
|
54
|
-
# resource_manager = gcloud.resource_manager
|
55
|
-
# resource_manager.projects.each do |project|
|
56
|
-
# puts projects.project_id
|
57
|
-
# end
|
58
|
-
#
|
59
|
-
# @example The default scope can be overridden with the `scope` option:
|
60
|
-
# require "google/cloud"
|
61
|
-
#
|
62
|
-
# gcloud = Google::Cloud.new
|
63
|
-
# readonly_scope = \
|
64
|
-
# "https://www.googleapis.com/auth/cloudresourcemanager.readonly"
|
65
|
-
# resource_manager = gcloud.resource_manager scope: readonly_scope
|
66
|
-
#
|
67
|
-
def resource_manager scope: nil, retries: nil, timeout: nil
|
68
|
-
retries ||= @retries
|
69
|
-
timeout ||= @timeout
|
70
|
-
Google::Cloud.resource_manager @keyfile, scope: scope,
|
71
|
-
retries: retries,
|
72
|
-
timeout: timeout
|
73
|
-
end
|
74
|
-
|
75
|
-
##
|
76
|
-
# Creates a new `Project` instance connected to the Resource Manager
|
77
|
-
# service. Each call creates a new connection.
|
78
|
-
#
|
79
|
-
# For more information on connecting to Google Cloud see the
|
80
|
-
# {file:AUTHENTICATION.md Authentication Guide}.
|
81
|
-
#
|
82
|
-
# @param [String, Hash, Google::Auth::Credentials] credentials The path to
|
83
|
-
# the keyfile as a String, the contents of the keyfile as a Hash, or a
|
84
|
-
# Google::Auth::Credentials object. (See {ResourceManager::Credentials})
|
85
|
-
# @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
|
86
|
-
# set of resources and operations that the connection can access. See
|
87
|
-
# [Using OAuth 2.0 to Access Google
|
88
|
-
# APIs](https://developers.google.com/identity/protocols/OAuth2).
|
89
|
-
#
|
90
|
-
# The default scope is:
|
91
|
-
#
|
92
|
-
# * `https://www.googleapis.com/auth/cloud-platform`
|
93
|
-
# @param [Integer] retries Number of times to retry requests on server
|
94
|
-
# error. The default value is `3`. Optional.
|
95
|
-
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
96
|
-
#
|
97
|
-
# @return [Google::Cloud::ResourceManager::Manager]
|
98
|
-
#
|
99
|
-
# @example
|
100
|
-
# require "google/cloud"
|
101
|
-
#
|
102
|
-
# resource_manager = Google::Cloud.resource_manager
|
103
|
-
# resource_manager.projects.each do |project|
|
104
|
-
# puts projects.project_id
|
105
|
-
# end
|
106
|
-
#
|
107
|
-
def self.resource_manager credentials = nil, scope: nil, retries: nil,
|
108
|
-
timeout: nil
|
109
|
-
require "google/cloud/resource_manager"
|
110
|
-
Google::Cloud::ResourceManager.new credentials: credentials, scope: scope,
|
111
|
-
retries: retries, timeout: timeout
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
# Set the default resource manager configuration
|
117
|
-
Google::Cloud.configure.add_config! :resource_manager do |config|
|
118
|
-
default_creds = Google::Cloud::Config.deferred do
|
119
|
-
Google::Cloud::Config.credentials_from_env(
|
120
|
-
"RESOURCE_MANAGER_CREDENTIALS", "RESOURCE_MANAGER_CREDENTIALS_JSON",
|
121
|
-
"RESOURCE_MANAGER_KEYFILE", "RESOURCE_MANAGER_KEYFILE_JSON"
|
122
|
-
)
|
123
|
-
end
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
124
18
|
|
125
|
-
|
126
|
-
match: [String, Hash, Google::Auth::Credentials],
|
127
|
-
allow_nil: true
|
128
|
-
config.add_alias! :keyfile, :credentials
|
129
|
-
config.add_field! :scope, nil, match: [String, Array]
|
130
|
-
config.add_field! :quota_project, nil, match: String
|
131
|
-
config.add_field! :retries, nil, match: Integer
|
132
|
-
config.add_field! :timeout, nil, match: Integer
|
133
|
-
config.add_field! :endpoint, nil, match: String
|
134
|
-
end
|
19
|
+
require "google/cloud/resource_manager" unless defined? Google::Cloud::ResourceManager::VERSION
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-resource_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- Chris Smith
|
7
|
+
- Google LLC
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-14 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: google-cloud-core
|
@@ -25,69 +24,35 @@ dependencies:
|
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: '1.6'
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: google-
|
27
|
+
name: google-cloud-resource_manager-v3
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - "~>"
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
32
|
+
version: '1.2'
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - "~>"
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.16.2
|
48
|
-
- - "<"
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 2.a
|
51
|
-
type: :runtime
|
52
|
-
prerelease: false
|
53
|
-
version_requirements: !ruby/object:Gem::Requirement
|
54
|
-
requirements:
|
55
|
-
- - ">="
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: 0.16.2
|
58
|
-
- - "<"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 2.a
|
61
|
-
description: google-cloud-resource_manager is the official library for Google Cloud
|
62
|
-
Resource Manager.
|
63
|
-
email:
|
64
|
-
- mike@blowmage.com
|
65
|
-
- quartzmo@gmail.com
|
39
|
+
version: '1.2'
|
40
|
+
description: Creates, reads, and updates metadata for Google Cloud Platform resource
|
41
|
+
containers.
|
42
|
+
email: googleapis-packages@google.com
|
66
43
|
executables: []
|
67
44
|
extensions: []
|
68
45
|
extra_rdoc_files: []
|
69
46
|
files:
|
70
47
|
- ".yardopts"
|
71
48
|
- AUTHENTICATION.md
|
72
|
-
-
|
73
|
-
-
|
74
|
-
-
|
75
|
-
- LICENSE
|
76
|
-
- LOGGING.md
|
77
|
-
- OVERVIEW.md
|
78
|
-
- TROUBLESHOOTING.md
|
49
|
+
- LICENSE.md
|
50
|
+
- MIGRATING.md
|
51
|
+
- README.md
|
79
52
|
- lib/google-cloud-resource_manager.rb
|
80
53
|
- lib/google/cloud/resource_manager.rb
|
81
|
-
- lib/google/cloud/resource_manager/credentials.rb
|
82
|
-
- lib/google/cloud/resource_manager/manager.rb
|
83
|
-
- lib/google/cloud/resource_manager/policy.rb
|
84
|
-
- lib/google/cloud/resource_manager/project.rb
|
85
|
-
- lib/google/cloud/resource_manager/project/list.rb
|
86
|
-
- lib/google/cloud/resource_manager/project/updater.rb
|
87
|
-
- lib/google/cloud/resource_manager/resource.rb
|
88
|
-
- lib/google/cloud/resource_manager/service.rb
|
89
54
|
- lib/google/cloud/resource_manager/version.rb
|
90
|
-
homepage: https://github.com/googleapis/google-cloud-ruby
|
55
|
+
homepage: https://github.com/googleapis/google-cloud-ruby
|
91
56
|
licenses:
|
92
57
|
- Apache-2.0
|
93
58
|
metadata: {}
|
@@ -107,5 +72,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
72
|
requirements: []
|
108
73
|
rubygems_version: 3.6.5
|
109
74
|
specification_version: 4
|
110
|
-
summary:
|
75
|
+
summary: Creates, reads, and updates metadata for Google Cloud Platform resource containers.
|
111
76
|
test_files: []
|
data/CHANGELOG.md
DELETED
@@ -1,175 +0,0 @@
|
|
1
|
-
# Release History
|
2
|
-
|
3
|
-
### 0.39.0 (2025-03-04)
|
4
|
-
|
5
|
-
#### Features
|
6
|
-
|
7
|
-
* Update minimum Ruby version to 3.0 ([#29261](https://github.com/googleapis/google-cloud-ruby/issues/29261))
|
8
|
-
|
9
|
-
### 0.38.0 (2024-03-07)
|
10
|
-
|
11
|
-
#### Features
|
12
|
-
|
13
|
-
* Update minimum supported Ruby version to 2.7 ([#25298](https://github.com/googleapis/google-cloud-ruby/issues/25298))
|
14
|
-
|
15
|
-
### 0.37.0 (2022-06-30)
|
16
|
-
|
17
|
-
#### Features
|
18
|
-
|
19
|
-
* Update minimum Ruby version to 2.6 ([#18444](https://github.com/googleapis/google-cloud-ruby/issues/18444))
|
20
|
-
|
21
|
-
### 0.36.2 / 2021-07-08
|
22
|
-
|
23
|
-
#### Documentation
|
24
|
-
|
25
|
-
* Update AUTHENTICATION.md in handwritten packages
|
26
|
-
|
27
|
-
### 0.36.1 / 2021-06-17
|
28
|
-
|
29
|
-
#### Bug Fixes
|
30
|
-
|
31
|
-
* Expand googleauth dependency to support future 1.x versions
|
32
|
-
|
33
|
-
### 0.36.0 / 2021-03-10
|
34
|
-
|
35
|
-
#### Features
|
36
|
-
|
37
|
-
* Drop support for Ruby 2.4 and add support for Ruby 3.0
|
38
|
-
|
39
|
-
### 0.35.0 / 2021-01-13
|
40
|
-
|
41
|
-
#### Features
|
42
|
-
|
43
|
-
* Replace google-api-client with google-apis-cloudresourcemanager_v1
|
44
|
-
|
45
|
-
### 0.34.0 / 2020-09-16
|
46
|
-
|
47
|
-
#### Features
|
48
|
-
|
49
|
-
* quota_project can be set via library configuration
|
50
|
-
|
51
|
-
### 0.33.3 / 2020-05-28
|
52
|
-
|
53
|
-
#### Documentation
|
54
|
-
|
55
|
-
* Fix a few broken links
|
56
|
-
|
57
|
-
### 0.33.2 / 2020-04-01
|
58
|
-
|
59
|
-
#### Documentation
|
60
|
-
|
61
|
-
* fix some incorrect markdown causing spurious links
|
62
|
-
|
63
|
-
### 0.33.1 / 2020-02-04
|
64
|
-
|
65
|
-
#### Bug Fixes
|
66
|
-
|
67
|
-
* List all projects example
|
68
|
-
|
69
|
-
### 0.33.0 / 2019-10-29
|
70
|
-
|
71
|
-
This release requires Ruby 2.4 or later.
|
72
|
-
|
73
|
-
#### Documentation
|
74
|
-
|
75
|
-
* Clarify which Google Cloud Platform environments support automatic authentication
|
76
|
-
|
77
|
-
### 0.32.0 / 2019-10-01
|
78
|
-
|
79
|
-
#### Features
|
80
|
-
|
81
|
-
* Support overriding of service endpoint
|
82
|
-
|
83
|
-
### 0.31.1 / 2019-08-23
|
84
|
-
|
85
|
-
#### Documentation
|
86
|
-
|
87
|
-
* Update documentation
|
88
|
-
|
89
|
-
### 0.31.0 / 2019-02-12
|
90
|
-
|
91
|
-
* Add parent resoure to `Project`:
|
92
|
-
* Add `Project#parent`.
|
93
|
-
* Add `parent` optional named argument to `Manager#create_project`.
|
94
|
-
* Add `Resource` class.
|
95
|
-
* Add `Manager#resource` convenience method.
|
96
|
-
|
97
|
-
### 0.30.3 / 2018-09-20
|
98
|
-
|
99
|
-
* Update documentation.
|
100
|
-
* Change documentation URL to googleapis GitHub org.
|
101
|
-
* Fix circular require warning.
|
102
|
-
|
103
|
-
### 0.30.2 / 2018-09-12
|
104
|
-
|
105
|
-
* Add missing documentation files to package.
|
106
|
-
|
107
|
-
### 0.30.1 / 2018-09-10
|
108
|
-
|
109
|
-
* Update documentation.
|
110
|
-
|
111
|
-
### 0.30.0 / 2018-06-22
|
112
|
-
|
113
|
-
* Update Policy, protect from role duplication.
|
114
|
-
* Updated dependencies.
|
115
|
-
|
116
|
-
### 0.29.0 / 2018-02-27
|
117
|
-
|
118
|
-
* Support Shared Configuration.
|
119
|
-
* Fix issue with IAM Policy not refreshing properly.
|
120
|
-
* Update Google API Client dependency.
|
121
|
-
|
122
|
-
### 0.28.0 / 2017-11-14
|
123
|
-
|
124
|
-
* Add `Google::Cloud::ResourceManager::Credentials` class.
|
125
|
-
* Rename constructor arguments to `project_id` and `credentials`.
|
126
|
-
(The previous arguments `project` and `keyfile` are still supported.)
|
127
|
-
* Document `Google::Auth::Credentials` as `credentials` value.
|
128
|
-
* Updated `google-api-client`, `googleauth` dependencies.
|
129
|
-
|
130
|
-
### 0.27.0 / 2017-09-28
|
131
|
-
|
132
|
-
* Update Google API Client dependency to 0.14.x.
|
133
|
-
|
134
|
-
### 0.26.0 / 2017-06-27
|
135
|
-
|
136
|
-
* Upgrade dependency on Google API Client
|
137
|
-
|
138
|
-
### 0.25.0 / 2017-06-01
|
139
|
-
|
140
|
-
* Fix apiary client argument case.
|
141
|
-
* Update gem spec homepage links.
|
142
|
-
* Remove memoization of Policy.
|
143
|
-
* Remove force parameter from Project#policy.
|
144
|
-
* Remove Policy#deep_dup.
|
145
|
-
|
146
|
-
### 0.24.1 / 2017-04-06
|
147
|
-
|
148
|
-
* Fix error due to missing require.
|
149
|
-
|
150
|
-
### 0.24.0 / 2017-04-05
|
151
|
-
|
152
|
-
* Upgrade dependency on Google API Client
|
153
|
-
|
154
|
-
### 0.23.0 / 2017-03-31
|
155
|
-
|
156
|
-
* Updated documentation
|
157
|
-
|
158
|
-
### 0.22.0 / 2017-03-03
|
159
|
-
|
160
|
-
* Dependency on Google API Client has been updated to 0.10.x.
|
161
|
-
|
162
|
-
### 0.21.0 / 2016-10-20
|
163
|
-
|
164
|
-
* New service constructor Google::Cloud::ResourceManager.new
|
165
|
-
|
166
|
-
### 0.20.1 / 2016-09-02
|
167
|
-
|
168
|
-
* Fix for timeout on uploads.
|
169
|
-
|
170
|
-
### 0.20.0 / 2016-08-26
|
171
|
-
|
172
|
-
This gem contains the Google Cloud Resource Manager service implementation for the `google-cloud` gem. The `google-cloud` gem replaces the old `gcloud` gem. Legacy code can continue to use the `gcloud` gem.
|
173
|
-
|
174
|
-
* Namespace is now `Google::Cloud`
|
175
|
-
* The `google-cloud` gem is now an umbrella package for individual gems
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# Contributor Code of Conduct
|
2
|
-
|
3
|
-
As contributors and maintainers of this project, and in the interest of
|
4
|
-
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
-
contribute through reporting issues, posting feature requests, updating
|
6
|
-
documentation, submitting pull requests or patches, and other activities.
|
7
|
-
|
8
|
-
We are committed to making participation in this project a harassment-free
|
9
|
-
experience for everyone, regardless of level of experience, gender, gender
|
10
|
-
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
-
body size, race, ethnicity, age, religion, or nationality.
|
12
|
-
|
13
|
-
Examples of unacceptable behavior by participants include:
|
14
|
-
|
15
|
-
* The use of sexualized language or imagery
|
16
|
-
* Personal attacks
|
17
|
-
* Trolling or insulting/derogatory comments
|
18
|
-
* Public or private harassment
|
19
|
-
* Publishing other's private information, such as physical or electronic
|
20
|
-
addresses, without explicit permission
|
21
|
-
* Other unethical or unprofessional conduct.
|
22
|
-
|
23
|
-
Project maintainers have the right and responsibility to remove, edit, or reject
|
24
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
25
|
-
not aligned to this Code of Conduct. By adopting this Code of Conduct, project
|
26
|
-
maintainers commit themselves to fairly and consistently applying these
|
27
|
-
principles to every aspect of managing this project. Project maintainers who do
|
28
|
-
not follow or enforce the Code of Conduct may be permanently removed from the
|
29
|
-
project team.
|
30
|
-
|
31
|
-
This code of conduct applies both within project spaces and in public spaces
|
32
|
-
when an individual is representing the project or its community.
|
33
|
-
|
34
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
35
|
-
reported by opening an issue or contacting one or more of the project
|
36
|
-
maintainers.
|
37
|
-
|
38
|
-
This Code of Conduct is adapted from the [Contributor
|
39
|
-
Covenant](http://contributor-covenant.org), version 1.2.0, available at
|
40
|
-
[http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
|
data/CONTRIBUTING.md
DELETED
@@ -1,189 +0,0 @@
|
|
1
|
-
# Contributing to Google Cloud Resource Manager
|
2
|
-
|
3
|
-
1. **Sign one of the contributor license agreements below.**
|
4
|
-
2. Fork the repo, develop and test your code changes.
|
5
|
-
3. Send a pull request.
|
6
|
-
|
7
|
-
## Contributor License Agreements
|
8
|
-
|
9
|
-
Before we can accept your pull requests you'll need to sign a Contributor
|
10
|
-
License Agreement (CLA):
|
11
|
-
|
12
|
-
- **If you are an individual writing original source code** and **you own the
|
13
|
-
intellectual property**, then you'll need to sign an [individual
|
14
|
-
CLA](https://developers.google.com/open-source/cla/individual).
|
15
|
-
- **If you work for a company that wants to allow you to contribute your work**,
|
16
|
-
then you'll need to sign a [corporate
|
17
|
-
CLA](https://developers.google.com/open-source/cla/corporate).
|
18
|
-
|
19
|
-
You can sign these electronically (just scroll to the bottom). After that, we'll
|
20
|
-
be able to accept your pull requests.
|
21
|
-
|
22
|
-
## Setup
|
23
|
-
|
24
|
-
In order to use the google-cloud-resource_manager console and run the project's
|
25
|
-
tests, there is a small amount of setup:
|
26
|
-
|
27
|
-
1. Install Ruby. google-cloud-resource_manager requires Ruby 2.5+. You may
|
28
|
-
choose to manage your Ruby and gem installations with [RVM](https://rvm.io/),
|
29
|
-
[rbenv](https://github.com/rbenv/rbenv), or
|
30
|
-
[chruby](https://github.com/postmodern/chruby).
|
31
|
-
|
32
|
-
2. Install [Bundler](http://bundler.io/).
|
33
|
-
|
34
|
-
```sh
|
35
|
-
$ gem install bundler
|
36
|
-
```
|
37
|
-
|
38
|
-
3. Install the top-level project dependencies.
|
39
|
-
|
40
|
-
```sh
|
41
|
-
$ bundle install
|
42
|
-
```
|
43
|
-
|
44
|
-
4. Install the Resource Manager dependencies.
|
45
|
-
|
46
|
-
```sh
|
47
|
-
$ cd google-cloud-resource_manager/
|
48
|
-
$ bundle install
|
49
|
-
```
|
50
|
-
|
51
|
-
## Console
|
52
|
-
|
53
|
-
In order to run code interactively, you can automatically load
|
54
|
-
google-cloud-resource_manager and its dependencies in IRB. This requires that
|
55
|
-
your developer environment has already been configured by following the steps
|
56
|
-
described in the {file:AUTHENTICATION.md Authentication Guide}. An IRB console
|
57
|
-
can be created with:
|
58
|
-
|
59
|
-
```sh
|
60
|
-
$ cd google-cloud-resource_manager/
|
61
|
-
$ bundle exec rake console
|
62
|
-
```
|
63
|
-
|
64
|
-
## Resource Manager Tests
|
65
|
-
|
66
|
-
Tests are very important part of google-cloud-resource_manager. All
|
67
|
-
contributions should include tests that ensure the contributed code behaves as
|
68
|
-
expected.
|
69
|
-
|
70
|
-
To run the unit tests, documentation tests, and code style checks together for a
|
71
|
-
package:
|
72
|
-
|
73
|
-
``` sh
|
74
|
-
$ cd google-cloud-resource_manager/
|
75
|
-
$ bundle exec rake ci
|
76
|
-
```
|
77
|
-
|
78
|
-
To run the command above, plus all acceptance tests, use `rake ci:acceptance` or
|
79
|
-
its handy alias, `rake ci:a`.
|
80
|
-
|
81
|
-
### Resource Manager Unit Tests
|
82
|
-
|
83
|
-
|
84
|
-
The project uses the [minitest](https://github.com/seattlerb/minitest) library,
|
85
|
-
including [specs](https://github.com/seattlerb/minitest#specs),
|
86
|
-
[mocks](https://github.com/seattlerb/minitest#mocks) and
|
87
|
-
[minitest-autotest](https://github.com/seattlerb/minitest-autotest).
|
88
|
-
|
89
|
-
To run the Resource Manager unit tests:
|
90
|
-
|
91
|
-
``` sh
|
92
|
-
$ cd google-cloud-resource_manager/
|
93
|
-
$ bundle exec rake test
|
94
|
-
```
|
95
|
-
|
96
|
-
### Resource Manager Documentation Tests
|
97
|
-
|
98
|
-
The project tests the code examples in the gem's
|
99
|
-
[YARD](https://github.com/lsegal/yard)-based documentation.
|
100
|
-
|
101
|
-
The example testing functions in a way that is very similar to unit testing, and
|
102
|
-
in fact the library providing it,
|
103
|
-
[yard-doctest](https://github.com/p0deje/yard-doctest), is based on the
|
104
|
-
project's unit test library, [minitest](https://github.com/seattlerb/minitest).
|
105
|
-
|
106
|
-
To run the Resource Manager documentation tests:
|
107
|
-
|
108
|
-
``` sh
|
109
|
-
$ cd google-cloud-resource_manager/
|
110
|
-
$ bundle exec rake doctest
|
111
|
-
```
|
112
|
-
|
113
|
-
If you add, remove or modify documentation examples when working on a pull
|
114
|
-
request, you may need to update the setup for the tests. The stubs and mocks
|
115
|
-
required to run the tests are located in `support/doctest_helper.rb`. Please
|
116
|
-
note that much of the setup is matched by the title of the
|
117
|
-
[`@example`](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#example) tag.
|
118
|
-
If you alter an example's title, you may encounter breaking tests.
|
119
|
-
|
120
|
-
### Resource Manager Acceptance Tests
|
121
|
-
|
122
|
-
The Resource Manager acceptance tests interact with the live service API. Follow
|
123
|
-
the instructions in the {file:AUTHENTICATION.md Authentication Guide} for
|
124
|
-
enabling the Resource Manager API. Occasionally, some API features may not yet
|
125
|
-
be generally available, making it difficult for some contributors to
|
126
|
-
successfully run the entire acceptance test suite. However, please ensure that
|
127
|
-
you do successfully run acceptance tests for any code areas covered by your pull
|
128
|
-
request.
|
129
|
-
|
130
|
-
To run the acceptance tests, first create and configure a project in the Google
|
131
|
-
Developers Console, as described in the {file:AUTHENTICATION.md Authentication Guide}. Be sure to download the JSON KEY file. Make note of the PROJECT_ID and
|
132
|
-
the KEYFILE location on your system.
|
133
|
-
|
134
|
-
Before you can run the Resource Manager acceptance tests, you must first create
|
135
|
-
indexes used in the tests.
|
136
|
-
|
137
|
-
#### Running the Resource Manager acceptance tests
|
138
|
-
|
139
|
-
To run the Resource Manager acceptance tests:
|
140
|
-
|
141
|
-
``` sh
|
142
|
-
$ cd google-cloud-resource_manager/
|
143
|
-
$ bundle exec rake acceptance[\\{my-project-id},\\{/path/to/keyfile.json}]
|
144
|
-
```
|
145
|
-
|
146
|
-
Or, if you prefer you can store the values in the `GCLOUD_TEST_PROJECT` and
|
147
|
-
`GCLOUD_TEST_KEYFILE` environment variables:
|
148
|
-
|
149
|
-
``` sh
|
150
|
-
$ cd google-cloud-resource_manager/
|
151
|
-
$ export GCLOUD_TEST_PROJECT=\\{my-project-id}
|
152
|
-
$ export GCLOUD_TEST_KEYFILE=\\{/path/to/keyfile.json}
|
153
|
-
$ bundle exec rake acceptance
|
154
|
-
```
|
155
|
-
|
156
|
-
If you want to use a different project and credentials for acceptance tests, you
|
157
|
-
can use the more specific `BIGTABLE_TEST_PROJECT` and `BIGTABLE_TEST_KEYFILE`
|
158
|
-
environment variables:
|
159
|
-
|
160
|
-
``` sh
|
161
|
-
$ cd google-cloud-resource_manager/
|
162
|
-
$ export BIGTABLE_TEST_PROJECT=\\{my-project-id}
|
163
|
-
$ export BIGTABLE_TEST_KEYFILE=\\{/path/to/keyfile.json}
|
164
|
-
$ bundle exec rake acceptance
|
165
|
-
```
|
166
|
-
|
167
|
-
## Coding Style
|
168
|
-
|
169
|
-
Please follow the established coding style in the library. The style is is
|
170
|
-
largely based on [The Ruby Style
|
171
|
-
Guide](https://github.com/bbatsov/ruby-style-guide) with a few exceptions based
|
172
|
-
on seattle-style:
|
173
|
-
|
174
|
-
* Avoid parenthesis when possible, including in method definitions.
|
175
|
-
* Always use double quotes strings. ([Option
|
176
|
-
B](https://github.com/bbatsov/ruby-style-guide#strings))
|
177
|
-
|
178
|
-
You can check your code against these rules by running Rubocop like so:
|
179
|
-
|
180
|
-
```sh
|
181
|
-
$ cd google-cloud-resource_manager/
|
182
|
-
$ bundle exec rake rubocop
|
183
|
-
```
|
184
|
-
|
185
|
-
## Code of Conduct
|
186
|
-
|
187
|
-
Please note that this project is released with a Contributor Code of Conduct. By
|
188
|
-
participating in this project you agree to abide by its terms. See
|
189
|
-
{file:CODE_OF_CONDUCT.md Code of Conduct} for more information.
|