functions_framework 0.5.0 → 0.5.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +6 -6
- data/docs/overview.md +1 -1
- data/docs/testing-functions.md +9 -11
- data/docs/writing-functions.md +2 -2
- data/lib/functions_framework.rb +1 -1
- data/lib/functions_framework/function.rb +1 -1
- data/lib/functions_framework/registry.rb +1 -1
- data/lib/functions_framework/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 780a948604e7295463a6fa73d771a212c0df6f1b49b9e04d75568c499b201c04
|
4
|
+
data.tar.gz: 1e5e02ca296f24a0e86e95b9aaff9b680e687c67cda90199ee6854367752fb63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f92218000f31d2a60494a2ac2273f20af3bd584da1fa524964e45460a6670686e77eee0bc807e1d9add0d779e842c05ed054d7e89b16cae0a8496557dbd76269
|
7
|
+
data.tar.gz: 93e7e1a801cf4a4c6a32e051d6c39d8e5a70bbfe18aca97838d690faf0e22995c3595b1ea3075a356d4d6a1af267edfff10f424727aa4da1c4cf246b48ec3528
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### v0.5.1 / 2020-07-20
|
4
|
+
|
5
|
+
* Updated some documentation links. No functional changes.
|
6
|
+
|
3
7
|
### v0.5.0 / 2020-07-09
|
4
8
|
|
5
9
|
* Removed embedded CloudEvents classes and added the official CloudEvents SDK as a dependency. A `FunctionsFramework::CloudEvents` alias provides backward compatibility.
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Functions Framework [](https://
|
1
|
+
# Functions Framework [](https://googlecloudplatform.github.io/functions-framework-ruby/latest) [](https://badge.fury.io/rb/functions_framework)
|
2
2
|
|
3
3
|
An open source framework for writing lightweight, portable Ruby functions that
|
4
4
|
run in a serverless environment. Functions written to this Framework will run
|
@@ -98,26 +98,26 @@ Stop the server with `CTRL+C`.
|
|
98
98
|
|
99
99
|
These guides provide additional getting-started information.
|
100
100
|
|
101
|
-
* **[Writing Functions](https://
|
101
|
+
* **[Writing Functions](https://googlecloudplatform.github.io/functions-framework-ruby/latest/file.writing-functions.html)**
|
102
102
|
: How to write functions that respond to HTTP requests, industry-standard
|
103
103
|
[CloudEvents](https://cloudevents.io), as well as events sent from Google
|
104
104
|
Cloud services such as [Pub/Sub](https://cloud.google.com/pubsub) and
|
105
105
|
[Storage](https://cloud.google.com/storage).
|
106
|
-
* **[Testing Functions](https://
|
106
|
+
* **[Testing Functions](https://googlecloudplatform.github.io/functions-framework-ruby/latest/file.testing-functions.html)**
|
107
107
|
: How to use the testing features of the Functions Framework to write local
|
108
108
|
unit tests for your functions using standard Ruby testing frameworks such
|
109
109
|
as [Minitest](https://github.com/seattlerb/minitest) and
|
110
110
|
[RSpec](https://rspec.info/).
|
111
|
-
* **[Running a Functions Server](https://
|
111
|
+
* **[Running a Functions Server](https://googlecloudplatform.github.io/functions-framework-ruby/latest/file.running-a-functions-server.html)**
|
112
112
|
: How to use the `functions-framework-ruby` executable to run a local
|
113
113
|
functions server.
|
114
|
-
* **[Deploying Functions](https://
|
114
|
+
* **[Deploying Functions](https://googlecloudplatform.github.io/functions-framework-ruby/latest/file.deploying-functions.html)**
|
115
115
|
: How to deploy functions to
|
116
116
|
[Google Cloud Functions](https://cloud.google.com/functions) or
|
117
117
|
[Google Cloud Run](https://cloud.google.com/run).
|
118
118
|
|
119
119
|
The library reference documentation can be found at:
|
120
|
-
https://
|
120
|
+
https://googlecloudplatform.github.io/functions-framework-ruby
|
121
121
|
|
122
122
|
Additional examples are available in the `examples` directory:
|
123
123
|
https://github.com/GoogleCloudPlatform/functions-framework-ruby/blob/master/examples/
|
data/docs/overview.md
CHANGED
@@ -121,7 +121,7 @@ These guides provide additional getting-started information.
|
|
121
121
|
[Google Cloud Run](https://cloud.google.com/run).
|
122
122
|
|
123
123
|
The library reference documentation can be found at:
|
124
|
-
https://
|
124
|
+
https://googlecloudplatform.github.io/functions-framework-ruby
|
125
125
|
|
126
126
|
Additional examples are available in the GitHub repository:
|
127
127
|
https://github.com/GoogleCloudPlatform/functions-framework-ruby/blob/master/examples/
|
data/docs/testing-functions.md
CHANGED
@@ -17,9 +17,8 @@ the output. You do not need to set up (or mock) an actual server.
|
|
17
17
|
The Functions Framework provides utility methods that streamline the process of
|
18
18
|
setting up functions and the environment for testing, constructing input
|
19
19
|
parameters, and interpreting results. These are available in the
|
20
|
-
|
21
|
-
|
22
|
-
describe block.
|
20
|
+
{FunctionsFramework::Testing} module. Generally, you can include this module in
|
21
|
+
your Minitest test class or RSpec describe block.
|
23
22
|
|
24
23
|
```ruby
|
25
24
|
require "minitest/autorun"
|
@@ -45,10 +44,10 @@ end
|
|
45
44
|
|
46
45
|
To test a function, you'll need to load the Ruby file that defines the function,
|
47
46
|
and run the function to test its results. The Testing module provides a method
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
{FunctionsFramework::Testing#load_temporary}, which loads a Ruby file, defining
|
48
|
+
functions but only for the scope of your test. This allows your test to coexist
|
49
|
+
with tests for other functions, even functions with the same name from a
|
50
|
+
different Ruby file.
|
52
51
|
|
53
52
|
```ruby
|
54
53
|
require "minitest/autorun"
|
@@ -91,8 +90,8 @@ includes helper methods that you can use to create simple requests for many
|
|
91
90
|
basic cases.
|
92
91
|
|
93
92
|
When you have constructed an input request, use
|
94
|
-
|
95
|
-
|
93
|
+
{FunctionsFramework::Testing#call_http} to call a named function, passing the
|
94
|
+
request object. This method returns a
|
96
95
|
[Rack::Response](https://rubydoc.info/gems/rack/Rack/Response) that you can
|
97
96
|
assert against.
|
98
97
|
|
@@ -142,8 +141,7 @@ end
|
|
142
141
|
|
143
142
|
Testing a CloudEvent function works similarly. The `Testing` module provides
|
144
143
|
methods to help construct example CloudEvent objects, which can then be passed
|
145
|
-
to the method
|
146
|
-
[call_event](https://rubydoc.info/gems/functions_framework/FunctionsFramework/Testing#call_event-instance_method).
|
144
|
+
to the method {FunctionsFramework::Testing#call_event}.
|
147
145
|
|
148
146
|
Unlike HTTP functions, event functions do not have a return value. Instead, you
|
149
147
|
will need to test side effects. A common approach is to test logs by capturing
|
data/docs/writing-functions.md
CHANGED
@@ -158,9 +158,9 @@ end
|
|
158
158
|
```
|
159
159
|
|
160
160
|
The event parameter will be either a
|
161
|
-
[CloudEvents V0.3 Event](https://
|
161
|
+
[CloudEvents V0.3 Event](https://cloudevents.github.io/sdk-ruby/latest/CloudEvents/Event/V0)
|
162
162
|
object ([see spec](https://github.com/cloudevents/spec/blob/v0.3/spec.md)) or a
|
163
|
-
[CloudEvents V1.0 Event](https://
|
163
|
+
[CloudEvents V1.0 Event](https://cloudevents.github.io/sdk-ruby/latest/CloudEvents/Event/V1)
|
164
164
|
object ([see spec](https://github.com/cloudevents/spec/blob/v1.0/spec.md)).
|
165
165
|
|
166
166
|
Some Google Cloud services send events in a legacy event format that was defined
|
data/lib/functions_framework.rb
CHANGED
@@ -147,7 +147,7 @@ module FunctionsFramework
|
|
147
147
|
#
|
148
148
|
# You must provide a name for the function, and a block that implemets the
|
149
149
|
# function. The block should take one argument: the event object of type
|
150
|
-
# [`CloudEvents::Event`](https://
|
150
|
+
# [`CloudEvents::Event`](https://cloudevents.github.io/sdk-ruby/latest/CloudEvents/Event).
|
151
151
|
# Any return value is ignored.
|
152
152
|
#
|
153
153
|
# ## Example
|
@@ -23,7 +23,7 @@ module FunctionsFramework
|
|
23
23
|
# `Rack::Request` argument and returns one of various HTTP response types.
|
24
24
|
# See {FunctionsFramework::Registry.add_http}. For a function of type
|
25
25
|
# `:cloud_event`, the `call` method takes a single
|
26
|
-
# [CloudEvent](https://
|
26
|
+
# [CloudEvent](https://cloudevents.github.io/sdk-ruby/latest/CloudEvents/Event)
|
27
27
|
# argument, and does not return a value.
|
28
28
|
# See {FunctionsFramework::Registry.add_cloud_event}.
|
29
29
|
#
|
@@ -80,7 +80,7 @@ module FunctionsFramework
|
|
80
80
|
#
|
81
81
|
# You must provide a name for the function, and a block that implemets the
|
82
82
|
# function. The block should take _one_ argument: the event object of type
|
83
|
-
# [`CloudEvents::Event`](https://
|
83
|
+
# [`CloudEvents::Event`](https://cloudevents.github.io/sdk-ruby/latest/CloudEvents/Event).
|
84
84
|
# Any return value is ignored.
|
85
85
|
#
|
86
86
|
# @param name [String] The function name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: functions_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cloud_events
|
@@ -84,10 +84,10 @@ homepage: https://github.com/GoogleCloudPlatform/functions-framework-ruby
|
|
84
84
|
licenses:
|
85
85
|
- Apache-2.0
|
86
86
|
metadata:
|
87
|
-
changelog_uri: https://github.
|
87
|
+
changelog_uri: https://googlecloudplatform.github.io/functions-framework-ruby/v0.5.1/file.CHANGELOG.html
|
88
88
|
source_code_uri: https://github.com/GoogleCloudPlatform/functions-framework-ruby
|
89
89
|
bug_tracker_uri: https://github.com/GoogleCloudPlatform/functions-framework-ruby/issues
|
90
|
-
documentation_uri: https://
|
90
|
+
documentation_uri: https://googlecloudplatform.github.io/functions-framework-ruby/v0.5.1
|
91
91
|
post_install_message:
|
92
92
|
rdoc_options: []
|
93
93
|
require_paths:
|