jets 1.4.3 → 1.4.4

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: 8c7b4bf4a3af04ba9de3ddafc8e8483303c50eca8cddc28cb70830eb941bde6a
4
- data.tar.gz: 38a3ee6c6fabd939ae3f4ab76639363c3cce222ff85f080cffb7f4652bc3a9e7
3
+ metadata.gz: b42f210be712ede74491d7b1b377d5e742405e2a4f226b07e4dd6709cc76f191
4
+ data.tar.gz: 97d7f47d8d600d9b86ecf19390c055101e887fc2afe30d004b4e17b61f62bd57
5
5
  SHA512:
6
- metadata.gz: 30b7009d55779a5aa79d4d72b760dc1cfaba6b363112ae30c4e4504df145f6e3acd075a93ddccc9608a5d0f0549c5dbe5ac925e21cbdeb07f907c79135649d1a
7
- data.tar.gz: 3981e12eb19f182d874915b17510c31fe03b5107bbc35d8ee1c097e15d5e534e9ddbf95ecd16c3ae8720f645faa6e649fec3d913535d0d48edf13f12355b95e7
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
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.4.3)
14
+ jets (1.4.4)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -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[public]
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.
@@ -57,16 +57,16 @@ class Jets::Cfn
57
57
  end
58
58
 
59
59
  def upload_public_assets
60
- asset_folders = Jets.config.assets.folders # IE: %w[public]
61
- asset_folders = add_rack_assets(asset_folders)
62
- asset_folders.each do |folder|
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(asset_folders)
68
- return asset_folders unless Jets.rack?
69
- asset_folders + %w[rack/public]
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 files are uploaded to s3 and are set to public-read to be served directly
40
- # config.assets.folders = %w[public] # defaults to public
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
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.4.3"
2
+ VERSION = "1.4.4"
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.4.3
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-23 00:00:00.000000000 Z
11
+ date: 2018-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack