jets 1.4.3 → 1.4.4
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/jets/application.rb +1 -1
- data/lib/jets/cfn/upload.rb +6 -6
- data/lib/jets/commands/templates/skeleton/config/application.rb.tt +3 -2
- data/lib/jets/overrides/rails/asset_tag_helper.rb +7 -0
- data/lib/jets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b42f210be712ede74491d7b1b377d5e742405e2a4f226b07e4dd6709cc76f191
|
4
|
+
data.tar.gz: 97d7f47d8d600d9b86ecf19390c055101e887fc2afe30d004b4e17b61f62bd57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6368f3cca7ffd7303e5b1bbbf055e4b0aab97f29dad3e4e4f79c77980260ff6bfcea91248481068ca0a8962623da4d4db9a5c4ba04b0142dd46cc67184843ed2
|
7
|
+
data.tar.gz: e17af44278ad7ed8f7f6a65f88d3aef0c3bfa465389bf07e6463d5e1c42cd3701bb20538ced03f15d10efc69bcdca008f9f0cbf4a13021311f83f0183b9b3467
|
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.4.4]
|
7
|
+
- #116 from tongueroo/assets: fix public assets folders to serve directly from s3
|
8
|
+
|
6
9
|
## [1.4.3]
|
7
10
|
- fix webpacker:compile on jets build and allow jets deploy to work standalone
|
8
11
|
|
data/Gemfile.lock
CHANGED
data/lib/jets/application.rb
CHANGED
@@ -59,7 +59,7 @@ class Jets::Application
|
|
59
59
|
config.inflections.irregular = {}
|
60
60
|
|
61
61
|
config.assets = ActiveSupport::OrderedOptions.new
|
62
|
-
config.assets.folders = %w[
|
62
|
+
config.assets.folders = %w[assets images packs]
|
63
63
|
config.assets.base_url = nil # IE: https://cloudfront.com/my/base/path
|
64
64
|
config.assets.max_age = 3600
|
65
65
|
config.assets.cache_control = nil # IE: public, max-age=3600 , max_age is a shorter way to set cache_control.
|
data/lib/jets/cfn/upload.rb
CHANGED
@@ -57,16 +57,16 @@ class Jets::Cfn
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def upload_public_assets
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
public_folders = %w[public]
|
61
|
+
public_folders = add_rack_assets(public_folders)
|
62
|
+
public_folders.each do |folder|
|
63
63
|
upload_asset_folder(folder)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
def add_rack_assets(
|
68
|
-
return
|
69
|
-
|
67
|
+
def add_rack_assets(public_folders)
|
68
|
+
return public_folders unless Jets.rack?
|
69
|
+
public_folders + %w[rack/public]
|
70
70
|
end
|
71
71
|
|
72
72
|
def upload_asset_folder(folder)
|
@@ -36,8 +36,9 @@ Jets.application.configure do
|
|
36
36
|
# Underscored format can be used for keys to make it look more ruby-ish.
|
37
37
|
|
38
38
|
# Assets settings
|
39
|
-
# config.assets.folders
|
40
|
-
#
|
39
|
+
# The config.assets.folders are folders within the public folder that will be set
|
40
|
+
# to public-read on s3 and served directly. IE: public/assets public/images public/packs
|
41
|
+
# config.assets.folders = %w[assets images packs]
|
41
42
|
# config.assets.max_age = 3600 # when to expire assets
|
42
43
|
# config.assets.cache_control = nil # IE: "public, max-age=3600" # override max_age for more fine-grain control.
|
43
44
|
# config.assets.base_url = nil # IE: https://cloudfront.com/my/base/path, defaults to the s3 bucket url
|
@@ -39,6 +39,13 @@ module Jets::AssetTagHelper
|
|
39
39
|
# mimic original behavior to get /images in source
|
40
40
|
source = "/images/#{source}" unless source.starts_with?('/') || source.starts_with?('http')
|
41
41
|
|
42
|
+
# Examples to help understand:
|
43
|
+
#
|
44
|
+
# puts "AssetTagHelper#asset_path source #{source}"
|
45
|
+
# puts "AssetTagHelper#asset_path asset_folder?(source) #{asset_folder?(source).inspect}"
|
46
|
+
# AssetTagHelper#asset_path source /packs/images/myimage-e5f675d1ba26865fd65e919beb5bb86b.png
|
47
|
+
# AssetTagHelper#asset_path asset_folder?(source) "images"
|
48
|
+
#
|
42
49
|
if on_aws? && asset_folder?(source) && !source.starts_with?('http')
|
43
50
|
source = "#{s3_public}#{source}"
|
44
51
|
end
|
data/lib/jets/version.rb
CHANGED
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.4.
|
4
|
+
version: 1.4.4
|
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-12-
|
11
|
+
date: 2018-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|