woody 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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)
@@ -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
- object.delete unless @@touchedfiles.include? object.key
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
@@ -1,4 +1,4 @@
1
1
  module Woody
2
2
  # Specifies Woody gem version
3
- VERSION = "0.2.1"
3
+ VERSION = "0.3.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woody
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: