storage 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +36 -36
- data/lib/storage/strategies/s3.rb +4 -0
- data/lib/storage/version.rb +1 -1
- data/spec/storage/strategies/s3_spec.rb +12 -0
- data/storage.gemspec +1 -1
- metadata +76 -75
data/Gemfile.lock
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
storage (0.1.
|
4
|
+
storage (0.1.3)
|
5
5
|
aws-s3 (~> 0.6.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://gems.simplesideias.com.br/
|
9
9
|
specs:
|
10
10
|
abstract (1.0.0)
|
11
|
-
actionmailer (3.0.
|
12
|
-
actionpack (= 3.0.
|
13
|
-
mail (~> 2.2.
|
14
|
-
actionpack (3.0.
|
15
|
-
activemodel (= 3.0.
|
16
|
-
activesupport (= 3.0.
|
11
|
+
actionmailer (3.0.9)
|
12
|
+
actionpack (= 3.0.9)
|
13
|
+
mail (~> 2.2.19)
|
14
|
+
actionpack (3.0.9)
|
15
|
+
activemodel (= 3.0.9)
|
16
|
+
activesupport (= 3.0.9)
|
17
17
|
builder (~> 2.1.2)
|
18
18
|
erubis (~> 2.6.6)
|
19
19
|
i18n (~> 0.5.0)
|
@@ -21,19 +21,19 @@ GEM
|
|
21
21
|
rack-mount (~> 0.6.14)
|
22
22
|
rack-test (~> 0.5.7)
|
23
23
|
tzinfo (~> 0.3.23)
|
24
|
-
activemodel (3.0.
|
25
|
-
activesupport (= 3.0.
|
24
|
+
activemodel (3.0.9)
|
25
|
+
activesupport (= 3.0.9)
|
26
26
|
builder (~> 2.1.2)
|
27
27
|
i18n (~> 0.5.0)
|
28
|
-
activerecord (3.0.
|
29
|
-
activemodel (= 3.0.
|
30
|
-
activesupport (= 3.0.
|
31
|
-
arel (~> 2.0.
|
28
|
+
activerecord (3.0.9)
|
29
|
+
activemodel (= 3.0.9)
|
30
|
+
activesupport (= 3.0.9)
|
31
|
+
arel (~> 2.0.10)
|
32
32
|
tzinfo (~> 0.3.23)
|
33
|
-
activeresource (3.0.
|
34
|
-
activemodel (= 3.0.
|
35
|
-
activesupport (= 3.0.
|
36
|
-
activesupport (3.0.
|
33
|
+
activeresource (3.0.9)
|
34
|
+
activemodel (= 3.0.9)
|
35
|
+
activesupport (= 3.0.9)
|
36
|
+
activesupport (3.0.9)
|
37
37
|
archive-tar-minitar (0.5.2)
|
38
38
|
arel (2.0.10)
|
39
39
|
aws-s3 (0.6.2)
|
@@ -41,7 +41,7 @@ GEM
|
|
41
41
|
mime-types
|
42
42
|
xml-simple
|
43
43
|
builder (2.1.2)
|
44
|
-
columnize (0.3.
|
44
|
+
columnize (0.3.4)
|
45
45
|
diff-lcs (1.1.2)
|
46
46
|
erubis (2.6.6)
|
47
47
|
abstract (>= 1.0.0)
|
@@ -55,27 +55,29 @@ GEM
|
|
55
55
|
mime-types (~> 1.16)
|
56
56
|
treetop (~> 1.4.8)
|
57
57
|
mime-types (1.16)
|
58
|
-
nokogiri (1.4.
|
58
|
+
nokogiri (1.4.7)
|
59
59
|
polyglot (0.3.1)
|
60
60
|
rack (1.2.3)
|
61
61
|
rack-mount (0.6.14)
|
62
62
|
rack (>= 1.0.0)
|
63
63
|
rack-test (0.5.7)
|
64
64
|
rack (>= 1.0)
|
65
|
-
rails (3.0.
|
66
|
-
actionmailer (= 3.0.
|
67
|
-
actionpack (= 3.0.
|
68
|
-
activerecord (= 3.0.
|
69
|
-
activeresource (= 3.0.
|
70
|
-
activesupport (= 3.0.
|
65
|
+
rails (3.0.9)
|
66
|
+
actionmailer (= 3.0.9)
|
67
|
+
actionpack (= 3.0.9)
|
68
|
+
activerecord (= 3.0.9)
|
69
|
+
activeresource (= 3.0.9)
|
70
|
+
activesupport (= 3.0.9)
|
71
71
|
bundler (~> 1.0)
|
72
|
-
railties (= 3.0.
|
73
|
-
railties (3.0.
|
74
|
-
actionpack (= 3.0.
|
75
|
-
activesupport (= 3.0.
|
72
|
+
railties (= 3.0.9)
|
73
|
+
railties (3.0.9)
|
74
|
+
actionpack (= 3.0.9)
|
75
|
+
activesupport (= 3.0.9)
|
76
76
|
rake (>= 0.8.7)
|
77
|
+
rdoc (~> 3.4)
|
77
78
|
thor (~> 0.14.4)
|
78
|
-
rake (0.
|
79
|
+
rake (0.9.2)
|
80
|
+
rdoc (3.8)
|
79
81
|
rspec (2.5.0)
|
80
82
|
rspec-core (~> 2.5.0)
|
81
83
|
rspec-expectations (~> 2.5.0)
|
@@ -99,14 +101,12 @@ GEM
|
|
99
101
|
ruby-debug-base19 (>= 0.11.19)
|
100
102
|
ruby_core_source (0.1.5)
|
101
103
|
archive-tar-minitar (>= 0.5.2)
|
102
|
-
sqlite3 (1.3.
|
103
|
-
sqlite3-ruby (1.3.3)
|
104
|
-
sqlite3 (>= 1.3.3)
|
104
|
+
sqlite3 (1.3.4)
|
105
105
|
thor (0.14.6)
|
106
106
|
treetop (1.4.9)
|
107
107
|
polyglot (>= 0.3.1)
|
108
|
-
tzinfo (0.3.
|
109
|
-
xml-simple (1.0
|
108
|
+
tzinfo (0.3.29)
|
109
|
+
xml-simple (1.1.0)
|
110
110
|
|
111
111
|
PLATFORMS
|
112
112
|
ruby
|
@@ -117,5 +117,5 @@ DEPENDENCIES
|
|
117
117
|
rails (~> 3.0)
|
118
118
|
rspec-rails (~> 2.5.0)
|
119
119
|
ruby-debug19
|
120
|
-
sqlite3
|
120
|
+
sqlite3 (~> 1.3.3)
|
121
121
|
storage!
|
data/lib/storage/version.rb
CHANGED
@@ -31,6 +31,18 @@ describe Storage::Strategies::S3 do
|
|
31
31
|
Storage::Strategies::S3.connect!
|
32
32
|
end
|
33
33
|
|
34
|
+
it "should disconnect when connection is established" do
|
35
|
+
AWS::S3::Base.should_receive(:connected?).and_return(true)
|
36
|
+
AWS::S3::Base.should_receive(:disconnect!)
|
37
|
+
Storage::Strategies::S3.disconnect!
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should ignore disconnection when connection is not established" do
|
41
|
+
AWS::S3::Base.should_receive(:connected?).and_return(false)
|
42
|
+
AWS::S3::Base.should_not_receive(:disconnect!)
|
43
|
+
Storage::Strategies::S3.disconnect!
|
44
|
+
end
|
45
|
+
|
34
46
|
it "should save a file using file handler" do
|
35
47
|
handler = File.open(@source)
|
36
48
|
AWS::S3::S3Object.should_receive(:store).with("lorem.txt", handler, "files", :access => :public_read)
|
data/storage.gemspec
CHANGED
@@ -23,6 +23,6 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_development_dependency "fakeweb" , "~> 1.3.0"
|
24
24
|
s.add_development_dependency "rspec-rails" , "~> 2.5.0"
|
25
25
|
s.add_development_dependency "nokogiri" , "~> 1.4.4"
|
26
|
-
s.add_development_dependency "sqlite3
|
26
|
+
s.add_development_dependency "sqlite3" , "~> 1.3.3"
|
27
27
|
s.add_development_dependency "ruby-debug19" if RUBY_VERSION >= "1.9"
|
28
28
|
end
|
metadata
CHANGED
@@ -1,104 +1,101 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: storage
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
4
5
|
prerelease:
|
5
|
-
version: 0.1.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Nando Vieira
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-08-07 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: aws-s3
|
17
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70179973046000 !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
18
|
+
requirements:
|
21
19
|
- - ~>
|
22
|
-
- !ruby/object:Gem::Version
|
20
|
+
- !ruby/object:Gem::Version
|
23
21
|
version: 0.6.2
|
24
22
|
type: :runtime
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: rails
|
28
23
|
prerelease: false
|
29
|
-
|
24
|
+
version_requirements: *70179973046000
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rails
|
27
|
+
requirement: &70179973061260 !ruby/object:Gem::Requirement
|
30
28
|
none: false
|
31
|
-
requirements:
|
29
|
+
requirements:
|
32
30
|
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version:
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
35
33
|
type: :development
|
36
|
-
version_requirements: *id002
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: fakeweb
|
39
34
|
prerelease: false
|
40
|
-
|
35
|
+
version_requirements: *70179973061260
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: fakeweb
|
38
|
+
requirement: &70179973059740 !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
42
|
-
requirements:
|
40
|
+
requirements:
|
43
41
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
42
|
+
- !ruby/object:Gem::Version
|
45
43
|
version: 1.3.0
|
46
44
|
type: :development
|
47
|
-
version_requirements: *id003
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: rspec-rails
|
50
45
|
prerelease: false
|
51
|
-
|
46
|
+
version_requirements: *70179973059740
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec-rails
|
49
|
+
requirement: &70179973058100 !ruby/object:Gem::Requirement
|
52
50
|
none: false
|
53
|
-
requirements:
|
51
|
+
requirements:
|
54
52
|
- - ~>
|
55
|
-
- !ruby/object:Gem::Version
|
53
|
+
- !ruby/object:Gem::Version
|
56
54
|
version: 2.5.0
|
57
55
|
type: :development
|
58
|
-
version_requirements: *id004
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: nokogiri
|
61
56
|
prerelease: false
|
62
|
-
|
57
|
+
version_requirements: *70179973058100
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: nokogiri
|
60
|
+
requirement: &70179973056700 !ruby/object:Gem::Requirement
|
63
61
|
none: false
|
64
|
-
requirements:
|
62
|
+
requirements:
|
65
63
|
- - ~>
|
66
|
-
- !ruby/object:Gem::Version
|
64
|
+
- !ruby/object:Gem::Version
|
67
65
|
version: 1.4.4
|
68
66
|
type: :development
|
69
|
-
version_requirements: *id005
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: sqlite3-ruby
|
72
67
|
prerelease: false
|
73
|
-
|
68
|
+
version_requirements: *70179973056700
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sqlite3
|
71
|
+
requirement: &70179973053920 !ruby/object:Gem::Requirement
|
74
72
|
none: false
|
75
|
-
requirements:
|
73
|
+
requirements:
|
76
74
|
- - ~>
|
77
|
-
- !ruby/object:Gem::Version
|
75
|
+
- !ruby/object:Gem::Version
|
78
76
|
version: 1.3.3
|
79
77
|
type: :development
|
80
|
-
version_requirements: *id006
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: ruby-debug19
|
83
78
|
prerelease: false
|
84
|
-
|
79
|
+
version_requirements: *70179973053920
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: ruby-debug19
|
82
|
+
requirement: &70179973061040 !ruby/object:Gem::Requirement
|
85
83
|
none: false
|
86
|
-
requirements:
|
87
|
-
- -
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version:
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
90
88
|
type: :development
|
91
|
-
|
92
|
-
|
93
|
-
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70179973061040
|
91
|
+
description: ! 'This gem provides a simple API for multiple storage backends. Supported
|
92
|
+
storages: Amazon S3 and FileSystem.'
|
93
|
+
email:
|
94
94
|
- fnando.vieira@gmail.com
|
95
95
|
executables: []
|
96
|
-
|
97
96
|
extensions: []
|
98
|
-
|
99
97
|
extra_rdoc_files: []
|
100
|
-
|
101
|
-
files:
|
98
|
+
files:
|
102
99
|
- .gitignore
|
103
100
|
- .rspec
|
104
101
|
- Gemfile
|
@@ -121,32 +118,36 @@ files:
|
|
121
118
|
- storage.gemspec
|
122
119
|
homepage: http://github.com/fnando/storage
|
123
120
|
licenses: []
|
124
|
-
|
125
121
|
post_install_message:
|
126
122
|
rdoc_options: []
|
127
|
-
|
128
|
-
require_paths:
|
123
|
+
require_paths:
|
129
124
|
- lib
|
130
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
131
126
|
none: false
|
132
|
-
requirements:
|
133
|
-
- -
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
version:
|
136
|
-
|
127
|
+
requirements:
|
128
|
+
- - ! '>='
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
segments:
|
132
|
+
- 0
|
133
|
+
hash: 3809248445555190213
|
134
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
135
|
none: false
|
138
|
-
requirements:
|
139
|
-
- -
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version:
|
136
|
+
requirements:
|
137
|
+
- - ! '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
segments:
|
141
|
+
- 0
|
142
|
+
hash: 3809248445555190213
|
142
143
|
requirements: []
|
143
|
-
|
144
144
|
rubyforge_project:
|
145
|
-
rubygems_version: 1.8.
|
145
|
+
rubygems_version: 1.8.6
|
146
146
|
signing_key:
|
147
147
|
specification_version: 3
|
148
|
-
summary:
|
149
|
-
|
148
|
+
summary: ! 'This gem provides a simple API for multiple storage backends. Supported
|
149
|
+
storages: Amazon S3 and FileSystem.'
|
150
|
+
test_files:
|
150
151
|
- spec/resources/file.txt
|
151
152
|
- spec/spec_helper.rb
|
152
153
|
- spec/storage/config_spec.rb
|