jekyll-s3-yearofmoo 0.0.18 → 0.0.19

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.
@@ -81,29 +81,26 @@ cloudfront_distribution_id: YOUR_CLOUDFRONT_DIST_ID (OPTIONAL)
81
81
 
82
82
  def customize_file_metadata(file)
83
83
  data = { :access => 'public-read' }
84
- expiry = find_matching_expires_header(file)
85
- if expiry
86
- data[:expires] = expiry
84
+
85
+ headers = @config['headers']
86
+ headers.each do |h|
87
+ pattern = h['pattern']
88
+ header = h['header']
89
+ value = h['value']
90
+ pattern = Regexp.new(pattern)
91
+ if file =~ pattern
92
+ data[header] = value
93
+ end
87
94
  end
95
+
88
96
  content_type = find_matching_content_type(file)
89
97
  if content_type
90
98
  data['Content-Type'] = content_type
91
99
  end
100
+
92
101
  data
93
102
  end
94
103
 
95
- def find_matching_expires_header(file)
96
- headers = @config['expire_headers']
97
- headers.each do |expire|
98
- pattern = Regexp.new expire['pattern']
99
- value = expire['value']
100
- if file =~ pattern
101
- return value
102
- end
103
- end
104
-
105
- return nil
106
- end
107
104
 
108
105
  # Please spec me!
109
106
  def upload_to_s3!
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module S3
3
- VERSION = "0.0.18"
3
+ VERSION = "0.0.19"
4
4
  end
5
5
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 18
9
- version: 0.0.18
8
+ - 19
9
+ version: 0.0.19
10
10
  platform: ruby
11
11
  authors:
12
12
  - Philippe Creux