omnistore 0.0.23 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,17 +11,17 @@ module OmniStore
11
11
  case mountpoint = OmniStore::Config.mountpoint
12
12
  when Array
13
13
  mountpoint.each do |m|
14
- b = validate(m)
14
+ b = bucket(m)
15
15
  @@keys[m] = {:name => m, :bucket => b}
16
16
  end
17
17
  when Hash
18
18
  mountpoint.each do |k,v|
19
- b = validate(v)
19
+ b = bucket(v)
20
20
  @@keys[k] = {:name => k, :bucket => b}
21
21
  end
22
22
  else
23
23
  m = mountpoint.to_s
24
- b = validate(m)
24
+ b = bucket(m)
25
25
  @@keys[m] = {:name => m, :bucket => b}
26
26
  end
27
27
  end
@@ -57,6 +57,11 @@ module OmniStore
57
57
 
58
58
  private
59
59
 
60
+ def bucket(name)
61
+ item = @@keys.values.find{|item| item[:bucket] && item[:bucket].name == name }
62
+ item ? item[:bucket] : validate(name)
63
+ end
64
+
60
65
  def validate(name)
61
66
  bucket = AWS::S3.new(options).buckets[name]
62
67
  raise OmniStore::Errors::InvalidMountpoint, "Bucket '#{name}' is not found." unless bucket.exists?
@@ -1,3 +1,3 @@
1
1
  module OmniStore
2
- VERSION = "0.0.23"
2
+ VERSION = "0.0.24"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnistore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-27 00:00:00.000000000 Z
12
+ date: 2014-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk
@@ -125,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  segments:
127
127
  - 0
128
- hash: 266300413
128
+ hash: 513048659
129
129
  required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  segments:
136
136
  - 0
137
- hash: 266300413
137
+ hash: 513048659
138
138
  requirements: []
139
139
  rubyforge_project:
140
140
  rubygems_version: 1.8.25