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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 696967ba3abfedddbda0e683362d427de688f725183a8e3c9bf74f256b722bbb
4
- data.tar.gz: 5d2503c1f0d3865fef3a732ede95cc26e37bd59745af50e6a518edd6d0842fcb
3
+ metadata.gz: df8aad50611a9b82888115c9af6e6706c34e80970c6ecbed8e15b49b4c89b0f3
4
+ data.tar.gz: 1f3719f831f68dff1f34350113b1bd3e8fd39300c4e85b9d37d678ebe8963b43
5
5
  SHA512:
6
- metadata.gz: a89fedbed8aac8eedc1754c2298a05a62d6df54ddd2af4c2e4fc0ba2070413d858043aaddf752c5627db7fb94010285fe629ca9bcafd4d03d6bfc6b0ff6da2ae
7
- data.tar.gz: 8d1b49a43c036e2f4597bdb70b0b34e9a1008acb4e654639211d99ac65d18d0dcdad1e3338fa790edf8b3c0ee51355d5af000c654025fba1ae6ee84c4cd5a827
6
+ metadata.gz: f0aa56114e007f96d3a75a2efb377b7caf1d9ace2a439e6c251c8f41e427009f804253dff5576765695d9ad4c2311e205aa49c783b6012e45db13e0f61a7f4c1
7
+ data.tar.gz: 8f5838019e28c672c82c795e4720896fc3c984be1237c5b9a4d4bacf5cea8280b40b90f923a39059c9eb48767ae5dadf6095c86c72222c8432fa87459998343f
@@ -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
 
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.6.5)
14
+ jets (1.6.6)
15
15
  activerecord (~> 5.2.1)
16
16
  activesupport (~> 5.2.1)
17
17
  aws-sdk-apigateway
@@ -13,6 +13,7 @@ require "rainbow/ext/string"
13
13
 
14
14
  module Jets
15
15
  RUBY_VERSION = "2.5.3"
16
+ class Error < StandardError; end
16
17
 
17
18
  autoload :Application, "jets/application"
18
19
  autoload :AwsInfo, "jets/aws_info"
@@ -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.sub(/{(.*)\+}/, '*\1')
47
- path.sub(/{(.*)}/, ':\1')
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.sub('/','-').gsub(/[^0-9a-z\-_]/i, '') + "-#{@task.meth}"
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.
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.6.5"
2
+ VERSION = "1.6.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.5
4
+ version: 1.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen