simple-s3 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/simple-s3/simple-s3.rb +13 -7
- data/lib/simple-s3/version.rb +1 -1
- data/simple-s3.gem +0 -0
- metadata +2 -2
data/lib/simple-s3/simple-s3.rb
CHANGED
@@ -21,20 +21,27 @@ class SimpleS3
|
|
21
21
|
self.config['s3_secret_key']
|
22
22
|
end
|
23
23
|
|
24
|
+
def self.s3_bucket
|
25
|
+
self.config['s3_bucket']
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.cloudfront_distribution_id
|
29
|
+
self.config['cloudfront_distribution_id']
|
30
|
+
end
|
31
|
+
|
24
32
|
def self.run!
|
25
33
|
self.upload!
|
26
34
|
self.invalidate!
|
27
35
|
end
|
28
36
|
|
29
37
|
def self.upload!
|
30
|
-
|
31
|
-
bucket = @config['bucket'].to_s
|
38
|
+
bucket = self.s3_bucket
|
32
39
|
raise 'Simple-S3: Bucket not defined' if bucket.length == 0
|
33
40
|
|
34
|
-
exclude =
|
41
|
+
exclude = config['exclude_files'] || []
|
35
42
|
exclude |= self.default_exclude_files
|
36
|
-
inc =
|
37
|
-
metadata =
|
43
|
+
inc = config['include_files'] || './**/*'
|
44
|
+
metadata = config['metadata'] || {}
|
38
45
|
metadata[:access] ||= 'public-read'
|
39
46
|
|
40
47
|
files = []
|
@@ -69,8 +76,7 @@ class SimpleS3
|
|
69
76
|
end
|
70
77
|
|
71
78
|
def invalidate!
|
72
|
-
|
73
|
-
distribution = @config['cloudfront_distribution_id']
|
79
|
+
distribution = self.cloudfront_distribution_id
|
74
80
|
return if distribution.nil?
|
75
81
|
|
76
82
|
aws_account = self.s3_access_key
|
data/lib/simple-s3/version.rb
CHANGED
data/simple-s3.gem
CHANGED
Binary file
|