lamby 3.0.1 → 3.1.1

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: 95f582ba749eea50ebb7f2ff2dd334ad6a492c0ec533d27b447fd276b9cc1b1f
4
- data.tar.gz: 7de58022400c1ebfec03ee746afd1f16fbe72bb2dcd70814499014ff186324e8
3
+ metadata.gz: 2ce831b5763fdf703c2dee815561117aaa3f437655f6633de363f4464f123fd4
4
+ data.tar.gz: ea61014f1f2ce8ce009f2a1818578bb012309f568b5e3443cc1bbc6bf5b50ab6
5
5
  SHA512:
6
- metadata.gz: b97cb42a10c869075b5c14c3e4637d78ccf910107f457efc961ecc97227d2b860f194b70d202f0dba4edb5ca2c281e54b64d0da882a3c5dce3abbbe77d4db1b8
7
- data.tar.gz: 685641d6d4e144d80fff5dce2e5f849e263224fff427766344324643fefade7cc99c83e3cac956574dc24d2307241357e47225b970ed37582c306f3a1f4ce546
6
+ metadata.gz: b0a13fbb2a30b8970900275554df0b915a32f93352e4596df9c202dcb307bcbb1a45fc5afe7cc755306003e7e5633fcb38de119a7a35355f20a3db05adc90e5d
7
+ data.tar.gz: 1455fbdcddc869a920f2f65a3a0d6df5c536d2fa4e1136cb8cf0e46733b33b35012b01dc93c5c15b026d5ad1fee59c0a9e4bacb08673e1f7338044542432a580
data/CHANGELOG.md CHANGED
@@ -4,6 +4,30 @@
4
4
 
5
5
  See this http://keepachangelog.com link for information on how we want this documented formatted.
6
6
 
7
+ ## v3.1.1
8
+
9
+ #### Fixed
10
+
11
+ - X-Request-Start header value for New Relic with API Gateway.
12
+
13
+ ## v3.1.0
14
+
15
+ #### Added
16
+
17
+ - Add X-Request-Start header for New Relic with API Gateway.
18
+
19
+ ## v3.0.3
20
+
21
+ #### Fixed
22
+
23
+ - Ruby 2.7 Warnings | Logger. Thanks @jessedoyle
24
+
25
+ ## v3.0.2
26
+
27
+ #### Added
28
+
29
+ - Runner now returns STDOUT/STDERR as body.
30
+
7
31
  ## v3.0.1
8
32
 
9
33
  #### Fixed
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM lambci/lambda:build-ruby2.7
1
+ FROM public.ecr.aws/sam/build-ruby2.7:1.26.0
2
2
 
3
3
  # Asset Pipeline
4
4
  RUN curl -sL https://rpm.nodesource.com/setup_12.x | bash - && \
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lamby (3.0.1)
4
+ lamby (3.1.1)
5
5
  rack
6
6
 
7
7
  GEM
data/bin/bootstrap CHANGED
@@ -2,5 +2,4 @@
2
2
  set -e
3
3
 
4
4
  echo '== Building containers =='
5
- docker pull lambci/lambda:build-ruby2.7
6
5
  docker-compose build
data/lib/lamby/logger.rb CHANGED
@@ -7,9 +7,9 @@ unless ENV['LAMBY_TEST']
7
7
  module Lamby
8
8
  module Logger
9
9
 
10
- def initialize(*args)
10
+ def initialize(*args, **kwargs)
11
11
  args[0] = STDOUT
12
- super(*args)
12
+ super(*args, **kwargs)
13
13
  end
14
14
 
15
15
  end
data/lib/lamby/rack.rb CHANGED
@@ -6,6 +6,7 @@ module Lamby
6
6
  LAMBDA_EVENT = 'lambda.event'.freeze
7
7
  LAMBDA_CONTEXT = 'lambda.context'.freeze
8
8
  HTTP_X_REQUESTID = 'HTTP_X_REQUEST_ID'.freeze
9
+ HTTP_X_REQUEST_START = 'HTTP_X_REQUEST_START'.freeze
9
10
  HTTP_COOKIE = 'HTTP_COOKIE'.freeze
10
11
 
11
12
  class << self
@@ -54,6 +55,7 @@ module Lamby
54
55
  "HTTP_#{key.to_s.upcase.tr '-', '_'}"
55
56
  end.tap do |hdrs|
56
57
  hdrs[HTTP_X_REQUESTID] = request_id
58
+ hdrs[HTTP_X_REQUEST_START] = "t=#{request_start}" if request_start
57
59
  end
58
60
  end
59
61
 
@@ -109,5 +111,10 @@ module Lamby
109
111
  context.aws_request_id
110
112
  end
111
113
 
114
+ def request_start
115
+ event.dig('requestContext', 'timeEpoch') ||
116
+ event.dig('requestContext', 'requestTimeEpoch')
117
+ end
118
+
112
119
  end
113
120
  end
data/lib/lamby/runner.rb CHANGED
@@ -23,16 +23,18 @@ module Lamby
23
23
 
24
24
  def initialize(event)
25
25
  @event = event
26
+ @body = ''
26
27
  end
27
28
 
28
29
  def call
29
30
  validate!
30
31
  status = Open3.popen3(command, chdir: chdir) do |_stdin, stdout, stderr, thread|
31
- puts stdout.read
32
- puts stderr.read
32
+ @body << stdout.read
33
+ @body << stderr.read
34
+ puts @body
33
35
  thread.value.exitstatus
34
36
  end
35
- [status, {}, StringIO.new('')]
37
+ [status, {}, StringIO.new(@body)]
36
38
  end
37
39
 
38
40
  def command
data/lib/lamby/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lamby
2
- VERSION = '3.0.1'
2
+ VERSION = '3.1.1'
3
3
  end
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: 3.0.1
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-25 00:00:00.000000000 Z
11
+ date: 2021-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack