carrierwave-ftp 0.2.4 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a06fd00a7c2fd8bce74d84005b205f42ea8358c5
4
- data.tar.gz: 31c5e0fe7788a06769b13ff10965c666b9dd2b15
3
+ metadata.gz: 7411a47d5afae7740f57a16098cc1802bc18844f
4
+ data.tar.gz: e625d8791b464b33fb434a009bac09accb3ae95b
5
5
  SHA512:
6
- metadata.gz: 773f550671433e6759f82cc10d5640d7cc2a6f08bd1d571d1a140e83bf2d8d1aab3dce9f640faed5dcf6d879250b697905d52d89cb31f58b84f92cfd26ab6c3c
7
- data.tar.gz: 655ed99d7bf2bb4b9dc7311f2a9b254214f1c6a57d68f35fac99f68828f6f42152107eba525054c095bbb550709f517f0e78c0cb12f397dedeb49f99c223edcc
6
+ metadata.gz: 24e5adcdcbf84b7ee81636e3e189248226a611448d14fb1487c72759b0d8616e29429a738f909513a357ef28a9469e662b686cc94874fb24d030fb642f8dfdcc
7
+ data.tar.gz: 30e49e2c97000d9d709ab90c42e9e5b4db01a913c6b5589019d120ab6dad8857271ca8169c67feddbf090c24738af5add58cbf0ca18c797e3937629a64910cb6
data/.travis.yml CHANGED
@@ -2,9 +2,4 @@ language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
4
  - 1.9.3
5
- - 1.9.2
6
- - 1.8.7
7
- - jruby-18mode
8
5
  - jruby-19mode
9
- - rbx-18mode
10
- - rbx-19mode
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CarrierWave FTP storage
2
2
 
3
+ [![Build Status](https://travis-ci.org/luan/carrierwave-ftp.png?branch=master)](https://travis-ci.org/luan/carrierwave-ftp)
4
+ [![Code Climate](https://codeclimate.com/github/luan/carrierwave-ftp.png)](https://codeclimate.com/github/luan/carrierwave-ftp)
5
+ [![Dependency Status](https://gemnasium.com/luan/carrierwave-ftp.png)](https://gemnasium.com/luan/carrierwave-ftp)
6
+
3
7
  This gem adds support for FTP upload to [CarrierWave](https://github.com/jnicklas/carrierwave/)
4
8
 
5
9
  ## Installation
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.license = 'MIT'
22
22
 
23
23
  s.add_dependency "carrierwave", [">= 0.6.2"]
24
- s.add_dependency "net-sftp", ["~> 2.0.5"]
24
+ s.add_dependency "net-sftp", ["~> 2.1.2"]
25
25
  s.add_development_dependency "rspec", ["~> 2.6"]
26
26
  s.add_development_dependency "rake", ["~> 0.9"]
27
27
  end
@@ -37,6 +37,13 @@ module CarrierWave
37
37
  url.gsub(/.*\/(.*?$)/, '\1')
38
38
  end
39
39
 
40
+ def to_file
41
+ temp_file = Tempfile.new(filename)
42
+ temp_file.binmode
43
+ temp_file.write file.body
44
+ temp_file
45
+ end
46
+
40
47
  def size
41
48
  size = nil
42
49
 
@@ -1,7 +1,7 @@
1
1
  module Carrierwave
2
2
  module Storage
3
3
  class FTP
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.5"
5
5
  end
6
6
  end
7
7
  end
@@ -36,6 +36,13 @@ module CarrierWave
36
36
  url.gsub(/.*\/(.*?$)/, '\1')
37
37
  end
38
38
 
39
+ def to_file
40
+ temp_file = Tempfile.new(filename)
41
+ temp_file.binmode
42
+ temp_file.write file.body
43
+ temp_file
44
+ end
45
+
39
46
  def size
40
47
  size = nil
41
48
 
data/spec/ftp_spec.rb CHANGED
@@ -89,6 +89,11 @@ describe CarrierWave::Storage::FTP do
89
89
  @stored.size.should == 14
90
90
  end
91
91
 
92
+ it "returns to_file" do
93
+ @stored.should_receive(:file).and_return(Struct.new(:body).new('some content'))
94
+ @stored.to_file.size.should == 'some content'.length
95
+ end
96
+
92
97
  it "returns the content of the file" do
93
98
  @stored.should_receive(:file).and_return(Struct.new(:body).new('some content'))
94
99
  @stored.read.should == 'some content'
data/spec/sftp_spec.rb CHANGED
@@ -91,6 +91,11 @@ describe CarrierWave::Storage::SFTP do
91
91
  @stored.size.should == 14
92
92
  end
93
93
 
94
+ it "returns to_file" do
95
+ @stored.should_receive(:file).and_return(Struct.new(:body).new('some content'))
96
+ @stored.to_file.size.should == 'some content'.length
97
+ end
98
+
94
99
  it "returns the content of the file" do
95
100
  @stored.should_receive(:file).and_return(Struct.new(:body).new('some content'))
96
101
  @stored.read.should == 'some content'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-ftp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luan Santos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-24 00:00:00.000000000 Z
11
+ date: 2014-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.5
33
+ version: 2.1.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.5
40
+ version: 2.1.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement