t_bird 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a04b405ad8093f57467e301b96237114910f0f2
4
- data.tar.gz: 44403bcd7f7e07a148ce58f445e8054f9b04806e
3
+ metadata.gz: 6ce3e9cd3aab8ffdb2fe7af6d2e70a5d04307c15
4
+ data.tar.gz: e4ba655d030b4d475ce91eaf098b019a4d11bfae
5
5
  SHA512:
6
- metadata.gz: 2d2f1c1ec3b86d06de6b0eee8d1cf34a77825ad029c61c0ff9b3a22aff7c2dfc053718d65445d1416f8354f3b534e1ac79f90de5466cfd903b04bd7c14d092d8
7
- data.tar.gz: 5ffe1199d9615fcef25ca1b79dab5a774c1121ce20cd4061b58143c1b4d1d385a011f9b72ddf24a78d112776177e15895f638a2d0b53d429f5c14a048b19eef2
6
+ metadata.gz: c799f29f81c869701add878ba252bd391189516a06ea50ac9b9aed29b729ddec288c6239fd668fcbd803eaeea490ef7475c891875ba617429e149a5c8443d559
7
+ data.tar.gz: fcd5541967d3dd74465aa01ff29c11ff820ac5ccbf394618068067e55ec0e64b123a6ccc3214d7d3376e6e21e83eaa22a69413fe92c054d55a3d058a3133910a
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ *.DS_Store
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.0.0
4
+ - 2.1.0
5
5
  - 1.9.3
6
- - 1.9.2
7
6
  - jruby-19mode
8
7
  - rbx-19mode
@@ -6,6 +6,7 @@ require 't_bird/processor'
6
6
  require 't_bird/transmitter'
7
7
  require 't_bird/uploader'
8
8
  require 't_bird/version'
9
+ require 'tempfile'
9
10
 
10
11
  module TBird
11
12
  module Errors
@@ -22,7 +22,7 @@ module TBird
22
22
  image.write @tempfile
23
23
  @tempfile
24
24
  end
25
-
25
+
26
26
  def original
27
27
  @file_blob
28
28
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module TBird
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -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 File
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
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-02-04 00:00:00.000000000 Z
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.0
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.