asset_sync 2.5.0 → 2.6.0

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: 8f0a301ff99d58cacb580c68586d0dd58ccea76c4368e605cfec7c97f1ec8207
4
- data.tar.gz: 62b5f062c8eec2f700961aa3c1f3b375a5c700c20fd5b795d034a76dda0bc3bf
3
+ metadata.gz: 51ba6147cc39550e51d1eb1bc98420b53b0ca14fe96d90d34e7de36c8a9511b5
4
+ data.tar.gz: 701e692e95ed4c8ad41a8a5d14e7356ee8c013221e675d7396a8b07816f7a226
5
5
  SHA512:
6
- metadata.gz: ac1d44af84bbfca4a10dcc6d03346337f90a4944d364b5b4721b20c5e2acd8c21187de149510452f97897b0b36c0351f8647ccfc3fc8da533c275db7d82e6502
7
- data.tar.gz: c99b77189e305fab78cb03a0493b85056f707858f5703c27a5a4045a8a174e388c749d50ce9127d23abeddd855b7eff1501b2313c8adf84dbfb815ce52f7ab33
6
+ metadata.gz: f03b66ce2292d21a3e1a514307a3bf737c0ea856b46ee6e36aef40b93a2604b544e708f97f7b1e9fbfa81483545929cfb9e7714c4bf4172e6311e22f4cc7ffe2
7
+ data.tar.gz: e228c684a414b1a9859ea8df91f76b1b6c5ad4234863b46307dd76b705aa8a71f18cba5ab8c959a33ac089ca9d5c355dc26391bb16441a8c802fc0f44f97c087
data/.travis.yml CHANGED
@@ -1,14 +1,23 @@
1
+ # Send builds to container-based infrastructure
2
+ # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
3
+ sudo: false
1
4
  language: ruby
5
+ cache:
6
+ bundler: true
2
7
  rvm:
3
- - 1.9.2
4
- - 1.9.3
5
- - jruby-19mode
6
- - rbx-2
8
+ - 2.2
9
+ - 2.3
10
+ - 2.4
11
+ - 2.5
12
+ - 2.6
7
13
  - ruby-head
14
+ - jruby
8
15
  - jruby-head
9
16
  gemfile:
10
- - gemfiles/rails_3.1.gemfile
11
- - gemfiles/rails_3.2.gemfile
17
+ - gemfiles/rails_4_2.gemfile
18
+ - gemfiles/rails_5_0.gemfile
19
+ - gemfiles/rails_5_1.gemfile
20
+ - gemfiles/rails_5_2.gemfile
12
21
  before_install:
13
22
  - gem install bundler
14
23
  env:
@@ -18,25 +27,13 @@ env:
18
27
  - secure: "dy8Fqlg3b1ZMK1BY5z6NMQLbzAVd7GWVYY0MeCQALz76zRac0z8MyU8hkv6h\nozFry7DSdbGehGT9foOnkWTwzGzf1rzdd5cmWrUPk1wDTRgMM9SrwodPj1TU\nzsq2EFx0a79vADQN8JXkpLC1YD6kEb9aWkTxrIT9KBgw+J5H32o="
19
28
  - secure: "Hmx7D7/p2LlA2ya/xBIz21s/8MLIQCjvfYB7RWBNlWk1PfqRLAz8wX6TUVWy\nfAFktMjLnpRLRYO7AgQS4jcfQ/k0HYK9IXzqXzeI00TNm0Vwp0TCXhawiOFT\nSvUMhs2/1vRfjN0HOJ75XlWRhJzV/G5rOMiafAZLsVzN/0iiB8g="
20
29
  matrix:
