t_bird 0.0.4 → 0.0.5
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -2
- data/lib/t_bird.rb +1 -0
- data/lib/t_bird/processor.rb +1 -1
- data/lib/t_bird/uploader.rb +3 -2
- data/lib/t_bird/version.rb +1 -1
- data/spec/t_bird/processor_spec.rb +2 -1
- data/spec/t_bird/uploader_spec.rb +1 -1
- 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: 6ce3e9cd3aab8ffdb2fe7af6d2e70a5d04307c15
|
4
|
+
data.tar.gz: e4ba655d030b4d475ce91eaf098b019a4d11bfae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c799f29f81c869701add878ba252bd391189516a06ea50ac9b9aed29b729ddec288c6239fd668fcbd803eaeea490ef7475c891875ba617429e149a5c8443d559
|
7
|
+
data.tar.gz: fcd5541967d3dd74465aa01ff29c11ff820ac5ccbf394618068067e55ec0e64b123a6ccc3214d7d3376e6e21e83eaa22a69413fe92c054d55a3d058a3133910a
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/lib/t_bird.rb
CHANGED
data/lib/t_bird/processor.rb
CHANGED
data/lib/t_bird/uploader.rb
CHANGED
@@ -2,14 +2,15 @@
|
|
2
2
|
|
3
3
|
module TBird
|
4
4
|
class Uploader
|
5
|
-
attr_reader :file, :options, :uploads, :content_type, :original_filename, :metadata
|
5
|
+
attr_reader :file, :acl, :options, :uploads, :content_type, :original_filename, :metadata
|
6
6
|
def initialize(file, options = {})
|
7
7
|
@file = file
|
8
|
+
@acl = options.fetch(:acl, :public_read)
|
8
9
|
@options = default_options.merge(options)
|
9
10
|
@uploads = {}
|
10
11
|
@content_type = @file[:type]
|
11
12
|
@original_filename = @file[:filename]
|
12
|
-
@metadata = { content_type: content_type, metadata: @options[:metadata] || {} }
|
13
|
+
@metadata = { acl: acl, content_type: content_type, metadata: @options[:metadata] || {} }
|
13
14
|
end
|
14
15
|
|
15
16
|
def namer
|
data/lib/t_bird/version.rb
CHANGED
@@ -36,7 +36,8 @@ describe TBird::Processor do
|
|
36
36
|
|
37
37
|
it "can write image" do
|
38
38
|
@processor.resize('x200')
|
39
|
-
@processor.write_to_file.must_be_instance_of
|
39
|
+
@processor.write_to_file.must_be_instance_of Tempfile if jruby?
|
40
|
+
@processor.write_to_file.must_be_instance_of File unless jruby?
|
40
41
|
@processor.image.destroy!
|
41
42
|
end
|
42
43
|
end
|
@@ -20,7 +20,7 @@ describe TBird::Uploader do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "can return the metadata" do
|
23
|
-
@uploader.metadata.must_equal({ content_type: 'image/jpeg', metadata: {} })
|
23
|
+
@uploader.metadata.must_equal({ acl: :public_read, content_type: 'image/jpeg', metadata: {} })
|
24
24
|
end
|
25
25
|
|
26
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: t_bird
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Marden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_magick
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.2.
|
135
|
+
rubygems_version: 2.2.2
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Straight forward file uploads for Ruby Apps.
|