woody 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/woody/compiler.rb +1 -0
- data/lib/woody/deployer.rb +13 -1
- data/lib/woody/version.rb +1 -1
- metadata +1 -1
data/lib/woody/compiler.rb
CHANGED
@@ -84,6 +84,7 @@ module Woody
|
|
84
84
|
end
|
85
85
|
|
86
86
|
# Update iTunes RSS
|
87
|
+
$config['itunes']['explicit'] = "no" if $config['itunes']['explicit'].nil?
|
87
88
|
itunes = File.read "#{$source_root}/itunes.xml" # Use itunes.xml template in gem, not in site's template folder.
|
88
89
|
itunes = Erubis::Eruby.new(itunes)
|
89
90
|
itunes_compiled = itunes.result(config: $config, episodes: episodes)
|
data/lib/woody/deployer.rb
CHANGED
@@ -24,7 +24,14 @@ module Woody
|
|
24
24
|
def self.purge_bucket
|
25
25
|
bucket = AWS::S3::Bucket.find $bucketname
|
26
26
|
bucket.objects.each do |object|
|
27
|
-
|
27
|
+
prefix = $config['s3']['prefix']
|
28
|
+
if prefix.nil?
|
29
|
+
object.delete unless @@touchedfiles.include? object.key
|
30
|
+
else
|
31
|
+
if object.key.start_with? prefix # If using a prefix, don't delete anything outside of that 'subdirectory'
|
32
|
+
object.delete unless @@touchedfiles.include? object.key
|
33
|
+
end
|
34
|
+
end
|
28
35
|
end
|
29
36
|
end
|
30
37
|
|
@@ -36,6 +43,11 @@ module Woody
|
|
36
43
|
# @param [String] objectname specifies the S3 object's key/name
|
37
44
|
# @param [String] filepath specifies the path to the file to upload
|
38
45
|
def self.upload(objectname, filepath)
|
46
|
+
prefix = $config['s3']['prefix']
|
47
|
+
unless prefix.nil?
|
48
|
+
objectname = File.join(prefix, objectname)
|
49
|
+
end
|
50
|
+
|
39
51
|
# Generate hash of file
|
40
52
|
hash = filehash filepath
|
41
53
|
@@touchedfiles << objectname
|
data/lib/woody/version.rb
CHANGED