grafeas 1.3.0 → 1.5.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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -26
  3. data/lib/grafeas/version.rb +1 -1
  4. data/lib/grafeas.rb +31 -0
  5. metadata +4 -119
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15078c6d11818df6b566ea6d75ec36bb2b7a785cec1804122dbb6016755b344b
4
- data.tar.gz: 431625f54ee88560518208e6144a30accc53d5673d7fed960d861241ad9453e8
3
+ metadata.gz: 913695ac0f735da37dba6b2e011a88220cb1b0f65f5e9d363e58ce5596fe3ffc
4
+ data.tar.gz: ad36aef7e2630fa749e07401ebd29d4175badca05395052932539e7868a28c06
5
5
  SHA512:
6
- metadata.gz: 1fbfa2053b47dfe8f523225269066b21023b017587aa02449e27d707f0e06a342c2a8bacd41f0c6ce99a4aa18a0eb42f80ac3f7ee94152fdb5fe0799210a61f7
7
- data.tar.gz: 18e82d179d9f2d1a1e343867a4cd08c0937071a1d552d425f28595244a881a9641a71bfa0bb3f2d97f1eb1b2f52d48dee1895c53ed692ba8b3e2c9b131f9028e
6
+ metadata.gz: 82fe604a6d66e62d97355a1c90224a332266c4f2c494e8b2fe30eb0e51bc975a7711324d0493e99aa9be05a57f870b05e7c7f479398562594685e6aa06048e10
7
+ data.tar.gz: 1c7876254f9b153542806a177cac8736e9bc6ade3d73edad87e162d65d9b884a7381dc8f5123feb8c426c7c5aa6e81a33e780944f3e2857cfd21e45c5e8b6ab0
data/README.md CHANGED
@@ -35,35 +35,39 @@ and includes substantial interface changes. Existing code written for earlier
35
35
  versions of this library will likely require updates to use this version.
36
36
  See the {file:MIGRATING.md MIGRATING.md} document for more information.
37
37
 