21
- include:
22
- - rvm: 1.9.3
23
- gemfile: gemfiles/rails_4.0.gemfile
24
- - rvm: jruby-19mode
25
- gemfile: gemfiles/rails_4.0.gemfile
26
- - rvm: rbx-2
27
- gemfile: gemfiles/rails_4.0.gemfile
28
- - rvm: 2.0.0
29
- gemfile: gemfiles/rails_3.2.gemfile
30
- - rvm: 2.0.0
31
- gemfile: gemfiles/rails_4.0.gemfile
32
- - rvm: 2.1.2
33
- gemfile: gemfiles/rails_4.1.gemfile
34
- - rvm: 2.0.0
35
- gemfile: gemfiles/rails_4.1.gemfile
36
- - rvm: 2.1.2
37
- gemfile: gemfiles/rails_4.1.gemfile
30
+ fast_finish: true
38
31
  allow_failures:
39
- - rvm: 1.9.2
40
- - rvm: rbx-2
32
+ - rvm: 2.6
41
33
  - rvm: ruby-head
42
34
  - rvm: jruby-head
35
+ notifications:
36
+ webhooks:
37
+ urls:
38
+ - https://www.travisbuddy.com/
39
+ on_success: never
data/CHANGELOG.md CHANGED
@@ -18,6 +18,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
18
18
  - Nothing
19
19
 
20
20
 
