file-manager 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -1
- data/file-manager.gemspec +1 -1
- data/lib/local_file_manager.rb +2 -1
- data/test/file_manager_test.rb +5 -0
- data/test/vcr_cassettes/test_remove_not_existing_file_dont_raise.yml +99 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3274b9402d808285bad4ecb41f687666157135f7
|
4
|
+
data.tar.gz: a5d16438c16799c45c76d8b7633fe9dcaf1a5732
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc14c2b86c76e173319127c7562902044b4a8355478594f63c515b8b2f7d67095b2d11744a65d75745fb188c9d9a5adeec106f176b14f2039079268a8766374c
|
7
|
+
data.tar.gz: 2ae8c3f919f1620b4f41d949a2b35b8b3cfac1ae247a01631f29626a4dde91532414d73ca33ea6b702bf098b19608f1715c1ebb40ab777ec277f1d824d25d70d
|
data/Gemfile.lock
CHANGED
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.
|
6
|
+
spec.version = '0.2.0'
|
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
@@ -36,7 +36,8 @@ class LocalFileManager < FileManager
|
|
36
36
|
|
37
37
|
def delete_file file_name
|
38
38
|
@logger.print "Deleting file \"#{file_name}\" from local folder \"#{root_path}\"..."
|
39
|
-
File.
|
39
|
+
full_file_name = File.join(root_path, file_name)
|
40
|
+
File.delete(full_file_name) if File.exists?(full_file_name)
|
40
41
|
@logger.puts 'done.'
|
41
42
|
end
|
42
43
|
|
data/test/file_manager_test.rb
CHANGED
@@ -0,0 +1,99 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://file-manager-tests.s3-us-west-2.amazonaws.com/?encoding-type=url&prefix=
|
6
|
+
body:
|
7
|
+
encoding: ASCII-8BIT
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- ''
|
12
|
+
Accept-Encoding:
|
13
|
+
- ''
|
14
|
+
User-Agent:
|
15
|
+
- aws-sdk-ruby2/2.2.13 ruby/2.2.1 x86_64-darwin14
|
16
|
+
X-Amz-Date:
|
17
|
+
- 20160315T144426Z
|
18
|
+
Host:
|
19
|
+
- file-manager-tests.s3-us-west-2.amazonaws.com
|
20
|
+
X-Amz-Content-Sha256:
|
21
|
+
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
22
|
+
Authorization:
|
23
|
+
- AWS4-HMAC-SHA256 Credential=AKIAJ73G6IOWSUPCKP5A/20160315/us-west-2/s3/aws4_request,
|
24
|
+
SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=0023659177858c0e7c7054fa1d6f2f02ef7d24fccca80a69524645a184bcccee
|
25
|
+
Content-Length:
|
26
|
+
- '0'
|
27
|
+
Accept:
|
28
|
+
- "*/*"
|
29
|
+
response:
|
30
|
+
status:
|
31
|
+
code: 200
|
32
|
+
message: OK
|
33
|
+
headers:
|
34
|
+
X-Amz-Id-2:
|
35
|
+
- KRb32ptkmt1QyWMS/4vvMxG6Qa6P1yLR5ys6mjuNHSoiiEbuQnYKN+ZCb+fo3/2BtuRc3xamfcw=
|
36
|
+
X-Amz-Request-Id:
|
37
|
+
- 363118D71D6CB915
|
38
|
+
Date:
|
39
|
+
- Tue, 15 Mar 2016 14:44:27 GMT
|
40
|
+
X-Amz-Bucket-Region:
|
41
|
+
- us-west-2
|
42
|
+
Content-Type:
|
43
|
+
- application/xml
|
44
|
+
Transfer-Encoding:
|
45
|
+
- chunked
|
46
|
+
Server:
|
47
|
+
- AmazonS3
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: |-
|
51
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
52
|
+
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>file-manager-tests</Name><Prefix></Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><EncodingType>url</EncodingType><IsTruncated>false</IsTruncated></ListBucketResult>
|
53
|
+
http_version:
|
54
|
+
recorded_at: Tue, 15 Mar 2016 14:44:26 GMT
|
55
|
+
- request:
|
56
|
+
method: delete
|
57
|
+
uri: https://file-manager-tests.s3-us-west-2.amazonaws.com/sub_dir/saved.*
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: ''
|
61
|
+
headers:
|
62
|
+
Content-Type:
|
63
|
+
- ''
|
64
|
+
Accept-Encoding:
|
65
|
+
- ''
|
66
|
+
User-Agent:
|
67
|
+
- aws-sdk-ruby2/2.2.13 ruby/2.2.1 x86_64-darwin14
|
68
|
+
X-Amz-Date:
|
69
|
+
- 20160315T144426Z
|
70
|
+
Host:
|
71
|
+
- file-manager-tests.s3-us-west-2.amazonaws.com
|
72
|
+
X-Amz-Content-Sha256:
|
73
|
+
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
74
|
+
Authorization:
|
75
|
+
- AWS4-HMAC-SHA256 Credential=AKIAJ73G6IOWSUPCKP5A/20160315/us-west-2/s3/aws4_request,
|
76
|
+
SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=6272ce8fae73f537d3b811d3a4dff931defbb1cc0c028641ca315d5ae7e69ad1
|
77
|
+
Content-Length:
|
78
|
+
- '0'
|
79
|
+
Accept:
|
80
|
+
- "*/*"
|
81
|
+
response:
|
82
|
+
status:
|
83
|
+
code: 204
|
84
|
+
message: No Content
|
85
|
+
headers:
|
86
|
+
X-Amz-Id-2:
|
87
|
+
- p4vWQOuTk3MoDRzlPPCLAEjJE+1rnU2/Xb9heUedHXh9q+EJgykS3xzwcU6I1F+lyLlOAyp/wpU=
|
88
|
+
X-Amz-Request-Id:
|
89
|
+
- 90A37943546437B4
|
90
|
+
Date:
|
91
|
+
- Tue, 15 Mar 2016 14:44:41 GMT
|
92
|
+
Server:
|
93
|
+
- AmazonS3
|
94
|
+
body:
|
95
|
+
encoding: UTF-8
|
96
|
+
string: ''
|
97
|
+
http_version:
|
98
|
+
recorded_at: Tue, 15 Mar 2016 14:44:40 GMT
|
99
|
+
recorded_with: VCR 3.0.1
|
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.
|
4
|
+
version: 0.2.0
|
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: 2016-
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- test/vcr_cassettes/test_listing_files_in_sub_dir.yml
|
139
139
|
- test/vcr_cassettes/test_reading.yml
|
140
140
|
- test/vcr_cassettes/test_reading_in_sub_dir.yml
|
141
|
+
- test/vcr_cassettes/test_remove_not_existing_file_dont_raise.yml
|
141
142
|
homepage: https://github.com/fortesinformatica/file-manager
|
142
143
|
licenses: []
|
143
144
|
metadata: {}
|
@@ -171,4 +172,5 @@ test_files:
|
|
171
172
|
- test/vcr_cassettes/test_listing_files_in_sub_dir.yml
|
172
173
|
- test/vcr_cassettes/test_reading.yml
|
173
174
|
- test/vcr_cassettes/test_reading_in_sub_dir.yml
|
175
|
+
- test/vcr_cassettes/test_remove_not_existing_file_dont_raise.yml
|
174
176
|
has_rdoc:
|