storage 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,112 +1,124 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- storage (0.1.3)
4
+ storage (0.1.5)
5
5
  aws-s3 (~> 0.6.2)
6
6
 
7
7
  GEM
8
8
  remote: http://gems.simplesideias.com.br/
9
9
  specs:
10
- abstract (1.0.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
- builder (~> 2.1.2)
18
- erubis (~> 2.6.6)
19
- i18n (~> 0.5.0)
20
- rack (~> 1.2.1)
21
- rack-mount (~> 0.6.14)
22
- rack-test (~> 0.5.7)
23
- tzinfo (~> 0.3.23)
24
- activemodel (3.0.9)
25
- activesupport (= 3.0.9)
26
- builder (~> 2.1.2)
27
- i18n (~> 0.5.0)
28
- activerecord (3.0.9)
29
- activemodel (= 3.0.9)
30
- activesupport (= 3.0.9)
31
- arel (~> 2.0.10)
32
- tzinfo (~> 0.3.23)
33
- activeresource (3.0.9)
34
- activemodel (= 3.0.9)
35
- activesupport (= 3.0.9)
36
- activesupport (3.0.9)
37
- archive-tar-minitar (0.5.2)
38
- arel (2.0.10)
10
+ actionmailer (3.1.1)
11
+ actionpack (= 3.1.1)
12
+ mail (~> 2.3.0)
13
+ actionpack (3.1.1)
14
+ activemodel (= 3.1.1)
15
+ activesupport (= 3.1.1)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ i18n (~> 0.6)
19
+ rack (~> 1.3.2)
20
+ rack-cache (~> 1.1)
21
+ rack-mount (~> 0.8.2)
22
+ rack-test (~> 0.6.1)
23
+ sprockets (~> 2.0.2)
24
+ activemodel (3.1.1)
25
+ activesupport (= 3.1.1)
26
+ builder (~> 3.0.0)
27
+ i18n (~> 0.6)
28
+ activerecord (3.1.1)
29
+ activemodel (= 3.1.1)
30
+ activesupport (= 3.1.1)
31
+ arel (~> 2.2.1)
32
+ tzinfo (~> 0.3.29)
33
+ activeresource (3.1.1)
34
+ activemodel (= 3.1.1)
35
+ activesupport (= 3.1.1)
36
+ activesupport (3.1.1)
37
+ multi_json (~> 1.0)
38
+ arel (2.2.1)
39
39
  aws-s3 (0.6.2)
40
40
  builder
41
41
  mime-types
42
42
  xml-simple
43
- builder (2.1.2)
44
- columnize (0.3.4)
45
- diff-lcs (1.1.2)
46
- erubis (2.6.6)
47
- abstract (>= 1.0.0)
43
+ builder (3.0.0)
44
+ coderay (0.9.8)
45
+ diff-lcs (1.1.3)
46
+ erubis (2.7.0)
48
47
  fakeweb (1.3.0)
49
- i18n (0.5.0)
50
- linecache19 (0.5.12)
51
- ruby_core_source (>= 0.1.4)
52
- mail (2.2.19)
53
- activesupport (>= 2.3.6)
48
+ hike (1.2.1)
49
+ i18n (0.6.0)
50
+ json (1.6.1)
51
+ mail (2.3.0)
54
52
  i18n (>= 0.4.0)
55
53
  mime-types (~> 1.16)
56
54
  treetop (~> 1.4.8)
55
+ method_source (0.6.6)
56
+ ruby_parser (~> 2.0.5)
57
57
  mime-types (1.16)
58
+ multi_json (1.0.3)
58
59
  nokogiri (1.4.7)
59
- polyglot (0.3.1)
60
- rack (1.2.3)
61
- rack-mount (0.6.14)
60
+ polyglot (0.3.2)
61
+ pry (0.9.6.2)
62
+ coderay (~> 0.9.8)
63
+ method_source (~> 0.6.5)
64
+ ruby_parser (~> 2.0.5)
65
+ slop (~> 2.1.0)
66
+ rack (1.3.4)
67
+ rack-cache (1.1)
68
+ rack (>= 0.4)
69
+ rack-mount (0.8.3)
62
70
  rack (>= 1.0.0)
63
- rack-test (0.5.7)
71
+ rack-ssl (1.3.2)
72
+ rack
73
+ rack-test (0.6.1)
64
74
  rack (>= 1.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)
75
+ rails (3.1.1)
76
+ actionmailer (= 3.1.1)
77
+ actionpack (= 3.1.1)
78
+ activerecord (= 3.1.1)
79
+ activeresource (= 3.1.1)
80
+ activesupport (= 3.1.1)
71
81
  bundler (~> 1.0)
72
- railties (= 3.0.9)
73
- railties (3.0.9)
74
- actionpack (= 3.0.9)
75
- activesupport (= 3.0.9)
82
+ railties (= 3.1.1)
83
+ railties (3.1.1)
84
+ actionpack (= 3.1.1)
85
+ activesupport (= 3.1.1)
86
+ rack-ssl (~> 1.3.2)
76
87
  rake (>= 0.8.7)
77
88
  rdoc (~> 3.4)
78
- thor (~> 0.14.4)
89
+ thor (~> 0.14.6)
79
90
  rake (0.9.2)
80
- rdoc (3.8)
81
- rspec (2.5.0)
82
- rspec-core (~> 2.5.0)
83
- rspec-expectations (~> 2.5.0)
84
- rspec-mocks (~> 2.5.0)
85
- rspec-core (2.5.2)
86
- rspec-expectations (2.5.0)
91
+ rdoc (3.10)
92
+ json (~> 1.4)
93
+ rspec (2.7.0)
94
+ rspec-core (~> 2.7.0)
95
+ rspec-expectations (~> 2.7.0)
96
+ rspec-mocks (~> 2.7.0)
97
+ rspec-core (2.7.0)
98
+ rspec-expectations (2.7.0)
87
99
  diff-lcs (~> 1.1.2)
88
- rspec-mocks (2.5.0)
89
- rspec-rails (2.5.0)
100
+ rspec-mocks (2.7.0)
101
+ rspec-rails (2.7.0)
90
102
  actionpack (~> 3.0)
91
103
  activesupport (~> 3.0)
92
104
  railties (~> 3.0)
93
- rspec (~> 2.5.0)
94
- ruby-debug-base19 (0.11.25)
95
- columnize (>= 0.3.1)
96
- linecache19 (>= 0.5.11)
97
- ruby_core_source (>= 0.1.4)
98
- ruby-debug19 (0.11.6)
99
- columnize (>= 0.3.1)
100
- linecache19 (>= 0.5.11)
101
- ruby-debug-base19 (>= 0.11.19)
102
- ruby_core_source (0.1.5)
103
- archive-tar-minitar (>= 0.5.2)
105
+ rspec (~> 2.7.0)
106
+ ruby_parser (2.0.6)
107
+ sexp_processor (~> 3.0)
108
+ sexp_processor (3.0.7)
109
+ slop (2.1.0)
110
+ sprockets (2.0.2)
111
+ hike (~> 1.2)
112
+ rack (~> 1.0)
113
+ tilt (~> 1.1, != 1.3.0)
104
114
  sqlite3 (1.3.4)
105
115
  thor (0.14.6)
106
- treetop (1.4.9)
116
+ tilt (1.3.3)
117
+ treetop (1.4.10)
118
+ polyglot
107
119
  polyglot (>= 0.3.1)
108
- tzinfo (0.3.29)
109
- xml-simple (1.1.0)
120
+ tzinfo (0.3.30)
121
+ xml-simple (1.1.1)
110
122
 
111
123
  PLATFORMS
112
124
  ruby
@@ -114,8 +126,8 @@ PLATFORMS
114
126
  DEPENDENCIES
115
127
  fakeweb (~> 1.3.0)
116
128
  nokogiri (~> 1.4.4)
117
- rails (~> 3.0)
118
- rspec-rails (~> 2.5.0)
119
- ruby-debug19
129
+ pry
130
+ rails (~> 3.1)
131
+ rspec-rails (~> 2.7.0)
120
132
  sqlite3 (~> 1.3.3)
121
133
  storage!
@@ -46,7 +46,8 @@ module Storage
46
46
  end
47
47
 
48
48
  def find_object(file, options = {})
49
- AWS::S3::S3Object.find(file, options[:bucket])
49
+ path = options.fetch(:name, file)
50
+ AWS::S3::S3Object.find(path, options[:bucket])
50
51
  end
51
52
 
52
53
  def find_bucket_or_create(name)
@@ -2,7 +2,7 @@ module Storage
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 3
5
+ PATCH = 5
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
@@ -57,7 +57,7 @@ describe Storage::Strategies::S3 do
57
57
  it "should remove an existing file" do
58
58
  object = mock("object")
59
59
  object.should_receive(:delete).and_return(true)
60
- Storage::Strategies::S3.should_receive(:find_object).with("lorem.txt", :bucket => "files").and_return(object)
60
+ Storage::Strategies::S3.should_receive(:find_object).with(:name => "lorem.txt", :bucket => "files").and_return(object)
61
61
 
62
62
  Storage.remove("lorem.txt", :bucket => "files").should be_true
63
63
  end
@@ -91,10 +91,10 @@ describe Storage::Strategies::S3 do
91
91
  it "should raise when saving a file that already exists" do
92
92
  object = mock("object")
93
93
  options = {:name => "lorem.txt", :bucket => "files"}
94
- Storage::Strategies::S3.should_receive(:find_object).with(@source, options).and_return(object)
94
+ Storage::Strategies::S3.should_receive(:find_object).with(options).and_return(object)
95
95
 
96
96
  expect {
97
- Storage.store(@source, :name => "lorem.txt", :bucket => "files")
97
+ Storage.store(@source, options)
98
98
  }.to raise_error(Storage::FileAlreadyExistsError)
99
99
  end
100
100
  end
data/storage.gemspec CHANGED
@@ -19,10 +19,10 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.add_dependency "aws-s3", "~> 0.6.2"
21
21
 
22
- s.add_development_dependency "rails" , "~> 3.0"
22
+ s.add_development_dependency "rails" , "~> 3.1"
23
23
  s.add_development_dependency "fakeweb" , "~> 1.3.0"
24
- s.add_development_dependency "rspec-rails" , "~> 2.5.0"
24
+ s.add_development_dependency "rspec-rails" , "~> 2.7.0"
25
25
  s.add_development_dependency "nokogiri" , "~> 1.4.4"
26
26
  s.add_development_dependency "sqlite3" , "~> 1.3.3"
27
- s.add_development_dependency "ruby-debug19" if RUBY_VERSION >= "1.9"
27
+ s.add_development_dependency "pry"
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-07 00:00:00.000000000 Z
12
+ date: 2011-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-s3
16
- requirement: &70179973046000 !ruby/object:Gem::Requirement
16
+ requirement: &70300994093180 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,21 +21,21 @@ dependencies:
21
21
  version: 0.6.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70179973046000
24
+ version_requirements: *70300994093180
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rails
27
- requirement: &70179973061260 !ruby/object:Gem::Requirement
27
+ requirement: &70300994120940 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: '3.0'
32
+ version: '3.1'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70179973061260
35
+ version_requirements: *70300994120940
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: fakeweb
38
- requirement: &70179973059740 !ruby/object:Gem::Requirement
38
+ requirement: &70300994120320 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,21 +43,21 @@ dependencies:
43
43
  version: 1.3.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70179973059740
46
+ version_requirements: *70300994120320
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec-rails
49
- requirement: &70179973058100 !ruby/object:Gem::Requirement
49
+ requirement: &70300994119240 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 2.5.0
54
+ version: 2.7.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70179973058100
57
+ version_requirements: *70300994119240
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: nokogiri
60
- requirement: &70179973056700 !ruby/object:Gem::Requirement
60
+ requirement: &70300994117700 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.4.4
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70179973056700
68
+ version_requirements: *70300994117700
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sqlite3
71
- requirement: &70179973053920 !ruby/object:Gem::Requirement
71
+ requirement: &70300994150300 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 1.3.3
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70179973053920
79
+ version_requirements: *70300994150300
80
80
  - !ruby/object:Gem::Dependency
81
- name: ruby-debug19
82
- requirement: &70179973061040 !ruby/object:Gem::Requirement
81
+ name: pry
82
+ requirement: &70300994147180 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70179973061040
90
+ version_requirements: *70300994147180
91
91
  description: ! 'This gem provides a simple API for multiple storage backends. Supported
92
92
  storages: Amazon S3 and FileSystem.'
93
93
  email:
@@ -130,7 +130,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  segments:
132
132
  - 0
133
- hash: 3809248445555190213
133
+ hash: -2661529604855007369
134
134
  required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  none: false
136
136
  requirements:
@@ -139,10 +139,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  segments:
141
141
  - 0
142
- hash: 3809248445555190213
142
+ hash: -2661529604855007369
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 1.8.6
145
+ rubygems_version: 1.8.10
146
146
  signing_key:
147
147
  specification_version: 3
148
148
  summary: ! 'This gem provides a simple API for multiple storage backends. Supported