jets 1.6.5 → 1.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/lib/jets.rb +1 -0
- data/lib/jets/controller/rendering/rack_renderer.rb +5 -0
- data/lib/jets/resource/api_gateway/domain_name.rb +4 -1
- data/lib/jets/resource/api_gateway/rest_api/routes/change/base.rb +2 -2
- data/lib/jets/resource/lambda/function.rb +1 -1
- data/lib/jets/util.rb +14 -0
- data/lib/jets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df8aad50611a9b82888115c9af6e6706c34e80970c6ecbed8e15b49b4c89b0f3
|
4
|
+
data.tar.gz: 1f3719f831f68dff1f34350113b1bd3e8fd39300c4e85b9d37d678ebe8963b43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0aa56114e007f96d3a75a2efb377b7caf1d9ace2a439e6c251c8f41e427009f804253dff5576765695d9ad4c2311e205aa49c783b6012e45db13e0f61a7f4c1
|
7
|
+
data.tar.gz: 8f5838019e28c672c82c795e4720896fc3c984be1237c5b9a4d4bacf5cea8280b40b90f923a39059c9eb48767ae5dadf6095c86c72222c8432fa87459998343f
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,13 @@
|
|
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.6.6]
|
7
|
+
- #175 Fix invalid route changes reading routine when route contains more than one variable in path
|
8
|
+
- #175 Fix invalid lambda function names for controllers in deep namespaces like A::B::MyController
|
9
|
+
- #176 fix cors for specific domains
|
10
|
+
- #177 check if rsync is installed. also stop on sh fail
|
11
|
+
- #178 strip trailing period from custom domain if accidentally set
|
12
|
+
|
6
13
|
## [1.6.5]
|
7
14
|
- #173 application/xml content-type on render xml
|
8
15
|
|
data/Gemfile.lock
CHANGED
data/lib/jets.rb
CHANGED
@@ -193,6 +193,11 @@ module Jets::Controller::Rendering
|
|
193
193
|
"Access-Control-Allow-Origin" => "*", # Required for CORS support to work
|
194
194
|
"Access-Control-Allow-Credentials" => "true" # Required for cookies, authorization headers with HTTPS
|
195
195
|
}
|
196
|
+
when String
|
197
|
+
{
|
198
|
+
"Access-Control-Allow-Origin" => Jets.config.cors, # contains Hash with Access-Control-Allow-* values
|
199
|
+
"Access-Control-Allow-Credentials" => "true" # Required for cookies, authorization headers with HTTPS
|
200
|
+
}
|
196
201
|
when Hash
|
197
202
|
Jets.config.cors # contains Hash with Access-Control-Allow-* values
|
198
203
|
else
|
@@ -42,7 +42,10 @@ module Jets::Resource::ApiGateway
|
|
42
42
|
def domain_name
|
43
43
|
subdomain = Jets.project_namespace
|
44
44
|
managed_domain_name = "#{subdomain}.#{Jets.config.domain.hosted_zone_name}"
|
45
|
-
Jets.config.domain.name || managed_domain_name
|
45
|
+
name = Jets.config.domain.name || managed_domain_name
|
46
|
+
# Strip trailing period if there is one set accidentally or else get this error
|
47
|
+
# Trailing period should be omitted from domain name (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException
|
48
|
+
name.sub(/\.$/,'')
|
46
49
|
end
|
47
50
|
|
48
51
|
def endpoint_types
|
@@ -43,8 +43,8 @@ class Jets::Resource::ApiGateway::RestApi::Routes::Change
|
|
43
43
|
|
44
44
|
def recreate_path(path)
|
45
45
|
path = path.gsub(%r{^/},'')
|
46
|
-
path = path.
|
47
|
-
path.
|
46
|
+
path = path.gsub(/{([^}]*)\+}/, '*\1')
|
47
|
+
path.gsub(/{([^}]*)}/, ':\1')
|
48
48
|
end
|
49
49
|
|
50
50
|
def to(resource_id, http_method)
|
@@ -196,7 +196,7 @@ module Jets::Resource::Lambda
|
|
196
196
|
# method: admin/pages_controller
|
197
197
|
# method: admin-pages_controller-index
|
198
198
|
method = @app_class.underscore
|
199
|
-
method = method.
|
199
|
+
method = method.gsub('/','-').gsub(/[^0-9a-z\-_]/i, '') + "-#{@task.meth}"
|
200
200
|
function_name = "#{Jets.config.project_namespace}-#{method}"
|
201
201
|
# Returns nil if function name is too long.
|
202
202
|
# CloudFormation will managed the the function name in this case.
|
data/lib/jets/util.rb
CHANGED
@@ -13,12 +13,26 @@ class Jets::Util
|
|
13
13
|
# Using rsync to perform the copy.
|
14
14
|
src.chop! if src.ends_with?('/')
|
15
15
|
dest.chop! if dest.ends_with?('/')
|
16
|
+
check_rsync_installed!
|
16
17
|
sh "rsync -a --links --no-specials --no-devices #{src}/ #{dest}/", quiet: true
|
17
18
|
end
|
18
19
|
|
20
|
+
@@rsync_installed = false
|
21
|
+
def check_rsync_installed!
|
22
|
+
return if @@rsync_installed # only check once
|
23
|
+
if system "type rsync > /dev/null 2>&1"
|
24
|
+
@@rsync_installed = true
|
25
|
+
else
|
26
|
+
raise Jets::Error.new("Rsync is required. Rsync does not seem to be installed.")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
19
30
|
def sh(command, quiet: false)
|
20
31
|
puts "=> #{command}" unless quiet
|
21
32
|
system(command)
|
33
|
+
success = $?.success?
|
34
|
+
raise Jets::Error.new("Command failed: #{command}") unless success
|
35
|
+
success
|
22
36
|
end
|
23
37
|
end
|
24
38
|
end
|
data/lib/jets/version.rb
CHANGED