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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 780a948604e7295463a6fa73d771a212c0df6f1b49b9e04d75568c499b201c04
4
- data.tar.gz: 1e5e02ca296f24a0e86e95b9aaff9b680e687c67cda90199ee6854367752fb63
3
+ metadata.gz: 5e8f0eda1f51ead6ec3bd53d711d2a7816b5077351f56bfa491311c73461a02d
4
+ data.tar.gz: 21921bddd89a66dc95245850cb475967fd5e8de7c678bf4e154d07d7a8264290
5
5
  SHA512:
6
- metadata.gz: f92218000f31d2a60494a2ac2273f20af3bd584da1fa524964e45460a6670686e77eee0bc807e1d9add0d779e842c05ed054d7e89b16cae0a8496557dbd76269
7
- data.tar.gz: 93e7e1a801cf4a4c6a32e051d6c39d8e5a70bbfe18aca97838d690faf0e22995c3595b1ea3075a356d4d6a1af267edfff10f424727aa4da1c4cf246b48ec3528
6
+ metadata.gz: '08633f2559e4d787f23e2711d40ff17437e74cd9ee4589346bd3c4f567815c422cb6e2827125bad2de5d23f4e52c3a09162db609a4fd62aee4374144ae16686e'
7
+ data.tar.gz: 759e2fe6a395fe1ea53ba90bbf5026635429fbdacf161b3f87879d31753532b7ef005fbfce797c6ca599bca441f1919b4d61a508cf43877fee18090a4e8f9fec
@@ -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) *(in preview)*
8
- * [Cloud Run or Cloud Run for Anthos](https://cloud.google.com/run)
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
 
@@ -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 preview.
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
- Choose a name for your function. This function name is how it will appear in the
50
- cloud console, and will also be part of the function's URL. (It's different from
51
- the name you provide when writing your function; Cloud Functions calls that name
52
- the "function target".)
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 --project=$YOUR_PROJECT_ID \
58
- --runtime=ruby26 --trigger-http --source=$YOUR_FUNCTION_SOURCE \
59
- --entry-point=$YOUR_FUNCTION_TARGET
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 source file defaults to `./app.rb` and the function target defaults to
63
- `function`, so those flags can be omitted if you're using the defaults. The
64
- project flag can also be omitted if you've set it as the default with
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
 
@@ -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) *(in preview)*
12
- * [Cloud Run or Cloud Run for Anthos](https://cloud.google.com/run)
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
 
@@ -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
- The "entrypoint" to the project, also called the "source", is a Ruby file. It
211
- can define any number of functions (with distinct names), although it is often
212
- good practice to create a separate Ruby file per function.
213
-
214
- By convention, the source file is often called `app.rb`, but you can give it
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 simple project might look like this:
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)
@@ -71,7 +71,7 @@ require "functions_framework/version"
71
71
  #
72
72
  module FunctionsFramework
73
73
  @global_registry = Registry.new
74
- @logger = ::Logger.new ::STDERR
74
+ @logger = ::Logger.new $stderr
75
75
  @logger.level = ::Logger::INFO
76
76
 
77
77
  ##
@@ -17,5 +17,5 @@ module FunctionsFramework
17
17
  # Version of the Ruby Functions Framework
18
18
  # @return [String]
19
19
  #
20
- VERSION = "0.5.1".freeze
20
+ VERSION = "0.5.2".freeze
21
21
  end
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.1
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-22 00:00:00.000000000 Z
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 implementation for Ruby.
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.1/file.CHANGELOG.html
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.1
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.1.2
109
+ rubygems_version: 3.0.3
107
110
  signing_key:
108
111
  specification_version: 4
109
112
  summary: Functions Framework for Ruby