kvom 6.8.0.beta.200.720.44fbabd → 6.8.0.beta.200.744.99f67fc

Sign up to get free protection for your applications and to get access to all the features.
data/kvom.gemspec CHANGED
@@ -1,4 +1,7 @@
1
- # -*- encoding: utf-8 -*-
1
+ requirement = Gem::Requirement.new(">= 1.6.2")
2
+ unless requirement.satisfied_by?(Gem::Version.new(Gem::VERSION))
3
+ raise "You need at RubyGems in Version #{requirement} to build this gem."
4
+ end
2
5
  require File.expand_path("../../rake_support/git_based_version", __FILE__)
3
6
 
4
7
  Gem::Specification.new do |s|
@@ -17,7 +20,7 @@ Gem::Specification.new do |s|
17
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
21
  s.require_paths = ["lib"]
19
22
 
20
- s.add_development_dependency "rspec"
23
+ s.add_development_dependency "rspec", "~> 2.8.0"
21
24
  s.add_development_dependency "helpful_configuration"
22
25
 
23
26
  s.add_runtime_dependency "couchrest"
@@ -55,13 +55,12 @@ class DynamodbAdapter < Base
55
55
 
56
56
  def table
57
57
  @table ||= begin
58
- # TODO define dynamo endpoint externally?
59
- AWS.config(:dynamo_db_endpoint => 'dynamodb.eu-west-1.amazonaws.com')
60
-
58
+ endpoint = connection_spec[:dynamo_db_endpoint] || "dynamodb.eu-west-1.amazonaws.com"
61
59
  # TODO: explicit nil testing
62
60
  credentials = {
63
61
  :access_key_id => connection_spec[:access_key_id],
64
62
  :secret_access_key => connection_spec[:secret_access_key],
63
+ :dynamo_db_endpoint => endpoint,
65
64
  }
66
65
  table = AWS::DynamoDB.new(credentials).tables[connection_spec[:table]]
67
66
  table.hash_key = [:hash_key, :string]
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe Kvom::Adapter::DynamodbAdapter, "endpoint configuration", :adapter => "dynamo" do
4
+
5
+ context "when no endpoint is specified" do
6
+
7
+ let(:adapter) {TestModel.adapter}
8
+
9
+ it "is configured to use Ireland" do
10
+ adapter.__send__(:table).config.dynamo_db_endpoint.should == "dynamodb.eu-west-1.amazonaws.com"
11
+ end
12
+ end
13
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,6 @@
1
- $LOAD_PATH.unshift(Pathname(__FILE__) + "../lib")
1
+ # require 'pry'
2
+ require File.expand_path("../../lib/kvom", __FILE__)
2
3
 
3
- require 'pry'
4
-
5
- require 'kvom'
6
4
 
7
5
  class TestModel < Kvom::Base
8
6
  def self.adapter
@@ -34,3 +32,19 @@ class ExampleModel < TestModel
34
32
  property :spam
35
33
  end
36
34
 
35
+ RSpec.configure do |config|
36
+ output = config.output_stream || $stdout
37
+
38
+ adapter_specified_and_different = lambda {|adapter_name|
39
+ if adapter_name
40
+ application_adapter = TestModel.adapter.class.to_s.demodulize
41
+ name = application_adapter.sub("Adapter", "").sub("db", "").downcase
42
+ if name != adapter_name.to_s
43
+ output.print "a"
44
+ true
45
+ end
46
+ end
47
+ }
48
+ output.puts "Run filtered using adapter metadata (a - when skipped)"
49
+ config.filter_run_excluding :adapter => adapter_specified_and_different
50
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kvom
3
3
  version: !ruby/object:Gem::Version
4
- hash: 6271096393
4
+ hash: -51547013038
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 6
@@ -9,10 +9,12 @@ version: !ruby/object:Gem::Version
9
9
  - 0
10
10
  - beta
11
11
  - 200
12
- - 720
13
- - 44
14
- - fbabd
15
- version: 6.8.0.beta.200.720.44fbabd
12
+ - 744
13
+ - 99
14
+ - f
15
+ - 67
16
+ - fc
17
+ version: 6.8.0.beta.200.744.99f67fc
16
18
  platform: ruby
17
19
  authors:
18
20
  - Kristian Hanekamp, Infopark AG
@@ -20,19 +22,21 @@ autorequire:
20
22
  bindir: bin
21
23
  cert_chain: []
22
24
 
23
- date: 2012-07-02 00:00:00 +02:00
25
+ date: 2012-07-05 00:00:00 +02:00
24
26
  default_executable:
25
27
  dependencies:
26
28
  - !ruby/object:Gem::Dependency
27
29
  requirement: &id001 !ruby/object:Gem::Requirement
28
30
  none: false
29
31
  requirements:
30
- - - ">="
32
+ - - ~>
31
33
  - !ruby/object:Gem::Version
32
- hash: 3
34
+ hash: 47
33
35
  segments:
36
+ - 2
37
+ - 8
34
38
  - 0
35
- version: "0"
39
+ version: 2.8.0
36
40
  version_requirements: *id001
37
41
  name: rspec
38
42
  prerelease: false
@@ -154,6 +158,7 @@ files:
154
158
  - lib/kvom/storage/s3_storage.rb
155
159
  - spec/adaptor/base_spec.rb
156
160
  - spec/adaptor/counter_spec.rb
161
+ - spec/adaptor/dynamodb_adaptor_spec.rb
157
162
  - spec/adaptor/model_identity_spec.rb
158
163
  - spec/cache_with_prefix_spec.rb
159
164
  - spec/spec_helper.rb
@@ -198,6 +203,7 @@ summary: Key Value Object Mapper
198
203
  test_files:
199
204
  - spec/adaptor/base_spec.rb
200
205
  - spec/adaptor/counter_spec.rb
206
+ - spec/adaptor/dynamodb_adaptor_spec.rb
201
207
  - spec/adaptor/model_identity_spec.rb
202
208
  - spec/cache_with_prefix_spec.rb
203
209
  - spec/spec_helper.rb