s3_assets_deployer 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/lib/s3_assets_deployer.rb +0 -1
- data/lib/s3_assets_deployer/asset_file.rb +4 -6
- data/lib/s3_assets_deployer/aws_s3.rb +1 -1
- data/lib/s3_assets_deployer/configuration.rb +1 -2
- data/lib/s3_assets_deployer/deployer.rb +5 -4
- data/lib/s3_assets_deployer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bbc6cc1e1b9506379131531f81e773272bce3b8
|
4
|
+
data.tar.gz: 3873880ee4a9b4c1278e054ba0dd6b72742f018d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2b6d0da76e6f25a2e6f7ad8a58047dc070e500a0e4a7d3f9607eb4c1387e858e5f022d09d521fbe4314904a0c7e6d9d47bb0717fa8decaaf239d665e3ceeb39
|
7
|
+
data.tar.gz: a43efefa8ef9e1bcda3cafb193b901b8868224797f9a3a0a9b6f9e5cb4deee8f5173559343d84de10eb18d2d0bf91d340b45b785bd7b05199f06a523995eddbc
|
data/README.md
CHANGED
@@ -27,7 +27,6 @@ Add initializer at `config/iniitializers/s3_assets_deployer.rb`
|
|
27
27
|
S3AssetsDeployer.configure do |config|
|
28
28
|
config.assets.root_path = Rails.root.join('public')
|
29
29
|
config.assets.prefix_paths = ['assets', 'packs']
|
30
|
-
config.assets.ignore_paths = ['packs/manifest.json']
|
31
30
|
# your storage service configurations
|
32
31
|
config.s3.region = 'ap-northeast-1'
|
33
32
|
config.s3.bucket = 'bucket_name'
|
data/lib/s3_assets_deployer.rb
CHANGED
@@ -2,19 +2,17 @@ require 'mime/types'
|
|
2
2
|
|
3
3
|
module S3AssetsDeployer
|
4
4
|
class AssetFile
|
5
|
-
|
6
|
-
|
7
|
-
def initialize(prefix, path)
|
8
|
-
@prefix = prefix
|
5
|
+
def initialize(path, realpath)
|
9
6
|
@path = path
|
7
|
+
@realpath = realpath
|
10
8
|
end
|
11
9
|
|
12
10
|
def key
|
13
|
-
|
11
|
+
@path
|
14
12
|
end
|
15
13
|
|
16
14
|
def body
|
17
|
-
File.new(@
|
15
|
+
File.new(@realpath)
|
18
16
|
end
|
19
17
|
|
20
18
|
def content_type
|
@@ -3,10 +3,9 @@ module S3AssetsDeployer
|
|
3
3
|
attr_accessor :assets,
|
4
4
|
:s3
|
5
5
|
|
6
|
-
class AssetsConfiguration < Struct.new(:root_path, :prefix_paths
|
6
|
+
class AssetsConfiguration < Struct.new(:root_path, :prefix_paths)
|
7
7
|
def initialize
|
8
8
|
self.prefix_paths = ['assets']
|
9
|
-
self.ignore_paths = []
|
10
9
|
end
|
11
10
|
end
|
12
11
|
|
@@ -2,11 +2,10 @@ require 's3_assets_deployer/asset_file'
|
|
2
2
|
|
3
3
|
module S3AssetsDeployer
|
4
4
|
class Deployer
|
5
|
-
def initialize(storage:, root_path:, prefix_paths
|
5
|
+
def initialize(storage:, root_path:, prefix_paths:)
|
6
6
|
@storage = storage
|
7
7
|
@root_path = root_path
|
8
8
|
@prefix_paths = prefix_paths
|
9
|
-
@ignore_paths = ignore_paths.map { |path| File.join(root_path, path) }
|
10
9
|
end
|
11
10
|
|
12
11
|
def run
|
@@ -17,8 +16,10 @@ module S3AssetsDeployer
|
|
17
16
|
|
18
17
|
def files
|
19
18
|
@files ||= @prefix_paths.flat_map do |prefix|
|
20
|
-
Dir.
|
21
|
-
|
19
|
+
Dir.chdir(@root_path) do
|
20
|
+
Dir.glob(Pathname.new(prefix).join('**', '**')).map do |path|
|
21
|
+
AssetFile.new(path, File.realpath(path)) if Pathname.new(path).file?
|
22
|
+
end
|
22
23
|
end
|
23
24
|
end.compact
|
24
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3_assets_deployer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Iguchi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.6.
|
93
|
+
rubygems_version: 2.6.14
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Rails assets deployer
|