faastruby 0.3.8 → 0.4.0

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: 796d1dc7279aec871854d488ac6ae0a68e7db0df98e1bdb8cd16270b9fc56877
4
- data.tar.gz: b4d16447eb8b26cb6f6e71aff0f190671edb1046d50677627933ff5e432a5526
3
+ metadata.gz: 178ae19dfe92b53e2999fdc813c917d3857a1788913392399d0277f9be856ba6
4
+ data.tar.gz: 9cc19b7f28601b7ff0a9172bfd52959b41c7636b35bf7c42664c254d5c3d3aa7
5
5
  SHA512:
6
- metadata.gz: cbcd32fa4e5641c6b5d1f2c4762cac3df3b84ceedcce861db9a17f6bd2334367a69ccfe39528677444f9ac9776528133d932fd53376bbd8fa9810bc312b3b805
7
- data.tar.gz: 9f07023fc4517556789619220cf882d4ad607b4fed4ed82941ec99759f7adf5c870d90e5dd49c8495f312cc7b339c15df06e8b85fea28f7365f9b69405ff364c
6
+ metadata.gz: 1efa109f73c944632dce9a603a4dabed5d4b988962adc473c93d9d23ee9a29b51f7de06a9cf791b46ca5530c55217176ce4d34d5e5a67ef9482338a436e66442
7
+ data.tar.gz: 4cd3bd725b0062e436fa76a4746aff4d23f43eb59f279f58ad2e3546eba4f51ac8b175e0f3ac63f332d02874aeb3b6b89984de75e785569cb4895f5143eca962
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0 - Dec 29 2018
4
+ - Faster hello-world Ruby template.
5
+ - Ruby 2.6.0 and Crystal (beta) 0.27.0 released.
6
+
3
7
  ## 0.3.8 - Dec 29 2018
4
8
  - Crystal template runs a lot faster.
5
9
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- faastruby (0.3.7)
4
+ faastruby (0.3.8)
5
5
  colorize (~> 0.8)
6
6
  faastruby-rpc (~> 0.1.3)
7
7
  oj (~> 3.6)
@@ -1,3 +1,3 @@
1
1
  module FaaStRuby
2
- VERSION = '0.3.8'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -1,10 +1,14 @@
1
1
  # require 'cool-gem'
2
- require 'json'
3
2
 
4
3
  # To deploy this function, cd into its folder and run:
5
4
  # faastruby deploy-to WORKSPACE_NAME
6
5
  def handler event
7
- data = event.body ? JSON.parse(event.body) : {}
6
+ # The 'event' argument has the following attributes
7
+ # event.body - The request body
8
+ # event.context - The execution context
9
+ # event.headers - The request headers
10
+ # event.query_params - The query params
11
+
8
12
  # FUNCTION RESPONSE
9
13
  #
10
14
  # You can render text, json, yaml, html or js. Example:
@@ -19,5 +23,5 @@ def handler event
19
23
  # The 'Content-Type' header is automatically set when you use 'render'.
20
24
  # You can set custom headers using a hash with string keys. Example:
21
25
  # render text: 'It Works!', headers: {'TransactionId' => 23928}
22
- render text: "Hello, #{data['name'] || 'World'}!\n"
26
+ render text: "Hello, World!\n"
23
27
  end
@@ -2,18 +2,13 @@ require 'spec_helper'
2
2
  require 'handler'
3
3
 
4
4
  describe 'handler(event)' do
5
- let(:event) {SpecHelper::Event.new(body: '{"name": "Ruby"}')}
5
+ let(:event) {SpecHelper::Event.new}
6
6
 
7
7
  it 'should return Hash, String or Array' do
8
8
  body = handler(event).call.body
9
9
  expect([String, Hash, Array].include? body.class).to be true
10
10
  end
11
- it 'should add the name to the response string' do
12
- body = handler(event).call.body
13
- expect(body).to be == "Hello, Ruby!\n"
14
- end
15
- it 'should say Hello, World! when name is not present' do
16
- event = SpecHelper::Event.new(body: nil)
11
+ it 'should reply Hello, World!' do
17
12
  body = handler(event).call.body
18
13
  expect(body).to be == "Hello, World!\n"
19
14
  end
@@ -1,6 +1,12 @@
1
1
  # To deploy this function, cd into its folder and run:
2
2
  # faastruby deploy-to WORKSPACE_NAME
3
3
  def handler event
4
+ # The 'event' argument has the following attributes
5
+ # event.body - The request body
6
+ # event.context - The execution context
7
+ # event.headers - The request headers
8
+ # event.query_params - The query params
9
+
4
10
  # FUNCTION RESPONSE
5
11
  #
6
12
  # You can render text, json, yaml, html or js. Example:
@@ -16,5 +22,5 @@ def handler event
16
22
  # You can set custom headers using a hash with string keys. Example:
17
23
  # render text: 'It Works!', headers: {'TransactionId' => 23928}
18
24
 
19
- # Write code here
25
+ # TODO: Write code here
20
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faastruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Arruda