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.
- data/lib/jekyll-s3-yearofmoo/uploader.rb +12 -15
- data/lib/jekyll-s3-yearofmoo/version.rb +1 -1
- metadata +2 -2
@@ -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
|
-
|
85
|
-
|
86
|
-
|
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!
|