faastruby 0.4.1 → 0.4.2

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: 8244bab88a55713b6fc3120d3a6918eec1624bba59587f0ccc0bd6121d6420ed
4
- data.tar.gz: c3a91bf9d948abe7f74cb3b97ad8851162395ca5798adcd80df2a5e1e8bcedea
3
+ metadata.gz: c01308a98baef83f7584358342b5593f8017671243fccdb351bbca0501efb5e8
4
+ data.tar.gz: 02573d5f8483a4a0d797caac9f97659550bfbab776fbf879dfb7a67503bfd63c
5
5
  SHA512:
6
- metadata.gz: c926551e21f64042f6c566755596ea8e53831e58b7ae97b5a07f0d5e47bd73aadfed85b71b135fa0552afca9b7c3c039aa48020e3efbe01fe80f96d56f578ec3
7
- data.tar.gz: f5de476b2f82b8f16ab32d512d68b399c7a76a8436812cb9dddbe519ca0674eba12ab038c5e040052ed6e4a1b4669414392f8ba5701a429452d3e0ab7aad52bc
6
+ metadata.gz: 34bbb6de97544ddefdb8f8c9d233da3469b22b0145631b8dec39e31d2bfb4e1a9b4f8be53bba86a019caeb2ec0e4d46af66967a6c4f91bd50fe2da59bd98bd07
7
+ data.tar.gz: a74de808b41605fe03d80b1cc434c958b71b2373395e00c66ef7bd56b9ffc86a99555b28d9012130d0df6ef6382aa95e66e941cc3a526ad077fd7197346a2350
data/CHANGELOG.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.2 - Dec 30 2018
4
+ - Simplified Crystal Hello World example.
5
+
3
6
  ## 0.4.1 - Dec 30 2018
4
- - Updated ruby templates
7
+ - Updated ruby templates.
5
8
 
6
9
  ## 0.4.0 - Dec 29 2018
7
10
  - Faster hello-world Ruby template.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- faastruby (0.4.0)
4
+ faastruby (0.4.1)
5
5
  colorize (~> 0.8)
6
6
  faastruby-rpc (~> 0.1.3)
7
7
  oj (~> 3.6)
@@ -38,7 +38,7 @@ GEM
38
38
  mustermann (1.0.3)
39
39
  necromancer (0.4.0)
40
40
  netrc (0.11.0)
41
- oj (3.7.5)
41
+ oj (3.7.6)
42
42
  pastel (0.7.2)
43
43
  equatable (~> 0.5.0)
44
44
  tty-color (~> 0.4.0)
@@ -1,3 +1,3 @@
1
1
  module FaaStRuby
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
@@ -1,9 +1,8 @@
1
1
  require "./spec_helper"
2
2
 
3
3
  describe "handler(event)" do
4
- body = {"name" => "Ruby"}.to_json
5
4
  event_hash = {
6
- "body" => body,
5
+ "body" => nil,
7
6
  "context" => nil,
8
7
  "headers" => {"Content-Type" => "application/json"},
9
8
  "query_params" => {} of String => String
@@ -14,11 +13,7 @@ describe "handler(event)" do
14
13
  body = handler(event).body
15
14
  body.class.should eq(String)
16
15
  end
17
- it "should add the name to the response string" do
18
- body = handler(event).body
19
- body.should eq("Hello, Ruby!\n")
20
- end
21
- it "should say Hello, World! when name is not present" do
16
+ it "should say Hello, World!" do
22
17
  event_hash["body"] = nil
23
18
  event = Event.from_json(event_hash.to_json)
24
19
  body = handler(event).body
@@ -8,7 +8,6 @@ def handler(event : FaaStRuby::Event) : FaaStRuby::Response
8
8
  # event.headers : Hash(String, String)
9
9
  # event.context : String | Nil
10
10
  # query_params : Hash(String, String)
11
- name = event.body ? JSON.parse(event.body.not_nil!)["name"] : "World"
12
11
  # FUNCTION RESPONSE
13
12
  #
14
13
  # You can render text, json, yaml, html or js. Example:
@@ -23,5 +22,5 @@ def handler(event : FaaStRuby::Event) : FaaStRuby::Response
23
22
  # The 'Content-Type' header is automatically set when you use 'render'.
24
23
  # You can set custom headers using a Hash(String, String). Example:
25
24
  # render text: "It Works!", headers: {"TransactionId" => 23928}
26
- render text: "Hello, #{name}!\n"
25
+ render text: "Hello, World!\n"
27
26
  end
@@ -53,7 +53,7 @@ module FaaStRuby
53
53
  resp_body = text
54
54
  when yaml
55
55
  headers["Content-Type"] ||= "application/yaml"
56
- resp_body = yaml.to_yaml
56
+ resp_body = yaml.is_a?(String) ? yaml : yaml.to_yaml
57
57
  when body
58
58
  headers["Content-Type"] ||= "application/octet-stream"
59
59
  resp_body = raw
@@ -52,7 +52,7 @@ module FaaStRuby
52
52
  resp_body = text
53
53
  when yaml
54
54
  headers["Content-Type"] ||= "application/yaml"
55
- resp_body = yaml.to_yaml
55
+ resp_body = yaml.is_a?(String) ? yaml : yaml.to_yaml
56
56
  when body
57
57
  headers["Content-Type"] ||= "application/octet-stream"
58
58
  resp_body = raw
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.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Arruda