capriza-aws 0.0.12 → 0.0.13
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/capriza-aws.rb +15 -15
- data/lib/capriza-aws/version.rb +1 -1
- metadata +1 -1
data/lib/capriza-aws.rb
CHANGED
@@ -83,27 +83,27 @@ module Capriza
|
|
83
83
|
end
|
84
84
|
|
85
85
|
end
|
86
|
+
class S3upload
|
87
|
+
def initialize(bucket, folder_name, config, make_public = false)
|
88
|
+
S3connect.new(config)
|
89
|
+
s3 = AWS::S3.new()
|
86
90
|
|
87
|
-
|
88
|
-
|
89
|
-
class S3upload
|
90
|
-
def initialize(bucket, folder_name, config, make_public = false)
|
91
|
-
S3connect.new(config)
|
92
|
-
s3 = AWS::S3.new()
|
91
|
+
b = s3.buckets[bucket_name]
|
93
92
|
|
94
|
-
|
93
|
+
Dir.foreach(folder_name) do |item|
|
94
|
+
next if item == '.' or item == '..'
|
95
95
|
|
96
|
-
|
97
|
-
|
96
|
+
basename = File.basename(item)
|
97
|
+
o = b.objects[basename]
|
98
|
+
o.write(:file => item)
|
99
|
+
o.acl = :public_read if make_public
|
100
|
+
puts item
|
98
101
|
|
99
|
-
|
100
|
-
o = b.objects[basename]
|
101
|
-
o.write(:file => item)
|
102
|
-
o.acl = :public_read if make_public
|
103
|
-
puts item
|
102
|
+
end
|
104
103
|
|
105
104
|
end
|
106
|
-
|
107
105
|
end
|
106
|
+
|
108
107
|
end
|
108
|
+
|
109
109
|
end
|
data/lib/capriza-aws/version.rb
CHANGED