functions_framework 1.6.0 → 1.6.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23f6609253491ea56f62219b5ece67a843990f94852f8c99d2195f81a51d5135
|
4
|
+
data.tar.gz: 7a8e7180704d0bdcb1857620e1f2170164798c1569bfb6a1b0c5110982c054df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30094d2fd0221b56e60d771cd3e9661da347999b369ab8f10c8ba6f257b7cd0c80de251c8f6c940968a743c39f04faf8b74662dd5d62993ccd588afa2f91ea1f
|
7
|
+
data.tar.gz: 1720e2e9de683ed21040789e0829b3b05cb495099b3e257cfe25b5a35705ed98b06a52efae19430048ec0d86869ea79b063e46f5024798af8bc59e5cb196abd9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 1.6.1 (2025-07-19)
|
4
|
+
|
5
|
+
#### Bug Fixes
|
6
|
+
|
7
|
+
* update google-style to 1.31, fix linting issues ([#224](https://github.com/GoogleCloudPlatform/functions-framework-ruby/issues/224))
|
8
|
+
* update workflow configs to drop ruby 3.0 ([#220](https://github.com/GoogleCloudPlatform/functions-framework-ruby/issues/220))
|
9
|
+
|
3
10
|
### 1.6.0 (2025-02-07)
|
4
11
|
|
5
12
|
#### Features
|
@@ -185,6 +185,7 @@ module FunctionsFramework
|
|
185
185
|
%r{^providers/google\.firebase\.analytics/} => "firebase.googleapis.com",
|
186
186
|
%r{^providers/google\.firebase\.database/} => "firebasedatabase.googleapis.com"
|
187
187
|
}.freeze
|
188
|
+
private_constant :LEGACY_TYPE_TO_SERVICE
|
188
189
|
|
189
190
|
LEGACY_TYPE_TO_CE_TYPE = {
|
190
191
|
"google.pubsub.topic.publish" => "google.cloud.pubsub.topic.v1.messagePublished",
|
@@ -206,6 +207,7 @@ module FunctionsFramework
|
|
206
207
|
"providers/google.firebase.database/eventTypes/ref.delete" => "google.firebase.database.ref.v1.deleted",
|
207
208
|
"providers/cloud.storage/eventTypes/object.change" => "google.cloud.storage.object.v1.finalized"
|
208
209
|
}.freeze
|
210
|
+
private_constant :LEGACY_TYPE_TO_CE_TYPE
|
209
211
|
|
210
212
|
CE_SERVICE_TO_RESOURCE_RE = {
|
211
213
|
"firebase.googleapis.com" => %r{^(projects/[^/]+)/(events/[^/]+)$},
|
@@ -213,11 +215,13 @@ module FunctionsFramework
|
|
213
215
|
"firestore.googleapis.com" => %r{^(projects/[^/]+/databases/\(default\))/(documents/.+)$},
|
214
216
|
"storage.googleapis.com" => %r{^(projects/[^/]+/buckets/[^/]+)/([^#]+)(?:#.*)?$}
|
215
217
|
}.freeze
|
218
|
+
private_constant :CE_SERVICE_TO_RESOURCE_RE
|
216
219
|
|
217
220
|
# Map Firebase Auth legacy event metadata field names to their equivalent CloudEvent field names.
|
218
221
|
FIREBASE_AUTH_METADATA_LEGACY_TO_CE = {
|
219
222
|
"createdAt" => "createTime",
|
220
223
|
"lastSignedInAt" => "lastSignInTime"
|
221
224
|
}.freeze
|
225
|
+
private_constant :FIREBASE_AUTH_METADATA_LEGACY_TO_CE
|
222
226
|
end
|
223
227
|
end
|
@@ -70,9 +70,9 @@ module FunctionsFramework
|
|
70
70
|
#
|
71
71
|
# @param path [String] File path to load
|
72
72
|
#
|
73
|
-
def load_temporary
|
73
|
+
def load_temporary(path, &)
|
74
74
|
path = ::File.expand_path path
|
75
|
-
Testing.load_for_testing
|
75
|
+
Testing.load_for_testing(path, &)
|
76
76
|
end
|
77
77
|
|
78
78
|
##
|
data/lib/functions_framework.rb
CHANGED
@@ -134,11 +134,10 @@ module FunctionsFramework
|
|
134
134
|
# end
|
135
135
|
#
|
136
136
|
# @param name [String] The function name. Defaults to {DEFAULT_TARGET}.
|
137
|
-
# @param block [Proc] The function code as a proc.
|
138
137
|
# @return [self]
|
139
138
|
#
|
140
|
-
def http
|
141
|
-
global_registry.add_http
|
139
|
+
def http(name = DEFAULT_TARGET, &)
|
140
|
+
global_registry.add_http(name, &)
|
142
141
|
self
|
143
142
|
end
|
144
143
|
|
@@ -164,11 +163,10 @@ module FunctionsFramework
|
|
164
163
|
# @param name [String] The function name. Defaults to {DEFAULT_TARGET}
|
165
164
|
# @param request_class [#decode_json] An optional class which will be used to
|
166
165
|
# decode the request if it implements a `decode_json` static method.
|
167
|
-
# @param block [Proc] The function code as a proc @return [self]
|
168
166
|
# @return [self]
|
169
167
|
#
|
170
|
-
def typed
|
171
|
-
global_registry.add_typed
|
168
|
+
def typed(name = DEFAULT_TARGET, request_class: nil, &)
|
169
|
+
global_registry.add_typed(name, request_class: request_class, &)
|
172
170
|
self
|
173
171
|
end
|
174
172
|
|
@@ -187,16 +185,15 @@ module FunctionsFramework
|
|
187
185
|
# end
|
188
186
|
#
|
189
187
|
# @param name [String] The function name. Defaults to {DEFAULT_TARGET}.
|
190
|
-
# @param block [Proc] The function code as a proc.
|
191
188
|
# @return [self]
|
192
189
|
#
|
193
|
-
def cloud_event
|
194
|
-
global_registry.add_cloud_event
|
190
|
+
def cloud_event(name = DEFAULT_TARGET, &)
|
191
|
+
global_registry.add_cloud_event(name, &)
|
195
192
|
self
|
196
193
|
end
|
197
194
|
|
198
195
|
##
|
199
|
-
# Define a server startup task. This is useful for initializing shared
|
196
|
+
# Define a server startup task as a block. This is useful for initializing shared
|
200
197
|
# resources that should be accessible across all function invocations in
|
201
198
|
# this Ruby VM.
|
202
199
|
#
|
@@ -208,11 +205,10 @@ module FunctionsFramework
|
|
208
205
|
# Startup tasks are passed the {FunctionsFramework::Function} identifying
|
209
206
|
# the function to execute, and have no return value.
|
210
207
|
#
|
211
|
-
# @param block [Proc] The startup task
|
212
208
|
# @return [self]
|
213
209
|
#
|
214
|
-
def on_startup
|
215
|
-
global_registry.add_startup_task(&
|
210
|
+
def on_startup(&)
|
211
|
+
global_registry.add_startup_task(&)
|
216
212
|
self
|
217
213
|
end
|
218
214
|
|
@@ -227,7 +223,7 @@ module FunctionsFramework
|
|
227
223
|
# manipulated to configure the server.
|
228
224
|
# @return [FunctionsFramework::Server]
|
229
225
|
#
|
230
|
-
def start
|
226
|
+
def start(target, &)
|
231
227
|
require "functions_framework/server"
|
232
228
|
if target.is_a? ::FunctionsFramework::Function
|
233
229
|
function = target
|
@@ -236,7 +232,7 @@ module FunctionsFramework
|
|
236
232
|
raise ::ArgumentError, "Undefined function: #{target.inspect}" if function.nil?
|
237
233
|
end
|
238
234
|
globals = function.populate_globals
|
239
|
-
server = Server.new
|
235
|
+
server = Server.new(function, globals, &)
|
240
236
|
global_registry.startup_tasks.each do |task|
|
241
237
|
task.call function, globals: globals, logger: server.config.logger
|
242
238
|
end
|
@@ -255,8 +251,8 @@ module FunctionsFramework
|
|
255
251
|
# manipulated to configure the server.
|
256
252
|
# @return [self]
|
257
253
|
#
|
258
|
-
def run
|
259
|
-
server = start
|
254
|
+
def run(target, &)
|
255
|
+
server = start(target, &)
|
260
256
|
server.wait_until_stopped
|
261
257
|
self
|
262
258
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: functions_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: cloud_events
|
@@ -105,10 +105,10 @@ homepage: https://github.com/GoogleCloudPlatform/functions-framework-ruby
|
|
105
105
|
licenses:
|
106
106
|
- Apache-2.0
|
107
107
|
metadata:
|
108
|
-
changelog_uri: https://googlecloudplatform.github.io/functions-framework-ruby/v1.6.
|
108
|
+
changelog_uri: https://googlecloudplatform.github.io/functions-framework-ruby/v1.6.1/file.CHANGELOG.html
|
109
109
|
source_code_uri: https://github.com/GoogleCloudPlatform/functions-framework-ruby
|
110
110
|
bug_tracker_uri: https://github.com/GoogleCloudPlatform/functions-framework-ruby/issues
|
111
|
-
documentation_uri: https://googlecloudplatform.github.io/functions-framework-ruby/v1.6.
|
111
|
+
documentation_uri: https://googlecloudplatform.github.io/functions-framework-ruby/v1.6.1
|
112
112
|
rdoc_options: []
|
113
113
|
require_paths:
|
114
114
|
- lib
|
@@ -116,14 +116,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
116
|
requirements:
|
117
117
|
- - ">="
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 3.
|
119
|
+
version: 3.1.0
|
120
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.6.
|
126
|
+
rubygems_version: 3.6.9
|
127
127
|
specification_version: 4
|
128
128
|
summary: Functions Framework for Ruby
|
129
129
|
test_files: []
|