38
- ## Enabling Logging
39
-
40
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
41
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
42
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
43
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
44
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
45
-
46
- Configuring a Ruby stdlib logger:
47
-
48
- ```ruby
49
- require "logger"
50
-
51
- module MyLogger
52
- LOGGER = Logger.new $stderr, level: Logger::WARN
53
- def logger
54
- LOGGER
55
- end
56
- end
57
-
58
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
59
- module GRPC
60
- extend MyLogger
61
- end
62
- ```
38
+ ## Debug Logging
39
+
40
+ This library comes with opt-in Debug Logging that can help you troubleshoot
41
+ your application's integration with the API. When logging is activated, key
42
+ events such as requests and responses, along with data payloads and metadata
43
+ such as headers and client configuration, are logged to the standard error
44
+ stream.
45
+
46
+ **WARNING:** Client Library Debug Logging includes your data payloads in
47
+ plaintext, which could include sensitive data such as PII for yourself or your
48
+ customers, private keys, or other security data that could be compromising if
49
+ leaked. Always practice good data hygiene with your application logs, and follow
50
+ the principle of least access. Google also recommends that Client Library Debug
51
+ Logging be enabled only temporarily during active debugging, and not used
52
+ permanently in production.
53
+
54
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
55
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
56
+ list of client library gem names. This will select the default logging behavior,
57
+ which writes logs to the standard error stream. On a local workstation, this may
58
+ result in logs appearing on the console. When running on a Google Cloud hosting
59
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
60
+ results in logs appearing alongside your application logs in the
61
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
62
+
63
+ Debug logging also requires that the versioned clients for this service be
64
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
65
+ working, try updating the versioned clients in your bundle or installed gems:
66
+ [grafeas-v1](https://cloud.google.com/ruby/docs/reference/grafeas-v1/latest).
63
67
 
64
68
  ## Supported Ruby Versions
65
69
 
66
- This library is supported on Ruby 2.6+.
70
+ This library is supported on Ruby 3.0+.
67
71
 
68
72
  Google provides official support for Ruby versions that are actively supported
69
73
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -18,5 +18,5 @@
18
18
 
19
19
 
20
20
  module Grafeas
21
- VERSION = "1.3.0"
21
+ VERSION = "1.5.0"
22
22
  end
data/lib/grafeas.rb CHANGED
@@ -36,6 +36,11 @@ module Grafeas
36
36
  # supported by that API version, and the corresponding gem is available, the
37
37
  # appropriate versioned client will be returned.
38
38
  #
39
+ # Raises an exception if the currently installed versioned client gem for the
40
+ # given API version does not support the Grafeas service.
41
+ # You can determine whether the method will succeed by calling
42
+ # {Grafeas.grafeas_available?}.
43
+ #
39
44
  # ## About Grafeas
40
45
  #
41
46
  # [Grafeas](https://grafeas.io) API.
@@ -67,6 +72,32 @@ module Grafeas
67
72
  service_module = Grafeas.const_get(package_name).const_get(:Grafeas)
68
73
  service_module.const_get(:Client).new(&block)
69
74
  end
75
+
76
+ ##
77
+ # Determines whether the Grafeas service is supported by the current client.
78
+ # If true, you can retrieve a client object by calling {Grafeas.grafeas}.
79
+ # If false, that method will raise an exception. This could happen if the given
80
+ # API version does not exist or does not support the Grafeas service,
81
+ # or if the versioned client gem needs an update to support the Grafeas service.
82
+ #
83
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
84
+ # Defaults to `:v1`.
85
+ # @return [boolean] Whether the service is available.
86
+ #
87
+ def self.grafeas_available? version: :v1
88
+ require "grafeas/#{version.to_s.downcase}"
89
+ package_name = Grafeas
90
+ .constants
91
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
92
+ .first
93
+ return false unless package_name
94
+ service_module = Grafeas.const_get package_name
95
+ return false unless service_module.const_defined? :Grafeas
96
+ service_module = service_module.const_get :Grafeas
97
+ service_module.const_defined? :Client
98
+ rescue ::LoadError
99
+ false
100
+ end
70
101
  end
71
102
 
72
103
  helper_path = ::File.join __dir__, "grafeas", "helpers.rb"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grafeas
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-01-15 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -44,118 +43,6 @@ dependencies:
44
43
  - - "<"
45
44
  - !ruby/object:Gem::Version
46
45
  version: 2.a
47
- - !ruby/object:Gem::Dependency
48
- name: google-style
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: 1.26.1
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: 1.26.1
61
- - !ruby/object:Gem::Dependency
62
- name: minitest
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '5.16'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '5.16'
75
- - !ruby/object:Gem::Dependency
76
- name: minitest-focus
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '1.1'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '1.1'
89
- - !ruby/object:Gem::Dependency
90
- name: minitest-rg
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: '5.2'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '5.2'
103
- - !ruby/object:Gem::Dependency
104
- name: rake
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: '13.0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: '13.0'
117
- - !ruby/object:Gem::Dependency
118
- name: redcarpet
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: '3.0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: '3.0'
131
- - !ruby/object:Gem::Dependency
132
- name: simplecov
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - "~>"
136
- - !ruby/object:Gem::Version
137
- version: '0.9'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: '0.9'
145
- - !ruby/object:Gem::Dependency
146
- name: yard
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - "~>"
150
- - !ruby/object:Gem::Version
151
- version: '0.9'
152
- type: :development
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - "~>"
157
- - !ruby/object:Gem::Version
158
- version: '0.9'
159
46
  description: The Grafeas API stores, and enables querying and retrieval of, critical
160
47
  metadata about all of your software artifacts.
161
48
  email: googleapis-packages@google.com
@@ -173,7 +60,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
173
60
  licenses:
174
61
  - Apache-2.0
175
62
  metadata: {}
176
- post_install_message:
177
63
  rdoc_options: []
178
64
  require_paths:
179
65
  - lib
@@ -181,15 +67,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
67
  requirements:
182
68
  - - ">="
183
69
  - !ruby/object:Gem::Version
184
- version: '2.6'
70
+ version: '3.0'
185
71
  required_rubygems_version: !ruby/object:Gem::Requirement
186
72
  requirements:
187
73
  - - ">="
188
74
  - !ruby/object:Gem::Version
189
75
  version: '0'
190
76
  requirements: []
191
- rubygems_version: 3.5.3
192
- signing_key:
77
+ rubygems_version: 3.6.2
193
78
  specification_version: 4
194
79
  summary: API Client library for the Grafeas API
195
80
  test_files: []