jammit-s3 0.5.4.1 → 0.5.4.2

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.
Files changed (3) hide show
  1. data/jammit-s3.gemspec +1 -1
  2. data/lib/jammit-s3.rb +5 -4
  3. metadata +4 -4
data/jammit-s3.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jammit-s3'
3
- s.version = '0.5.4.1'
3
+ s.version = '0.5.4.2'
4
4
 
5
5
  s.homepage = "http://documentcloud.github.com/jammit/"
6
6
  s.summary = "Asset Packaging for Rails with Deployment to S3/Cloudfront"
data/lib/jammit-s3.rb CHANGED
@@ -13,15 +13,16 @@ if defined?(Rails)
13
13
  class JammitRailtie < Rails::Railtie
14
14
  initializer "set asset host and asset id" do
15
15
  config.after_initialize do
16
- protocol = Jammit.configuration[:ssl] ? "https" : "http"
17
16
  if Jammit.configuration[:use_cloudfront] && Jammit.configuration[:cloudfront_domain].present?
18
- asset_hostname = "#{protocol}://#{Jammit.configuration[:cloudfront_domain]}"
17
+ asset_hostname = Jammit.configuration[:cloudfront_domain]
19
18
  else
20
- asset_hostname = "#{protocol}://#{Jammit.configuration[:s3_bucket]}.s3.amazonaws.com"
19
+ asset_hostname = "#{Jammit.configuration[:s3_bucket]}.s3.amazonaws.com"
21
20
  end
22
21
 
23
22
  if Jammit.package_assets and asset_hostname.present?
24
- ActionController::Base.asset_host = asset_hostname
23
+ ActionController::Base.asset_host = Proc.new do |source, request|
24
+ "#{Jammit.configuration[:ssl] || request.protocol}://#{asset_hostname}"
25
+ end
25
26
  end
26
27
  end
27
28
  end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 5
8
8
  - 4
9
- - 1
10
- version: 0.5.4.1
9
+ - 2
10
+ version: 0.5.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jacques Crocker
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- hash: 4560565667654219258
95
+ hash: 543481238828431748
96
96
  segments:
97
97
  - 0
98
98
  version: "0"
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
- hash: 4560565667654219258
104
+ hash: 543481238828431748
105
105
  segments:
106
106
  - 0
107
107
  version: "0"