lamby 4.0.0 → 4.0.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: 1c7b5f3442327670c35f81b025c05eb75a9fe02c3a33168c36ceb6d5695ff84d
4
- data.tar.gz: d42a578523d78d86d4092ae200d800f657329269f69e5c30dada57f57e84427a
3
+ metadata.gz: ab238754427b550d4af87b1ed22f474f538aa4ccb8b7b25c003a514c4aef7f26
4
+ data.tar.gz: ad971104829c43cb962b08d04df0783fa7bb5f803150249bae6ccce5e643c506
5
5
  SHA512:
6
- metadata.gz: a196d5ca7d4b302ea0ba11f7d79b9d785c9fa5a0e8c58c9b9d859587bb389a59b6cafac995a855816cac3cc569ea5491fb6cd6be22d0bb26d2670d3df226b09d
7
- data.tar.gz: 3b8af072ca3bf8b307311b955cb8b971de1abce140984574481d18c342e69553eac589dbd6681e637f42290e119b4f6f7a1695d55815f69e41f70587d0ee55a0
6
+ metadata.gz: 85f8251a51591b1fbbd245e3168b03924ece75c2ac03f8db1a66d6b6b8e1a6a55950ad2e8d5de8dda9ee4ff1a33bf150fd23d07cb42337ae7b73c50f3cce130c
7
+ data.tar.gz: 19c768ec3b3bd1d349a5c9fc7e36a45e52ecd679191e8f0a83ea8bfe23c0cdefe0524c4f9a0087ae7838aef2b1b828fa8a414f3bd93910c8e50c1b8862b5e642
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  See this http://keepachangelog.com link for information on how we want this documented formatted.
4
4
 
5
+ ## v4.0.2
6
+
7
+ ### Fixed
8
+
9
+ - Runner's Open3 uses crypteia friendly env.
10
+
11
+ ## v4.0.1
12
+
13
+ ### Added
14
+
15
+ - New `Lamby.config.handled_proc` called with ensure via `Lamby.cmd`
16
+
5
17
  ## v4.0.0
6
18
 
7
19
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lamby (4.0.0)
4
+ lamby (4.0.2)
5
5
  rack
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,24 +1,23 @@
1
1
  # Lamby [![Actions Status](https://github.com/customink/lamby/workflows/CI/CD/badge.svg)](https://github.com/customink/lamby/actions) [![Codespaces](https://img.shields.io/badge/Codespaces-✅-black)](https://github.com/features/codespaces)
2
2
 
3
3
  <h2>Simple Rails &amp; AWS Lambda Integration using Rack</h2>
4
+ <a href="https://lamby.custominktech.com"><img src="https://raw.githubusercontent.com/customink/lamby/master/images/social2.png" alt="Lamby: Simple Rails & AWS Lambda Integration using Rack." align="right" width="450" style="margin-left:1rem;margin-bottom:1rem;" /></a>
4
5
 
5
6
  Lamby is an [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter) for Rack applications.
6
7
 
7
- <img src="https://raw.githubusercontent.com/customink/lamby_site/master/app/assets/images/lamby-arch-hero.png" alt="Lamby: Simple Rails & AWS Lambda Integration"/>
8
-
9
8
  We support Lambda [Function URLs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html), [API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html) (HTTP or REST, all payload versions), and even [Application Load Balancer](https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html) integrations.
10
9
 
11
10
  ## Quick Start
12
11
 
13
- https://lamby.custominktech.com/docs/quick_start
12
+ https://lamby.custominktech.com/docs/quick-start
14
13
 
15
14
  ## Full Documentation
16
15
 
17
- https://lamby.custominktech.com
16
+ https://lamby.custominktech.com/docs/anatomy
18
17
 
19
18
  ## Contributing
20
19
 
21
- This project is built for [GitHub Codespcaes](https://github.com/features/codespaces) using the [Development Container](https://containers.dev) specification. Once you have the repo cloned and setup with a dev container using either Codespaces or [VS Code](#using-vs-code), run the following commands. This will install packages and run tests.
20
+ This project is built for [GitHub Codespaces](https://github.com/features/codespaces) using the [Development Container](https://containers.dev) specification. Once you have the repo cloned and setup with a dev container using either Codespaces or [VS Code](#using-vs-code), run the following commands. This will install packages and run tests.
22
21
 
23
22
  ```shell
24
23
  $ ./bin/setup
data/lib/lamby/config.rb CHANGED
@@ -56,5 +56,13 @@ module Lamby
56
56
  Runner::PATTERNS
57
57
  end
58
58
 
59
+ def handled_proc
60
+ @handled_proc ||= Proc.new { |_event, _context| }
61
+ end
62
+
63
+ def handled_proc=(proc)
64
+ @handled_proc = proc
65
+ end
66
+
59
67
  end
60
68
  end
data/lib/lamby/runner.rb CHANGED
@@ -28,7 +28,7 @@ module Lamby
28
28
 
29
29
  def call
30
30
  validate!
31
- status = Open3.popen3(command, chdir: chdir) do |_stdin, stdout, stderr, thread|
31
+ status = Open3.popen3(env, command, chdir: chdir) do |_stdin, stdout, stderr, thread|
32
32
  @body << stdout.read
33
33
  @body << stderr.read
34
34
  puts @body
@@ -56,5 +56,9 @@ module Lamby
56
56
  PATTERNS.any? { |p| p === command }
57
57
  end
58
58
 
59
+ def env
60
+ Hash[ENV.to_hash.map { |k,v| [k, ENV[k]] }]
61
+ end
62
+
59
63
  end
60
64
  end
data/lib/lamby/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lamby
2
- VERSION = '4.0.0'
2
+ VERSION = '4.0.2'
3
3
  end
data/lib/lamby.rb CHANGED
@@ -22,6 +22,8 @@ module Lamby
22
22
 
23
23
  def cmd(event:, context:)
24
24
  handler(config.rack_app, event, context)
25
+ ensure
26
+ config.handled_proc.call(event, context)
25
27
  end
26
28
 
27
29
  def handler(app, event, context, options = {})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lamby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-03 00:00:00.000000000 Z
11
+ date: 2023-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack