simple-s3 0.0.14 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +43 -1
- data/lib/simple-s3/simple-s3.rb +10 -6
- data/lib/simple-s3/version.rb +1 -1
- metadata +2 -3
- data/simple-s3.gem +0 -0
data/README.md
CHANGED
@@ -1,3 +1,45 @@
|
|
1
1
|
# Simple-S3
|
2
2
|
|
3
|
-
A super simple uploader for S3 using Ruby
|
3
|
+
A super simple uploader for S3 using Ruby.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install as a gem using `gem install simple-s3`.
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
Setup a file called `simple-s3.yml` with the following information:
|
12
|
+
|
13
|
+
```yaml
|
14
|
+
s3_bucket: '...'
|
15
|
+
s3_access_key: '...'
|
16
|
+
s3_secret_key: '...'
|
17
|
+
cloudfront_distribution_id: '...'
|
18
|
+
```
|
19
|
+
|
20
|
+
And then run the command `simple-s3` from the command line within the same directory where your simple-s3.yml file is saved.
|
21
|
+
|
22
|
+
## Excluding Files
|
23
|
+
|
24
|
+
You can exclude files from the upload by defining a list of files within your simple-s3.yml file:
|
25
|
+
|
26
|
+
```yaml
|
27
|
+
exclude_files:
|
28
|
+
- one.html
|
29
|
+
- two.rb
|
30
|
+
- three.something
|
31
|
+
|
32
|
+
# ... the rest of the simple-s3.yml file
|
33
|
+
```
|
34
|
+
|
35
|
+
## Including Files
|
36
|
+
|
37
|
+
You can also include specific files for the upload
|
38
|
+
|
39
|
+
```yaml
|
40
|
+
include_files:
|
41
|
+
- **/* #default
|
42
|
+
- /path/to/some/other/file.rb
|
43
|
+
|
44
|
+
# ... the rest of the simple-s3.yml file
|
45
|
+
```
|
data/lib/simple-s3/simple-s3.rb
CHANGED
@@ -44,14 +44,18 @@ class SimpleS3
|
|
44
44
|
metadata = config['metadata'] || {}
|
45
45
|
metadata[:access] ||= 'public-read'
|
46
46
|
|
47
|
+
inc = [inc] unless inc.is_a?(Array)
|
48
|
+
|
47
49
|
files = []
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
inc.each do |ii|
|
51
|
+
Dir[ii].each do |file|
|
52
|
+
name = File.basename(file)
|
53
|
+
found = false
|
54
|
+
exclude.each do |ex|
|
55
|
+
found = true if file.start_with?(ex) || ex == name
|
56
|
+
end
|
57
|
+
files.push(file) unless found
|
53
58
|
end
|
54
|
-
files.push(file) unless found
|
55
59
|
end
|
56
60
|
|
57
61
|
raise 'Simple-S3: No files found' if files.length == 0
|
data/lib/simple-s3/version.rb
CHANGED
metadata
CHANGED
@@ -3,10 +3,10 @@ name: simple-s3
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
+
- 1
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 0.0.14
|
9
|
+
version: 1.0.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Matias Niemela
|
@@ -45,7 +45,6 @@ files:
|
|
45
45
|
- lib/simple-s3.rb
|
46
46
|
- lib/simple-s3/simple-s3.rb
|
47
47
|
- lib/simple-s3/version.rb
|
48
|
-
- simple-s3.gem
|
49
48
|
- simple-s3.gemspec
|
50
49
|
has_rdoc: true
|
51
50
|
homepage: https://github.com/yearofmoo/simple-s3
|
data/simple-s3.gem
DELETED
Binary file
|