file-manager 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/file-manager.gemspec +1 -1
- data/lib/local_file_manager.rb +1 -1
- data/lib/s3_file_manager.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de944628d162a00cd8792237dc69f6a85c1a911e
|
4
|
+
data.tar.gz: c71bf0d48852374e29baa006579a45e64011346d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6238a0427c302da4adac889dcfdbfbec0638df4b94bcb5f5d552d06a91557102dd4b513ebc15a74018a55345c0efd21a2a6c57a1693c453473e560fb75ac9179
|
7
|
+
data.tar.gz: f5d042302ffa9fc3301baf6421eddd4917a0e3d1903da08e714d1ac29dcd3a2de9a53f9512da8804d3951725a628d8d09eb88fd4cfff3e8fb906638be3680cdd
|
data/file-manager.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "file-manager"
|
6
|
-
spec.version = '0.0.
|
6
|
+
spec.version = '0.0.7'
|
7
7
|
spec.authors = ["Francisco Barroso / Marlus Saraiva"]
|
8
8
|
spec.email = ["franciscobarroso@grupofortes.com.br"]
|
9
9
|
spec.description = 'File manager, access S3 or local'
|
data/lib/local_file_manager.rb
CHANGED
@@ -15,7 +15,7 @@ class LocalFileManager
|
|
15
15
|
contents
|
16
16
|
end
|
17
17
|
|
18
|
-
def save_file
|
18
|
+
def save_file(file_name, file_contents, write_options = {})
|
19
19
|
root_path = options[:root_path]
|
20
20
|
print "Saving file \"#{file_name}\" to local folder \"#{root_path}\"..."
|
21
21
|
File.open("#{root_path}/#{file_name}", 'wb') { |f| f.write(file_contents) }
|
data/lib/s3_file_manager.rb
CHANGED
@@ -18,12 +18,12 @@ class S3FileManager
|
|
18
18
|
contents
|
19
19
|
end
|
20
20
|
|
21
|
-
def save_file
|
21
|
+
def save_file(file_name, file_contents, write_options = {})
|
22
22
|
print "Saving file \"#{file_name}\" to bucket \"#{options[:bucket]}\"..."
|
23
23
|
s3_service = connect_s3_service
|
24
24
|
bucket = s3_service.buckets[options[:bucket]]
|
25
25
|
|
26
|
-
bucket.objects["#{file_name}"].write(file_contents.to_s)
|
26
|
+
bucket.objects["#{file_name}"].write(file_contents.to_s, write_options)
|
27
27
|
puts 'done.'
|
28
28
|
end
|
29
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francisco Barroso / Marlus Saraiva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
91
|
+
rubygems_version: 2.0.14
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: File manager, access S3 or local
|