asset_sync 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .DS_Store
1
2
  *.gem
2
3
  .bundle
3
4
  Gemfile.lock
@@ -3,3 +3,13 @@ rvm:
3
3
  - 1.8.7
4
4
  - 1.9.2
5
5
  - 1.9.3
6
+ - jruby-18mode
7
+ - jruby-19mode
8
+ - rbx-18mode
9
+ - rbx-19mode
10
+ - ruby-head
11
+ - jruby-head
12
+ - ree
13
+ matrix:
14
+ allow_failures:
15
+ - rvm: ruby-head
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
1
  source :rubygems
2
- gemspec
2
+ gemspec
3
+
4
+ gem 'jruby-openssl', :platform => :jruby
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Synchronises Assets between Rails and S3.
6
6
 
7
- Asset Sync is built to run with the new Rails Asset Pipeline feature introduced in **Rails 3.1**. After you run __bundle exec rake assets:precompile__ your assets will be synchronised to your S3
7
+ Asset Sync is built to run with the new Rails Asset Pipeline feature introduced in **Rails 3.1**. After you run __bundle exec rake assets:precompile__ your assets will be synchronised to your S3
8
8
  bucket, optionally deleting unused files and only uploading the files it needs to.
9
9
 
10
10
  This was initially built and is intended to work on [Heroku](http://heroku.com) but can work on any platform.
@@ -19,7 +19,6 @@ Previously there were [several issues](http://github.com/rumblelabs/asset_sync/b
19
19
 
20
20
  Now to get everything working smoothly with using **ENV** variables to configure `asset_sync` we just need to enable the [user\_env\_compile](http://devcenter.heroku.com/articles/labs-user-env-compile) functionality. In short:
21
21
 
22
- heroku plugins:install https://github.com/heroku/heroku-labs.git
23
22
  heroku labs:enable user_env_compile -a myapp
24
23
 
25
24
  Hopefully this will make it's way into the platform as standard.
@@ -46,7 +45,7 @@ end
46
45
  This is good practice when pre-compiling your assets as it will reduce load time and server memory in production. The only caveat being, you may not be able to use a custom initializer, without perhaps wrapping it with.
47
46
 
48
47
  ``` ruby
49
- defined?(AssetSync) do
48
+ if defined?(AssetSync)
50
49
  ...
51
50
  end
52
51
  ```
@@ -61,9 +60,15 @@ S3 as the asset host and ensure precompiling is enabled.
61
60
 
62
61
  ``` ruby
63
62
  #config/environments/production.rb
64
- config.action_controller.asset_host = Proc.new do |source, request|
65
- request.ssl? ? "https://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com" : "http://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
66
- end
63
+ config.action_controller.asset_host = "//#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
64
+ ```
65
+
66
+ On **HTTPS**: the exclusion of any protocol in the asset host declaration above will allow browsers to choose the transport mechanism on the fly. So if your application is available under both HTTP and HTTPS the assets will be served to match.
67
+
68
+ > The only caveat with this is that your S3 bucket name **must not contain any periods** so, mydomain.com.s3.amazonaws.com for example would not work under HTTPS as SSL certificates from Amazon would interpret our bucket name as **not** a subdomain of s3.amazonaws.com, but a multi level subdomain. To avoid this don't use a period in your subdomain or switch to the other style of S3 URL.
69
+
70
+ ``` ruby
71
+ config.action_controller.asset_host = "//s3.amazonaws.com/#{ENV['FOG_DIRECTORY']}"
67
72
  ```
68
73
 
69
74
  Also, ensure the following are defined (in production.rb or application.rb)
@@ -152,7 +157,7 @@ AssetSync.configure do |config|
152
157
  # Automatically replace files with their equivalent gzip compressed version
153
158
  # config.gzip_compression = true
154
159
  #
155
- # Use the Rails generated 'manifest.yml' file to produce the list of files to
160
+ # Use the Rails generated 'manifest.yml' file to produce the list of files to
156
161
  # upload instead of searching the assets directory.
157
162
  # config.manifest = true
158
163
  #
@@ -326,4 +331,4 @@ Inspired by:
326
331
 
327
332
  ## License
328
333
 
329
- MIT License. Copyright 2011 Rumble Labs Ltd. [rumblelabs.com](http://rumblelabs.com)
334
+ MIT License. Copyright 2011 Rumble Labs Ltd. [rumblelabs.com](http://rumblelabs.com)
@@ -6,8 +6,8 @@ require "asset_sync/version"
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "asset_sync"
8
8
  s.version = AssetSync::VERSION
9
- s.date = "2012-06-02"
10
- s.platform = Gem::Platform::RUBY
9
+ s.date = "2012-08-19"
10
+ s.platform = Gem::Platform::RUBY
11
11
  s.authors = ["Simon Hamilton", "David Rice", "Phil McClure"]
12
12
  s.email = ["shamilton@rumblelabs.com", "me@davidjrice.co.uk", "pmcclure@rumblelabs.com"]
13
13
  s.homepage = "https://github.com/rumblelabs/asset_sync"
@@ -104,12 +104,13 @@ module AssetSync
104
104
 
105
105
  def upload_file(f)
106
106
  # TODO output files in debug logs as asset filename only.
107
+ one_year = 31557600
107
108
  file = {
108
109
  :key => f,
109
110
  :body => File.open("#{path}/#{f}"),
110
111
  :public => true,
111
- :cache_control => "public, max-age=31557600",
112
- :expires => CGI.rfc1123_date(Time.now + 1.year)
112
+ :cache_control => "public, max-age=#{one_year}",
113
+ :expires => CGI.rfc1123_date(Time.now + one_year)
113
114
  }
114
115
 
115
116
  gzipped = "#{path}/#{f}.gz"
@@ -1,3 +1,3 @@
1
1
  module AssetSync
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asset_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-06-02 00:00:00.000000000 Z
14
+ date: 2012-08-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fog
18
- requirement: &70223412035340 !ruby/object:Gem::Requirement
18
+ requirement: !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,15 @@ dependencies:
23
23
  version: '0'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70223412035340
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
27
32
  - !ruby/object:Gem::Dependency
28
33
  name: activemodel
29
- requirement: &70223412034660 !ruby/object:Gem::Requirement
34
+ requirement: !ruby/object:Gem::Requirement
30
35
  none: false
31
36
  requirements:
32
37
  - - ! '>='
@@ -34,10 +39,15 @@ dependencies:
34
39
  version: '0'
35
40
  type: :runtime
36
41
  prerelease: false
37
- version_requirements: *70223412034660
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
38
48
  - !ruby/object:Gem::Dependency
39
49
  name: rspec
40
- requirement: &70223412033020 !ruby/object:Gem::Requirement
50
+ requirement: !ruby/object:Gem::Requirement
41
51
  none: false
42
52
  requirements:
43
53
  - - ! '>='
@@ -45,10 +55,15 @@ dependencies:
45
55
  version: '0'
46
56
  type: :development
47
57
  prerelease: false
48
- version_requirements: *70223412033020
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
49
64
  - !ruby/object:Gem::Dependency
50
65
  name: bundler
51
- requirement: &70223412032060 !ruby/object:Gem::Requirement
66
+ requirement: !ruby/object:Gem::Requirement
52
67
  none: false
53
68
  requirements:
54
69
  - - ! '>='
@@ -56,10 +71,15 @@ dependencies:
56
71
  version: '0'
57
72
  type: :development
58
73
  prerelease: false
59
- version_requirements: *70223412032060
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
60
80
  - !ruby/object:Gem::Dependency
61
81
  name: jeweler
62
- requirement: &70223412031120 !ruby/object:Gem::Requirement
82
+ requirement: !ruby/object:Gem::Requirement
63
83
  none: false
64
84
  requirements:
65
85
  - - ! '>='
@@ -67,7 +87,12 @@ dependencies:
67
87
  version: '0'
68
88
  type: :development
69
89
  prerelease: false
70
- version_requirements: *70223412031120
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
71
96
  description: After you run assets:precompile your compiled assets will be synchronised
72
97
  with your S3 bucket.
73
98
  email:
@@ -116,15 +141,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
141
  - - ! '>='
117
142
  - !ruby/object:Gem::Version
118
143
  version: '0'
144
+ segments:
145
+ - 0
146
+ hash: -3610501310957449619
119
147
  required_rubygems_version: !ruby/object:Gem::Requirement
120
148
  none: false
121
149
  requirements:
122
150
  - - ! '>='
123
151
  - !ruby/object:Gem::Version
124
152
  version: '0'
153
+ segments:
154
+ - 0
155
+ hash: -3610501310957449619
125
156
  requirements: []
126
157
  rubyforge_project: asset_sync
127
- rubygems_version: 1.8.15
158
+ rubygems_version: 1.8.24
128
159
  signing_key:
129
160
  specification_version: 3
130
161
  summary: Synchronises Assets in a Rails 3 application and Amazon S3/Cloudfront and
@@ -138,4 +169,3 @@ test_files:
138
169
  - spec/rackspace_with_yml/config/asset_sync.yml
139
170
  - spec/spec_helper.rb
140
171
  - spec/storage_spec.rb
141
- has_rdoc: