jets 1.0.9 → 1.0.10

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: 77b7246e3883262eaefb30035b4774932787746803608ff1ba2be057734b3f46
4
- data.tar.gz: 8b6dabcf954f5b6e0a69fa8316c549ca8609ef87df68cc7821d332a2bf33f2ba
3
+ metadata.gz: e41a3fdeb291eedb2771d5d1cd010c9be86a7043b34ae71390be68ddd470e7d5
4
+ data.tar.gz: fb24de66b30c661192cf9bd0fab893ac375e39d051187b3152fb7cabdbf811f3
5
5
  SHA512:
6
- metadata.gz: 2b3af6d8eac8f0db17953148c53bbcc226e7742f787e2ff020f96caacb8834b1f1430a7c3c80748728dce56e9697e5021d432bb5293648cf5147a2297bb5a42e
7
- data.tar.gz: f20ba90e2e74c06a89751e2fffcc9d3d84315a58720ed3c7e1fb15539617ede91f9929a94d11fb6ed4f9b8a71b1a0dd74501d4365a340f6617515bb51e1322c6
6
+ metadata.gz: 38da5ea789310b9fde72fec2e62ee6d6af304b475c867e80fdc325eae62ffddafebabda7d4136c7102f1507a04396a448a9912dcb501a654b7e655f435e004d5
7
+ data.tar.gz: 6497099f9e8b55413eb58636958b3141fc7b8fb9e3b0c53e8774b015f293c3835a23fbbafe8ac021ad1a48ad74d19d11ac0db1c63053c9ea37ad8f93e82c7271
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.0.10]
7
+ - remove emoji from skeleton index.html starter
8
+
6
9
  ## [1.0.9]
7
10
  - adjust starter .env.development and config/application.rb
8
11
 
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.0.9)
14
+ jets (1.0.10)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -97,7 +97,7 @@ GEM
97
97
  builder (3.2.3)
98
98
  byebug (10.0.2)
99
99
  colorize (0.8.1)
100
- concurrent-ruby (1.0.5)
100
+ concurrent-ruby (1.1.1)
101
101
  crass (1.0.4)
102
102
  diff-lcs (1.3)
103
103
  dotenv (2.5.0)
@@ -66,7 +66,7 @@
66
66
  <div class="container">
67
67
  <header class="header">
68
68
  <img src="https://s3.amazonaws.com/jets-public/jets/images/jets.png" class="logo" alt="logo" />
69
- <h1 class="title">Welcome and congrats 🎉<br /> Jets is running.</h1>
69
+ <h1 class="title">Welcome and congrats!<br /> Jets is running.</h1>
70
70
  </header>
71
71
  <div class="intro">
72
72
  <p>
@@ -7,9 +7,10 @@ class Jets::Server
7
7
  def initialize(route, env)
8
8
  @route = route
9
9
  @env = env
10
- # @env.each do |k,v|
11
- # puts "#{k}: #{v}"
12
- # end
10
+ puts "Rack env:".colorize(:yellow)
11
+ @env.each do |k,v|
12
+ puts "#{k}: #{v}"
13
+ end
13
14
  end
14
15
 
15
16
  def response
@@ -33,7 +34,7 @@ class Jets::Server
33
34
 
34
35
  def build_event
35
36
  resource = @route.path(:api_gateway) # posts/{id}/edit
36
- path = @env['PATH_INFO'].sub('/','') # remove beginning space
37
+ path = @env['PATH_INFO'].sub('/','') # remove beginning slash
37
38
  {
38
39
  "resource" => "/#{resource}", # "/posts/{id}/edit"
39
40
  "path" => @env['PATH_INFO'], # /posts/tung/edit
@@ -62,6 +63,23 @@ class Jets::Server
62
63
  "Upgrade-Insecure-Requests" => "upgrade-insecure-requests",
63
64
  }
64
65
 
66
+ # Map rack env headers to Api Gateway event headers. Most rack env headers are
67
+ # prepended by HTTP_.
68
+ #
69
+ # Some API Gateway Lambda Proxy are also in the rack env headers. Example:
70
+ #
71
+ # "X-Amz-Cf-Id": "W8DF6J-lx1bkV00eCiBwIq5dldTSGGiG4BinJlxvN_4o8fCZtbsVjw==",
72
+ # "X-Amzn-Trace-Id": "Root=1-5a0dc1ac-58a7db712a57d6aa4186c2ac",
73
+ # "X-Forwarded-For": "88.88.88.88, 54.239.203.117",
74
+ # "X-Forwarded-Port": "443",
75
+ # "X-Forwarded-Proto": "https",
76
+ #
77
+ # For sample dump of the event headers, check out:
78
+ # spec/fixtures/samples/event-headers-form-post.json
79
+ #
80
+ # We generally do add those API Gateway Lambda specific headers because
81
+ # they would be fake anyway and by not adding them we can distinguish a
82
+ # local request from a remote request on API Gateway.
65
83
  def request_headers
66
84
  headers = @env.select { |k,v| k =~ /^HTTP_/ }.inject({}) do |h,(k,v)|
67
85
  # map things like HTTP_USER_AGENT to "User-Agent"
@@ -79,23 +97,12 @@ class Jets::Server
79
97
  end
80
98
  end
81
99
 
82
- # Way to fake X-Amzn-Trace-Id which on_aws? helper checks
100
+ # Way to fake X-Amzn-Trace-Id which on_aws? helper checks.
101
+ # This is how we distinguish a request from API gateway vs local.
83
102
  if ENV['JETS_ON_AWS']
84
103
  headers["X-Amzn-Trace-Id"] = "Root=fake-trace-id"
85
104
  end
86
105
 
87
- # There are also a couple of other headers that are specific to
88
- # AWS Lambda Proxy and API Gateway. Example:
89
- #
90
- # "X-Amz-Cf-Id": "W8DF6J-lx1bkV00eCiBwIq5dldTSGGiG4BinJlxvN_4o8fCZtbsVjw==",
91
- # "X-Amzn-Trace-Id": "Root=1-5a0dc1ac-58a7db712a57d6aa4186c2ac",
92
- # "X-Forwarded-For": "88.88.88.88, 54.239.203.117",
93
- # "X-Forwarded-Port": "443",
94
- # "X-Forwarded-Proto": "https",
95
- #
96
- # For sample dump of the event headers, check out:
97
- # spec/fixtures/samples/event-headers-form-post.json
98
-
99
106
  headers
100
107
  end
101
108
 
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.0.9"
2
+ VERSION = "1.0.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-04 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack