lamby 3.1.3 → 4.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.devcontainer/Dockerfile +1 -0
- data/.devcontainer/devcontainer.json +20 -0
- data/.github/workflows/test.yml +25 -0
- data/CHANGELOG.md +19 -2
- data/Gemfile.lock +106 -101
- data/README.md +10 -7
- data/bin/bootstrap +1 -4
- data/bin/setup +4 -4
- data/bin/test +4 -4
- data/bin/update +1 -3
- data/images/social.png +0 -0
- data/images/social2.png +0 -0
- data/lib/lamby/config.rb +9 -0
- data/lib/lamby/debug.rb +0 -6
- data/lib/lamby/logger.rb +3 -12
- data/lib/lamby/rack.rb +0 -3
- data/lib/lamby/railtie.rb +1 -6
- data/lib/lamby/version.rb +1 -1
- data/lib/lamby.rb +4 -1
- metadata +9 -41
- data/.github/workflows/cicd.yml +0 -17
- data/.ruby-version +0 -1
- data/Dockerfile +0 -7
- data/bin/_setup +0 -7
- data/bin/_test +0 -8
- data/docker-compose.yml +0 -15
- data/lib/lamby/sam_helpers.rb +0 -9
- data/lib/lamby/tasks.rake +0 -15
- data/lib/lamby/templates/alb/Dockerfile +0 -15
- data/lib/lamby/templates/alb/Dockerfile-build +0 -18
- data/lib/lamby/templates/alb/_build +0 -25
- data/lib/lamby/templates/alb/_deploy +0 -31
- data/lib/lamby/templates/alb/app.rb +0 -12
- data/lib/lamby/templates/alb/deploy +0 -8
- data/lib/lamby/templates/alb/docker-compose.yml +0 -19
- data/lib/lamby/templates/alb/template.yaml +0 -90
- data/lib/lamby/templates/alb.rb +0 -33
- data/lib/lamby/templates/http/Dockerfile +0 -15
- data/lib/lamby/templates/http/Dockerfile-build +0 -18
- data/lib/lamby/templates/http/_build +0 -25
- data/lib/lamby/templates/http/_deploy +0 -31
- data/lib/lamby/templates/http/app.rb +0 -12
- data/lib/lamby/templates/http/deploy +0 -8
- data/lib/lamby/templates/http/docker-compose.yml +0 -19
- data/lib/lamby/templates/http/template.yaml +0 -48
- data/lib/lamby/templates/http.rb +0 -33
- data/lib/lamby/templates/rest/Dockerfile +0 -15
- data/lib/lamby/templates/rest/Dockerfile-build +0 -18
- data/lib/lamby/templates/rest/_build +0 -25
- data/lib/lamby/templates/rest/_deploy +0 -31
- data/lib/lamby/templates/rest/app.rb +0 -12
- data/lib/lamby/templates/rest/deploy +0 -8
- data/lib/lamby/templates/rest/docker-compose.yml +0 -19
- data/lib/lamby/templates/rest/template.yaml +0 -84
- data/lib/lamby/templates/rest.rb +0 -33
- data/lib/lamby/templates/shared.rb +0 -17
- data/lib/lamby/templates.rake +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe87efadccca6c1617e3e68c582ecee620a8e562e3f62f3b080841a3bdf04ae0
|
4
|
+
data.tar.gz: 575478c47cb9d247045a71d6d41082d9555f3c3f76303bd7c42ec3ba968cc518
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cacd905594e872cbb8b4d4328987f2783e982d0ee7269b94b0814045e5e32ed2f405459f1871718060e90ad55d2d0b0ca5d6280501806cc7c060acc3afe41501
|
7
|
+
data.tar.gz: e6918b5c81d910db6fcba20a617d36a9f65cb8e7b43f4ceabfb5479fb7e4b918b1228d2cf0109b1b17a616c09ec3b25cd6297629d0de59bf38bd64939e128a0c
|
@@ -0,0 +1 @@
|
|
1
|
+
FROM mcr.microsoft.com/devcontainers/ruby:3.1
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"name": "lamby",
|
3
|
+
"build": {
|
4
|
+
"dockerfile": "Dockerfile"
|
5
|
+
},
|
6
|
+
"features": {
|
7
|
+
"ghcr.io/devcontainers/features/node:latest": {},
|
8
|
+
"ghcr.io/devcontainers/features/docker-in-docker:latest": {},
|
9
|
+
"ghcr.io/devcontainers/features/sshd:latest": {}
|
10
|
+
},
|
11
|
+
"customizations": {
|
12
|
+
"vscode": {
|
13
|
+
"settings": {
|
14
|
+
"editor.formatOnSave": true
|
15
|
+
},
|
16
|
+
"extensions": []
|
17
|
+
}
|
18
|
+
},
|
19
|
+
"remoteUser": "vscode"
|
20
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: CI/CD
|
2
|
+
on: [push]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
steps:
|
7
|
+
- name: Checkout
|
8
|
+
uses: actions/checkout@v2
|
9
|
+
- name: Login to GitHub Container Registry
|
10
|
+
uses: docker/login-action@v2
|
11
|
+
with:
|
12
|
+
registry: ghcr.io
|
13
|
+
username: ${{ github.repository_owner }}
|
14
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
15
|
+
- name: Build & Run Development Container
|
16
|
+
uses: devcontainers/ci@v0.2
|
17
|
+
with:
|
18
|
+
push: always
|
19
|
+
imageName: ghcr.io/customink/lamby-devcontainer
|
20
|
+
cacheFrom: ghcr.io/customink/lamby-devcontainer
|
21
|
+
env: |
|
22
|
+
CI
|
23
|
+
runCmd: |
|
24
|
+
./bin/setup
|
25
|
+
./bin/test
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,26 @@
|
|
1
|
-
<!-- -*- mode: markdown -*- -->
|
2
|
-
|
3
1
|
# Keep A Changelog!
|
4
2
|
|
5
3
|
See this http://keepachangelog.com link for information on how we want this documented formatted.
|
6
4
|
|
5
|
+
## v4.0.0 (unreleased)
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- New `Lamby.config.app` with default Rack builder.
|
10
|
+
- The `Lamby.command` to simplify `CMD` with the new config.app from above.
|
11
|
+
|
12
|
+
#### Removed
|
13
|
+
|
14
|
+
- All lamby installer templates.
|
15
|
+
- Remove SAM env checks used during debug mode.
|
16
|
+
- Removed showing environment variables in debug mode.
|
17
|
+
- Need to `require: false` when adding the Lamby gem to your `Gemfile`.
|
18
|
+
- Dotenv integration. Use [Crypteia](https://github.com/customink/crypteia) now.
|
19
|
+
|
20
|
+
#### Changed
|
21
|
+
|
22
|
+
- Tested Rack 3.x.
|
23
|
+
|
7
24
|
## v3.1.3
|
8
25
|
|
9
26
|
#### Fixed
|
data/Gemfile.lock
CHANGED
@@ -1,171 +1,176 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lamby (
|
4
|
+
lamby (4.0.0.beta2)
|
5
5
|
rack
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (
|
11
|
-
actionpack (=
|
12
|
-
activesupport (=
|
10
|
+
actioncable (7.0.4)
|
11
|
+
actionpack (= 7.0.4)
|
12
|
+
activesupport (= 7.0.4)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
|
-
actionmailbox (
|
16
|
-
actionpack (=
|
17
|
-
activejob (=
|
18
|
-
activerecord (=
|
19
|
-
activestorage (=
|
20
|
-
activesupport (=
|
15
|
+
actionmailbox (7.0.4)
|
16
|
+
actionpack (= 7.0.4)
|
17
|
+
activejob (= 7.0.4)
|
18
|
+
activerecord (= 7.0.4)
|
19
|
+
activestorage (= 7.0.4)
|
20
|
+
activesupport (= 7.0.4)
|
21
21
|
mail (>= 2.7.1)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
net-imap
|
23
|
+
net-pop
|
24
|
+
net-smtp
|
25
|
+
actionmailer (7.0.4)
|
26
|
+
actionpack (= 7.0.4)
|
27
|
+
actionview (= 7.0.4)
|
28
|
+
activejob (= 7.0.4)
|
29
|
+
activesupport (= 7.0.4)
|
27
30
|
mail (~> 2.5, >= 2.5.4)
|
31
|
+
net-imap
|
32
|
+
net-pop
|
33
|
+
net-smtp
|
28
34
|
rails-dom-testing (~> 2.0)
|
29
|
-
actionpack (
|
30
|
-
actionview (=
|
31
|
-
activesupport (=
|
32
|
-
rack (~> 2.0, >= 2.0
|
35
|
+
actionpack (7.0.4)
|
36
|
+
actionview (= 7.0.4)
|
37
|
+
activesupport (= 7.0.4)
|
38
|
+
rack (~> 2.0, >= 2.2.0)
|
33
39
|
rack-test (>= 0.6.3)
|
34
40
|
rails-dom-testing (~> 2.0)
|
35
41
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
36
|
-
actiontext (
|
37
|
-
actionpack (=
|
38
|
-
activerecord (=
|
39
|
-
activestorage (=
|
40
|
-
activesupport (=
|
42
|
+
actiontext (7.0.4)
|
43
|
+
actionpack (= 7.0.4)
|
44
|
+
activerecord (= 7.0.4)
|
45
|
+
activestorage (= 7.0.4)
|
46
|
+
activesupport (= 7.0.4)
|
47
|
+
globalid (>= 0.6.0)
|
41
48
|
nokogiri (>= 1.8.5)
|
42
|
-
actionview (
|
43
|
-
activesupport (=
|
49
|
+
actionview (7.0.4)
|
50
|
+
activesupport (= 7.0.4)
|
44
51
|
builder (~> 3.1)
|
45
52
|
erubi (~> 1.4)
|
46
53
|
rails-dom-testing (~> 2.0)
|
47
54
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
48
|
-
activejob (
|
49
|
-
activesupport (=
|
55
|
+
activejob (7.0.4)
|
56
|
+
activesupport (= 7.0.4)
|
50
57
|
globalid (>= 0.3.6)
|
51
|
-
activemodel (
|
52
|
-
activesupport (=
|
53
|
-
activerecord (
|
54
|
-
activemodel (=
|
55
|
-
activesupport (=
|
56
|
-
activestorage (
|
57
|
-
actionpack (=
|
58
|
-
activejob (=
|
59
|
-
activerecord (=
|
60
|
-
activesupport (=
|
61
|
-
marcel (~> 1.0
|
62
|
-
mini_mime (
|
63
|
-
activesupport (
|
58
|
+
activemodel (7.0.4)
|
59
|
+
activesupport (= 7.0.4)
|
60
|
+
activerecord (7.0.4)
|
61
|
+
activemodel (= 7.0.4)
|
62
|
+
activesupport (= 7.0.4)
|
63
|
+
activestorage (7.0.4)
|
64
|
+
actionpack (= 7.0.4)
|
65
|
+
activejob (= 7.0.4)
|
66
|
+
activerecord (= 7.0.4)
|
67
|
+
activesupport (= 7.0.4)
|
68
|
+
marcel (~> 1.0)
|
69
|
+
mini_mime (>= 1.1.0)
|
70
|
+
activesupport (7.0.4)
|
64
71
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
65
72
|
i18n (>= 1.6, < 2)
|
66
73
|
minitest (>= 5.1)
|
67
74
|
tzinfo (~> 2.0)
|
68
|
-
zeitwerk (~> 2.3)
|
69
75
|
aws-eventstream (1.2.0)
|
70
|
-
aws-partitions (1.
|
71
|
-
aws-sdk-core (3.
|
76
|
+
aws-partitions (1.660.0)
|
77
|
+
aws-sdk-core (3.167.0)
|
72
78
|
aws-eventstream (~> 1, >= 1.0.2)
|
73
|
-
aws-partitions (~> 1, >= 1.
|
79
|
+
aws-partitions (~> 1, >= 1.651.0)
|
80
|
+
aws-sigv4 (~> 1.5)
|
81
|
+
jmespath (~> 1, >= 1.6.1)
|
82
|
+
aws-sdk-sqs (1.52.0)
|
83
|
+
aws-sdk-core (~> 3, >= 3.165.0)
|
74
84
|
aws-sigv4 (~> 1.1)
|
75
|
-
|
76
|
-
|
77
|
-
aws-sdk-core (~> 3, >= 3.127.0)
|
85
|
+
aws-sdk-ssm (1.144.0)
|
86
|
+
aws-sdk-core (~> 3, >= 3.165.0)
|
78
87
|
aws-sigv4 (~> 1.1)
|
79
|
-
aws-
|
80
|
-
aws-sdk-core (~> 3, >= 3.112.0)
|
81
|
-
aws-sigv4 (~> 1.1)
|
82
|
-
aws-sigv4 (1.4.0)
|
88
|
+
aws-sigv4 (1.5.2)
|
83
89
|
aws-eventstream (~> 1, >= 1.0.2)
|
84
90
|
builder (3.2.4)
|
85
91
|
coderay (1.1.3)
|
86
92
|
concurrent-ruby (1.1.10)
|
87
93
|
crass (1.0.6)
|
88
|
-
erubi (1.
|
94
|
+
erubi (1.11.0)
|
89
95
|
globalid (1.0.0)
|
90
96
|
activesupport (>= 5.0)
|
91
|
-
i18n (1.
|
97
|
+
i18n (1.12.0)
|
92
98
|
concurrent-ruby (~> 1.0)
|
93
99
|
jmespath (1.6.1)
|
94
|
-
lambdakiq (2.
|
100
|
+
lambdakiq (2.1.0)
|
95
101
|
activejob
|
96
102
|
aws-sdk-sqs
|
97
103
|
concurrent-ruby
|
98
104
|
railties
|
99
|
-
loofah (2.
|
105
|
+
loofah (2.19.0)
|
100
106
|
crass (~> 1.0.2)
|
101
107
|
nokogiri (>= 1.5.9)
|
102
108
|
mail (2.7.1)
|
103
109
|
mini_mime (>= 0.1.1)
|
104
|
-
marcel (1.0.
|
110
|
+
marcel (1.0.2)
|
105
111
|
method_source (1.0.0)
|
106
|
-
mini_mime (1.
|
107
|
-
|
108
|
-
minitest (
|
109
|
-
minitest-focus (1.2.1)
|
112
|
+
mini_mime (1.1.2)
|
113
|
+
minitest (5.16.3)
|
114
|
+
minitest-focus (1.3.1)
|
110
115
|
minitest (>= 4, < 6)
|
111
|
-
mocha (
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
116
|
+
mocha (2.0.2)
|
117
|
+
ruby2_keywords (>= 0.0.5)
|
118
|
+
net-imap (0.3.1)
|
119
|
+
net-protocol
|
120
|
+
net-pop (0.1.2)
|
121
|
+
net-protocol
|
122
|
+
net-protocol (0.1.3)
|
123
|
+
timeout
|
124
|
+
net-smtp (0.3.3)
|
125
|
+
net-protocol
|
126
|
+
nio4r (2.5.8)
|
127
|
+
nokogiri (1.13.9-x86_64-linux)
|
117
128
|
racc (~> 1.4)
|
118
129
|
pry (0.14.1)
|
119
130
|
coderay (~> 1.1)
|
120
131
|
method_source (~> 1.0)
|
121
132
|
racc (1.6.0)
|
122
|
-
rack (2.2.
|
123
|
-
rack-test (
|
124
|
-
rack (>= 1.
|
125
|
-
rails (
|
126
|
-
actioncable (=
|
127
|
-
actionmailbox (=
|
128
|
-
actionmailer (=
|
129
|
-
actionpack (=
|
130
|
-
actiontext (=
|
131
|
-
actionview (=
|
132
|
-
activejob (=
|
133
|
-
activemodel (=
|
134
|
-
activerecord (=
|
135
|
-
activestorage (=
|
136
|
-
activesupport (=
|
133
|
+
rack (2.2.4)
|
134
|
+
rack-test (2.0.2)
|
135
|
+
rack (>= 1.3)
|
136
|
+
rails (7.0.4)
|
137
|
+
actioncable (= 7.0.4)
|
138
|
+
actionmailbox (= 7.0.4)
|
139
|
+
actionmailer (= 7.0.4)
|
140
|
+
actionpack (= 7.0.4)
|
141
|
+
actiontext (= 7.0.4)
|
142
|
+
actionview (= 7.0.4)
|
143
|
+
activejob (= 7.0.4)
|
144
|
+
activemodel (= 7.0.4)
|
145
|
+
activerecord (= 7.0.4)
|
146
|
+
activestorage (= 7.0.4)
|
147
|
+
activesupport (= 7.0.4)
|
137
148
|
bundler (>= 1.15.0)
|
138
|
-
railties (=
|
139
|
-
sprockets-rails (>= 2.0.0)
|
149
|
+
railties (= 7.0.4)
|
140
150
|
rails-dom-testing (2.0.3)
|
141
151
|
activesupport (>= 4.2.0)
|
142
152
|
nokogiri (>= 1.6)
|
143
|
-
rails-html-sanitizer (1.4.
|
153
|
+
rails-html-sanitizer (1.4.3)
|
144
154
|
loofah (~> 2.3)
|
145
|
-
railties (
|
146
|
-
actionpack (=
|
147
|
-
activesupport (=
|
155
|
+
railties (7.0.4)
|
156
|
+
actionpack (= 7.0.4)
|
157
|
+
activesupport (= 7.0.4)
|
148
158
|
method_source
|
149
|
-
rake (>=
|
159
|
+
rake (>= 12.2)
|
150
160
|
thor (~> 1.0)
|
161
|
+
zeitwerk (~> 2.5)
|
151
162
|
rake (13.0.6)
|
152
|
-
|
153
|
-
concurrent-ruby (~> 1.0)
|
154
|
-
rack (> 1, < 3)
|
155
|
-
sprockets-rails (3.2.2)
|
156
|
-
actionpack (>= 4.0)
|
157
|
-
activesupport (>= 4.0)
|
158
|
-
sprockets (>= 3.0.0)
|
163
|
+
ruby2_keywords (0.0.5)
|
159
164
|
thor (1.2.1)
|
160
|
-
|
165
|
+
timeout (0.3.0)
|
166
|
+
tzinfo (2.0.5)
|
161
167
|
concurrent-ruby (~> 1.0)
|
162
|
-
websocket-driver (0.7.
|
168
|
+
websocket-driver (0.7.5)
|
163
169
|
websocket-extensions (>= 0.1.0)
|
164
170
|
websocket-extensions (0.1.5)
|
165
|
-
zeitwerk (2.
|
171
|
+
zeitwerk (2.6.6)
|
166
172
|
|
167
173
|
PLATFORMS
|
168
|
-
ruby
|
169
174
|
x86_64-linux
|
170
175
|
|
171
176
|
DEPENDENCIES
|
@@ -181,4 +186,4 @@ DEPENDENCIES
|
|
181
186
|
rake
|
182
187
|
|
183
188
|
BUNDLED WITH
|
184
|
-
2.
|
189
|
+
2.3.7
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
# Lamby [![Actions Status](https://github.com/customink/lamby/workflows/CI/CD/badge.svg)](https://github.com/customink/lamby/actions)
|
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
|
-
<h2>Simple Rails & AWS Lambda Integration</h2>
|
3
|
+
<h2>Simple Rails & AWS Lambda Integration using Rack</h2>
|
4
4
|
|
5
|
-
|
5
|
+
Lamby is an [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter) for Rack applications.
|
6
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
8
|
|
9
9
|
The goal of this project is to provide minimal code to allow your Rails application to respond to incoming [AWS Lambda Function Handler in Ruby](https://docs.aws.amazon.com/lambda/latest/dg/ruby-handler.html) `event` and `context` objects in the Lambda handler. We support Application Load Balancer integration or API Gateway.
|
10
10
|
|
@@ -24,16 +24,19 @@ https://lamby.custominktech.com/docs/installing_aws_sam
|
|
24
24
|
|
25
25
|
## Contributing
|
26
26
|
|
27
|
-
|
27
|
+
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.
|
28
28
|
|
29
29
|
```shell
|
30
|
-
$ ./bin/bootstrap
|
31
30
|
$ ./bin/setup
|
32
31
|
$ ./bin/test
|
33
32
|
```
|
34
33
|
|
35
|
-
|
34
|
+
#### Using VS Code
|
35
|
+
|
36
|
+
If you have the [Visual Studio Code Dev Container](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension installed you can easily clone this repo locally, use the "Open Folder in Container..." command. This allows you to use the integrated terminal for the commands above.
|
36
37
|
|
37
38
|
## Code of Conduct
|
38
39
|
|
39
40
|
Everyone interacting in the Lamby project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/customink/lamby/blob/master/CODE_OF_CONDUCT.md).
|
41
|
+
|
42
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/customink/lamby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/bin/bootstrap
CHANGED
data/bin/setup
CHANGED
data/bin/test
CHANGED
data/bin/update
CHANGED
data/images/social.png
ADDED
Binary file
|
data/images/social2.png
ADDED
Binary file
|
data/lib/lamby/config.rb
CHANGED
@@ -31,7 +31,16 @@ module Lamby
|
|
31
31
|
self
|
32
32
|
end
|
33
33
|
|
34
|
+
def rack_app
|
35
|
+
@rack_app ||= Rack::Builder.new { run Rails.application }.to_app
|
36
|
+
end
|
37
|
+
|
38
|
+
def rack_app=(app)
|
39
|
+
@rack_app = app
|
40
|
+
end
|
41
|
+
|
34
42
|
def initialize_defaults
|
43
|
+
@rack_app = nil
|
35
44
|
@event_bridge_handler = lambda { |event, context| puts(event) }
|
36
45
|
end
|
37
46
|
|
data/lib/lamby/debug.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
module Lamby
|
2
2
|
module Debug
|
3
|
-
include Lamby::SamHelpers
|
4
|
-
|
5
3
|
extend self
|
6
4
|
|
7
5
|
def on?(event)
|
@@ -33,10 +31,6 @@ module Lamby
|
|
33
31
|
<code>
|
34
32
|
#{CGI::escapeHTML(context.inspect)}
|
35
33
|
</code>
|
36
|
-
<h2>Environment</h2>
|
37
|
-
<pre>
|
38
|
-
#{sam_local? ? JSON.pretty_generate(ENV.to_h) : 'N/A'}
|
39
|
-
</pre>
|
40
34
|
</body>
|
41
35
|
</html>
|
42
36
|
HTML
|
data/lib/lamby/logger.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
require 'logger'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
ENV['RAILS_LOG_TO_STDOUT'] = '1'
|
3
|
+
if ENV['AWS_EXECUTION_ENV']
|
4
|
+
ENV['RAILS_LOG_TO_STDOUT'] = '1'
|
6
5
|
|
7
6
|
module Lamby
|
8
7
|
module Logger
|
@@ -15,13 +14,5 @@ unless ENV['LAMBY_TEST']
|
|
15
14
|
end
|
16
15
|
end
|
17
16
|
|
18
|
-
Logger.prepend Lamby::Logger
|
19
|
-
|
17
|
+
Logger.prepend Lamby::Logger unless ENV['LAMBY_TEST']
|
20
18
|
end
|
21
|
-
|
22
|
-
# TODO: Railtie initializer
|
23
|
-
# Rails.application.config.logger = ActiveSupport::TaggedLogging.new(
|
24
|
-
# ActiveSupport::Logger.new(STDOUT).tap { |logger|
|
25
|
-
# logger.formatter = Rails.application.config.log_formatter
|
26
|
-
# }
|
27
|
-
# )
|
data/lib/lamby/rack.rb
CHANGED
data/lib/lamby/railtie.rb
CHANGED
data/lib/lamby/version.rb
CHANGED
data/lib/lamby.rb
CHANGED
@@ -3,7 +3,6 @@ require 'rack'
|
|
3
3
|
require 'base64'
|
4
4
|
require 'lamby/version'
|
5
5
|
require 'lamby/config'
|
6
|
-
require 'lamby/sam_helpers'
|
7
6
|
require 'lamby/rack'
|
8
7
|
require 'lamby/rack_alb'
|
9
8
|
require 'lamby/rack_rest'
|
@@ -21,6 +20,10 @@ module Lamby
|
|
21
20
|
|
22
21
|
extend self
|
23
22
|
|
23
|
+
def command(event, context)
|
24
|
+
handler(config.app, event, context)
|
25
|
+
end
|
26
|
+
|
24
27
|
def handler(app, event, context, options = {})
|
25
28
|
Handler.call(app, event, context, options)
|
26
29
|
end
|