functions_framework 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -2
- data/docs/deploying-functions.md +22 -13
- data/docs/overview.md +2 -2
- data/docs/writing-functions.md +7 -9
- data/lib/functions_framework.rb +1 -1
- data/lib/functions_framework/version.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e8f0eda1f51ead6ec3bd53d711d2a7816b5077351f56bfa491311c73461a02d
|
4
|
+
data.tar.gz: 21921bddd89a66dc95245850cb475967fd5e8de7c678bf4e154d07d7a8264290
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08633f2559e4d787f23e2711d40ff17437e74cd9ee4589346bd3c4f567815c422cb6e2827125bad2de5d23f4e52c3a09162db609a4fd62aee4374144ae16686e'
|
7
|
+
data.tar.gz: 759e2fe6a395fe1ea53ba90bbf5026635429fbdacf161b3f87879d31753532b7ef005fbfce797c6ca599bca441f1919b4d61a508cf43877fee18090a4e8f9fec
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### v0.5.2 / 2020-09-06
|
4
|
+
|
5
|
+
* FIXED: Use global $stderr rather than STDERR for logger
|
6
|
+
* DOCS: Fix instructions for deployment to Google Cloud Functions
|
7
|
+
|
3
8
|
### v0.5.1 / 2020-07-20
|
4
9
|
|
5
10
|
* Updated some documentation links. No functional changes.
|
data/README.md
CHANGED
@@ -4,8 +4,8 @@ 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
|
5
5
|
in many different environments, including:
|
6
6
|
|
7
|
-
* [Google Cloud Functions](https://cloud.google.com/functions) *(
|
8
|
-
* [
|
7
|
+
* [Google Cloud Functions](https://cloud.google.com/functions) *(alpha)*
|
8
|
+
* [Google Cloud Run](https://cloud.google.com/run)
|
9
9
|
* Any other [Knative](https://github.com/knative)-based environment
|
10
10
|
* Your local development machine
|
11
11
|
|
data/docs/deploying-functions.md
CHANGED
@@ -34,7 +34,7 @@ You can run Ruby functions on Google Cloud Functions by selecting the `ruby26`
|
|
34
34
|
runtime. This runtime uses a recent release of Ruby 2.6. Support for other
|
35
35
|
versions of Ruby may be added in the future.
|
36
36
|
|
37
|
-
> **Note:** Ruby support on Cloud Functions is currently in limited
|
37
|
+
> **Note:** Ruby support on Cloud Functions is currently in limited alpha.
|
38
38
|
> It is not yet suitable for production workloads, and support is best-effort
|
39
39
|
> only. Access is currently limited to selected early-access users.
|
40
40
|
|
@@ -46,30 +46,39 @@ is to `bundle install` or `bundle update` and run your local tests prior to
|
|
46
46
|
deploying. Cloud Functions will not accept your function unless an up-to-date
|
47
47
|
`Gemfile.lock` is present.
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
Also, make sure your source file (which defines your function) is called
|
50
|
+
`app.rb`. The Functions Framework lets you choose a function source file, but
|
51
|
+
Cloud Functions currently requires you to use `app.rb`.
|
52
|
+
|
53
|
+
Decide _which_ function in the source file to invoke, that is, the name that you
|
54
|
+
used when writing the function. This is called the **target**. (Note that if you
|
55
|
+
did not specify a name for the function, it defaults to the name `function`.)
|
56
|
+
|
57
|
+
Choose a Cloud Functions **name** for your function. The **name** identifies
|
58
|
+
this function deployment (e.g. in the cloud console) and is also part of the
|
59
|
+
function's default URL. (Note: the **name** and the **target** do not have to
|
60
|
+
be the same value.)
|
53
61
|
|
54
62
|
Then, issue the gcloud command to deploy:
|
55
63
|
|
56
64
|
```sh
|
57
|
-
gcloud functions deploy $YOUR_FUNCTION_NAME
|
58
|
-
|
59
|
-
|
65
|
+
gcloud functions deploy $YOUR_FUNCTION_NAME \
|
66
|
+
--project=$YOUR_PROJECT_ID \
|
67
|
+
--runtime=ruby26 \
|
68
|
+
--trigger-http \
|
69
|
+
--entry-point=$YOUR_FUNCTION_TARGET
|
60
70
|
```
|
61
71
|
|
62
|
-
The
|
63
|
-
|
64
|
-
|
65
|
-
`gcloud config set project`.
|
72
|
+
The `--entry-point=` flag can be omitted if the **target** has the same value
|
73
|
+
as the **name**. Additionally, the `--project` flag can be omitted if you've
|
74
|
+
set your default project using `gcloud config set project`.
|
66
75
|
|
67
76
|
If your function handles events rather than HTTP requests, you'll need to
|
68
77
|
replace `--trigger-http` with a different trigger. For details, see the
|
69
78
|
[reference documentation](https://cloud.google.com/sdk/gcloud/reference/functions/deploy)
|
70
79
|
for `gcloud functions deploy`.
|
71
80
|
|
72
|
-
To update your deployment, just redeploy using the same function name
|
81
|
+
To update your deployment, just redeploy using the same function **name**.
|
73
82
|
|
74
83
|
### Configuring Cloud Functions deployments
|
75
84
|
|
data/docs/overview.md
CHANGED
@@ -8,8 +8,8 @@ The Functions Framework is an open source framework for writing lightweight,
|
|
8
8
|
portable Ruby functions that run in a serverless environment. Functions written
|
9
9
|
to this Framework will run in many different environments, including:
|
10
10
|
|
11
|
-
* [Google Cloud Functions](https://cloud.google.com/functions) *(
|
12
|
-
* [
|
11
|
+
* [Google Cloud Functions](https://cloud.google.com/functions) *(alpha)*
|
12
|
+
* [Google Cloud Run](https://cloud.google.com/run)
|
13
13
|
* Any other [Knative](https://github.com/knative)-based environment
|
14
14
|
* Your local development machine
|
15
15
|
|
data/docs/writing-functions.md
CHANGED
@@ -110,7 +110,6 @@ It is easy to connect an HTTP function to a Sinatra app. First, declare the
|
|
110
110
|
dependency on Sinatra in your `Gemfile`:
|
111
111
|
|
112
112
|
```ruby
|
113
|
-
# Gemfile
|
114
113
|
source "https://rubygems.org"
|
115
114
|
gem "functions_framework", "~> 0.5"
|
116
115
|
gem "sinatra", "~> 2.0"
|
@@ -207,15 +206,14 @@ needed by the function. It must include at least one Ruby source file that
|
|
207
206
|
defines functions, and can also include additional Ruby files defining classes
|
208
207
|
and methods that assist in the function implementation.
|
209
208
|
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
any name. Projects can also have multiple source files that apply to different
|
216
|
-
cases.
|
209
|
+
By convention, the "main" Ruby file that defines functions should be called
|
210
|
+
`app.rb` and be located at the root of the project. The path to this file is
|
211
|
+
sometimes known as the **function source**. The Functions Framework allows you
|
212
|
+
to specify an arbitrary source, but suome hosting environments (such as Google
|
213
|
+
Cloud Functions) require it to be `./app.rb`.
|
217
214
|
|
218
|
-
A
|
215
|
+
A source file can define any number of functions (with distinct names). Each of
|
216
|
+
the names is known as a **function target**.
|
219
217
|
|
220
218
|
```
|
221
219
|
(project directory)
|
data/lib/functions_framework.rb
CHANGED
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.2
|
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-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cloud_events
|
@@ -52,7 +52,10 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.1'
|
55
|
-
description: The Functions Framework
|
55
|
+
description: The Functions Framework is an open source framework for writing lightweight,
|
56
|
+
portable Ruby functions that run in a serverless environment. Functions written
|
57
|
+
to this Framework will run Google Cloud Google Cloud Functions, Google Cloud Run,
|
58
|
+
or any other Knative-based environment.
|
56
59
|
email:
|
57
60
|
- dazuma@google.com
|
58
61
|
executables:
|
@@ -84,10 +87,10 @@ homepage: https://github.com/GoogleCloudPlatform/functions-framework-ruby
|
|
84
87
|
licenses:
|
85
88
|
- Apache-2.0
|
86
89
|
metadata:
|
87
|
-
changelog_uri: https://googlecloudplatform.github.io/functions-framework-ruby/v0.5.
|
90
|
+
changelog_uri: https://googlecloudplatform.github.io/functions-framework-ruby/v0.5.2/file.CHANGELOG.html
|
88
91
|
source_code_uri: https://github.com/GoogleCloudPlatform/functions-framework-ruby
|
89
92
|
bug_tracker_uri: https://github.com/GoogleCloudPlatform/functions-framework-ruby/issues
|
90
|
-
documentation_uri: https://googlecloudplatform.github.io/functions-framework-ruby/v0.5.
|
93
|
+
documentation_uri: https://googlecloudplatform.github.io/functions-framework-ruby/v0.5.2
|
91
94
|
post_install_message:
|
92
95
|
rdoc_options: []
|
93
96
|
require_paths:
|
@@ -103,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
106
|
- !ruby/object:Gem::Version
|
104
107
|
version: '0'
|
105
108
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
109
|
+
rubygems_version: 3.0.3
|
107
110
|
signing_key:
|
108
111
|
specification_version: 4
|
109
112
|
summary: Functions Framework for Ruby
|