foresth-cloudfront_asset_host 1.0.3.1 → 1.0.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.
data/Rakefile CHANGED
@@ -25,11 +25,11 @@ end
25
25
  begin
26
26
  require 'jeweler'
27
27
  Jeweler::Tasks.new do |gemspec|
28
- gemspec.name = "cloudfront_asset_host"
28
+ gemspec.name = "foresth-cloudfront_asset_host"
29
29
  gemspec.summary = "Rails plugin to easily and efficiently deploy your assets on Amazon's S3 or CloudFront"
30
30
  gemspec.description = "Easy deployment of your assets on CloudFront or S3 using a simple rake-task. When enabled in production, the application's asset_host and public_paths will point to the correct location."
31
31
  gemspec.email = "menno@wakoopa.com"
32
- gemspec.homepage = "http://github.com/menno/cloudfront_asset_host"
32
+ gemspec.homepage = "http://github.com/foresth/cloudfront_asset_host"
33
33
  gemspec.authors = ["Menno van der Sman"]
34
34
  gemspec.add_dependency 'right_aws'
35
35
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.4
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{foresth-cloudfront_asset_host}
8
- s.version = "1.0.3.1"
8
+ s.version = "1.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Menno van der Sman"]
@@ -33,6 +33,9 @@ module CloudfrontAssetHost
33
33
  # Key-prefix under which to store gzipped assets
34
34
  mattr_accessor :gzip_prefix
35
35
 
36
+ # Key-prefix under which to store plain (unzipped) assets
37
+ mattr_accessor :plain_prefix
38
+
36
39
  # Which extensions are likely to occur in css files
37
40
  mattr_accessor :image_extensions
38
41
 
@@ -82,7 +85,11 @@ module CloudfrontAssetHost
82
85
 
83
86
  if gzip_accepted && gzip_allowed
84
87
  host << "/#{CloudfrontAssetHost.gzip_prefix}"
88
+ else
89
+ host << "/#{CloudfrontAssetHost.plain_prefix}"
85
90
  end
91
+ else
92
+ host << "/#{CloudfrontAssetHost.plain_prefix}"
86
93
  end
87
94
 
88
95
  host
@@ -64,7 +64,8 @@ module CloudfrontAssetHost
64
64
 
65
65
  def keys_with_paths
66
66
  current_paths.inject({}) do |result, path|
67
- key = CloudfrontAssetHost.key_for_path(path) + path.gsub(Rails.public_path, '')
67
+ key = CloudfrontAssetHost.plain_prefix.present? ? "#{CloudfrontAssetHost.plain_prefix}/" : ""
68
+ key << CloudfrontAssetHost.key_for_path(path) + path.gsub(Rails.public_path, '')
68
69
 
69
70
  result[key] = path
70
71
  result
@@ -140,7 +141,10 @@ module CloudfrontAssetHost
140
141
  end
141
142
 
142
143
  def config
143
- @config ||= YAML::load_file(CloudfrontAssetHost.s3_config)
144
+ @config ||= begin
145
+ config = YAML::load_file(CloudfrontAssetHost.s3_config)
146
+ config.has_key?(Rails.env) ? config[Rails.env] : config
147
+ end
144
148
  end
145
149
 
146
150
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foresth-cloudfront_asset_host
3
3
  version: !ruby/object:Gem::Version
4
- hash: 81
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- - 1
11
- version: 1.0.3.1
9
+ - 4
10
+ version: 1.0.4
12
11
  platform: ruby
13
12
  authors:
14
13
  - Menno van der Sman