21
+ ## [2.6.0] - 2018-12-07
22
+
23
+ ### Added
24
+
25
+ - Add option `fog_public`
26
+ (https://github.com/AssetSync/asset_sync/pull/377)
27
+
28
+
21
29
  ## [2.5.0] - 2018-10-25
22
30
 
23
31
  ### Added
@@ -27,7 +35,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
27
35
 
28
36
  ### Changed
29
37
 
30
- - Start testing against rails 5.2, stop testing against rails 4.2
38
+ - Start testing against rails 5.2, stop testing against rails 4.1
31
39
 
32
40
  ### Fixed
33
41
 
@@ -880,7 +888,8 @@ Changes:
880
888
  * Merge branch 'sinatra'
881
889
 
882
890
 
883
- [Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.5.0...HEAD
891
+ [Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.6.0...HEAD
892
+ [2.6.0]: https://github.com/AssetSync/asset_sync/compare/v2.5.0...v2.6.0
884
893
  [2.5.0]: https://github.com/AssetSync/asset_sync/compare/v2.4.0...v2.5.0
885
894
  [2.4.0]: https://github.com/AssetSync/asset_sync/compare/v2.3.0...v2.4.0
886
895
  [2.3.0]: https://github.com/AssetSync/asset_sync/compare/v2.2.0...v2.3.0
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
 
2
2
  [![Gem Version](https://img.shields.io/gem/v/asset_sync.svg?style=flat-square)](http://badge.fury.io/rb/asset_sync)
3
- [![Build Status](https://img.shields.io/travis/rumblelabs/asset_sync.svg?style=flat-square)](http://travis-ci.org/rumblelabs/asset_sync)
4
- [![Code Climate](https://img.shields.io/codeclimate/github/AssetSync/asset_sync/badges/gpa.svg?style=flat-square)](https://codeclimate.com/github/AssetSync/asset_sync)
5
-
6
- (Build Status is broken as expected until Travis is fixed by AssetSync organization owner)
3
+ [![Build Status](https://img.shields.io/travis/AssetSync/asset_sync.svg?style=flat-square)](http://travis-ci.org/AssetSync/asset_sync)
4
+ [![Coverage Status](http://img.shields.io/coveralls/AssetSync/asset_sync.svg?style=flat-square)](https://coveralls.io/r/AssetSync/asset_sync)
7
5
 
8
6
 
9
7
  # Asset Sync
@@ -123,7 +121,7 @@ Additionally, if you depend on any configuration that is setup in your `initiali
123
121
 
124
122
  **AssetSync** supports the following methods of configuration.
125
123
 
126
- * [Built-in Initializer](https://github.com/rumblelabs/asset_sync/blob/master/lib/asset_sync/engine.rb) (configured through environment variables)
124
+ * [Built-in Initializer](https://github.com/AssetSync/asset_sync/blob/master/lib/asset_sync/engine.rb) (configured through environment variables)
127
125
  * Rails Initializer
128
126
  * A YAML config file
129
127
 
@@ -207,6 +205,11 @@ AssetSync.configure do |config|
207
205
  # Increase upload performance by configuring your region
208
206
  # config.fog_region = 'eu-west-1'
209
207
  #
208
+ # Set `public` option when uploading file depending on value,
209
+ # Setting to "default" makes asset sync skip setting the option
210
+ # Possible values: true, false, "default" (default: true)
211
+ # config.fog_public = true
212
+ #
210
213
  # Change AWS signature version. Default is 4
211
214
  # config.aws_signature_version = 4
212
215
  #
data/asset_sync.gemspec CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
 
25
25
  s.add_development_dependency "rspec"
26
26
  s.add_development_dependency "bundler"
27
+ s.add_development_dependency "coveralls", ">= 0.7"
27
28
 
28
29
  s.add_development_dependency('mime-types', ">= 3.0")
29
30
 
@@ -32,6 +32,7 @@ module AssetSync
32
32
  attr_accessor :fog_provider # Currently Supported ['AWS', 'Rackspace']
33
33
  attr_accessor :fog_directory # e.g. 'the-bucket-name'
34
34
  attr_accessor :fog_region # e.g. 'eu-west-1'
35
+ attr_reader :fog_public # e.g. true, false, "default"
35
36
 
36
37
  # Amazon AWS
37
38
  attr_accessor :aws_access_key_id, :aws_secret_access_key, :aws_reduced_redundancy, :aws_iam_roles, :aws_signature_version
@@ -63,6 +64,7 @@ module AssetSync
63
64
 
64
65
  def initialize
65
66
  self.fog_region = nil
67
+ self.fog_public = true
66
68
  self.existing_remote_files = 'keep'
67
69
  self.gzip_compression = false
68
70
  self.manifest = false
@@ -163,6 +165,7 @@ module AssetSync
163
165
  self.fog_host = yml["fog_host"]
164
166
  self.fog_directory = yml["fog_directory"]
165
167
  self.fog_region = yml["fog_region"]
168
+ self.fog_public = yml["fog_public"] if yml.has_key?("fog_public")
166
169
  self.fog_path_style = yml["fog_path_style"]
167
170
  self.fog_scheme = yml["fog_scheme"]
168
171
  self.aws_access_key_id = yml["aws_access_key_id"]
@@ -249,7 +252,7 @@ module AssetSync
249
252
  raise ArgumentError, "AssetSync Unknown provider: #{fog_provider} only AWS, Rackspace and Google are supported currently."
250
253
  end
251
254
 
252
- return options
255
+ options
253
256
  end
254
257
 
255
258
  # @api
@@ -275,6 +278,10 @@ module AssetSync
275
278
  @file_ext_to_mime_type_overrides ||= FileExtToMimeTypeOverrides.new
276
279
  end
277
280
 
281
+ def fog_public=(new_val)
282
+ @fog_public = FogPublicValue.new(new_val)
283
+ end
284
+
278
285
  private
279
286
 
280
287
  # This is a proc to get additional local files paths
@@ -320,7 +327,21 @@ module AssetSync
320
327
  def fetch(key)
321
328
  @overrides.fetch(key)
322
329
  end
330
+ end
323
331
 
332
+ # @api private
333
+ class FogPublicValue
334
+ def initialize(val)
335
+ @value = val
336
+ end
337
+
338
+ def use_explicit_value?
339
+ @value.to_s != "default"
340
+ end
341
+
342
+ def to_bool
343
+ !@value.nil?
344
+ end
324
345
  end
325
346
  end
326
347
  end
@@ -43,7 +43,7 @@ module AssetSync
43
43
 
44
44
  def get_manifest_path
45
45
  return [] unless self.config.include_manifest
46
-
46
+
47
47
  if ActionView::Base.respond_to?(:assets_manifest)
48
48
  manifest = Sprockets::Manifest.new(ActionView::Base.assets_manifest.environment, ActionView::Base.assets_manifest.dir)
49
49
  manifest_path = manifest.filename
@@ -148,10 +148,17 @@ module AssetSync
148
148
  file = {
149
149
  :key => f,
150
150
  :body => file_handle,
151
- :public => true,
152
151
  :content_type => mime
153
152
  }
154
153
 
154
+ # region fog_public
155
+
156
+ if config.fog_public.use_explicit_value?
157
+ file[:public] = config.fog_public.to_bool
158
+ end
159
+
160
+ # endregion fog_public
161
+
155
162
  uncompressed_filename = f.sub(/\.gz\z/, '')
156
163
  basename = File.basename(uncompressed_filename, File.extname(uncompressed_filename))
157
164
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AssetSync
4
- VERSION = "2.5.0".freeze
4
+ VERSION = "2.6.0".freeze
5
5
  end
@@ -42,6 +42,11 @@ if defined?(AssetSync)
42
42
  # Increase upload performance by configuring your region
43
43
  # config.fog_region = 'eu-west-1'
44
44
  #
45
+ # Set `public` option when uploading file depending on value,
46
+ # Setting to "default" makes asset sync skip setting the option
47
+ # Possible values: true, false, "default" (default: true)
48
+ # config.fog_public = true
49
+ #
45
50
  # Don't delete files from the store
46
51
  # config.existing_remote_files = "keep"
47
52
  #
@@ -3,6 +3,7 @@ defaults: &defaults
3
3
  fog_provider: 'AWS'
4
4
  aws_access_key_id: "<%= aws_access_key_id %>"
5
5
  aws_secret_access_key: "<%= aws_secret_access_key %>"
6
+
6
7
  # To use AWS reduced redundancy storage.
7
8
  # aws_reduced_redundancy: true
8
9
  #
@@ -32,15 +33,25 @@ defaults: &defaults
32
33
  # fog_directory specifies container name of Azure Blob storage
33
34
  <%- end -%>
34
35
  fog_directory: "<%= app_name %>-assets"
36
+
35
37
  # You may need to specify what region your storage bucket is in
36
38
  # fog_region: "eu-west-1"
39
+
40
+ # Set `public` option when uploading file depending on value,
41
+ # Setting to "default" makes asset sync skip setting the option
42
+ # Possible values: true, false, "default" (default: true)
43
+ # config.fog_public = true
44
+
37
45
  existing_remote_files: keep
38
46
  # To delete existing remote files.
39
47
  # existing_remote_files: delete
48
+
40
49
  # Automatically replace files with their equivalent gzip compressed version
41
50
  # gzip_compression: true
51
+
42
52
  # Fail silently. Useful for environments such as Heroku
43
53
  # fail_silently: true
54
+
44
55
  # Allow custom assets to be cacheable. Note: The base filename will be matched
45
56
  # cache_asset_regexps: ['cache_me.js', !ruby/regexp '/cache_some\.\d{8}\.css/']
46
57
 
data/spec/spec_helper.rb CHANGED
@@ -10,6 +10,12 @@ rescue LoadError
10
10
  # SimpleCov ain't available - continue
11
11
  end
12
12
 
13
+ if ENV["TRAVIS"]
14
+ require "coveralls"
15
+ Coveralls.wear!("rails")
16
+ end
17
+
18
+
13
19
  begin
14
20
  Bundler.setup(:default, :development)
15
21
  rescue Bundler::BundlerError => e
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: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Hamilton
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-10-25 00:00:00.000000000 Z
14
+ date: 2018-12-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fog-core
@@ -97,6 +97,20 @@ dependencies:
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
+ - !ruby/object:Gem::Dependency
101
+ name: coveralls
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0.7'
107
+ type: :development
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0.7'
100
114
  - !ruby/object:Gem::Dependency
101
115
  name: mime-types
102
116
  requirement: !ruby/object:Gem::Requirement
@@ -242,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
256
  version: '0'
243
257
  requirements: []
244
258
  rubyforge_project: asset_sync
245
- rubygems_version: 2.7.7
259
+ rubygems_version: 2.7.8
246
260
  signing_key:
247
261
  specification_version: 4
248
262
  summary: Synchronises Assets in a Rails 3 application and Amazon S3/Cloudfront and