simple-s3 0.0.10 → 0.0.11

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.
@@ -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
- @config = config
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 = @config['exclude_files'] || []
41
+ exclude = config['exclude_files'] || []
35
42
  exclude |= self.default_exclude_files
36
- inc = @config['include_files'] || './**/*'
37
- metadata = @config['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
- @config = config
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
@@ -1,3 +1,3 @@
1
1
  class SimpleS3
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
data/simple-s3.gem CHANGED
Binary file
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 10
9
- version: 0.0.10
8
+ - 11
9
+ version: 0.0.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matias Niemela