rom-relation 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ # v0.1.2 2013-09-02
2
+
3
+ * [feature] Adapter is now auto-loaded based on uri scheme (solnic)
4
+
5
+ [Compare v0.1.1..v0.1.2](https://github.com/rom-rb/rom-relation/compare/v0.1.1...v0.1.2)
1
6
  # v0.1.1 2013-08-30
2
7
 
3
8
  * [feature] Integration with axiom-optimizer (solnic)
data/Gemfile CHANGED
@@ -6,14 +6,14 @@ gemspec
6
6
 
7
7
  gem 'rom-relation', path: '.'
8
8
 
9
- gem 'axiom', git: 'https://github.com/dkubb/axiom.git'
9
+ gem 'axiom', git: 'https://github.com/dkubb/axiom.git', branch: 'master'
10
10
  gem 'rom-mapper', git: 'https://github.com/rom-rb/rom-mapper.git'
11
11
 
12
12
  group :test do
13
13
  gem 'bogus', '~> 0.1'
14
14
  gem 'randexp'
15
15
  gem 'ruby-graphviz'
16
- gem 'axiom-memory-adapter', git: 'https://github.com/dkubb/axiom-memory-adapter.git'
16
+ gem 'axiom-memory-adapter', git: 'https://github.com/dkubb/axiom-memory-adapter.git', branch: 'master'
17
17
  end
18
18
 
19
19
  group :development do
@@ -33,6 +33,8 @@ module ROM
33
33
 
34
34
  end # module ROM
35
35
 
36
+ require 'rom/support/axiom/adapter'
37
+
36
38
  require 'rom/repository'
37
39
  require 'rom/environment'
38
40
  require 'rom/relation'
@@ -0,0 +1,9 @@
1
+ # encoding: utf-8
2
+
3
+ module ROM
4
+ class Relation
5
+
6
+ VERSION = '0.1.2'.freeze
7
+
8
+ end # Relation
9
+ end # Relation
@@ -39,6 +39,8 @@ module Axiom
39
39
  #
40
40
  # @api private
41
41
  def self.build(uri)
42
+ require_adapter(uri)
43
+
42
44
  klass = get(uri)
43
45
 
44
46
  if klass.name == 'Axiom::Adapter::Memory'
@@ -71,6 +73,15 @@ module Axiom
71
73
  }
72
74
  end
73
75
 
76
+ # Try to load an adapter using a standard path
77
+ #
78
+ # @api private
79
+ def self.require_adapter(uri)
80
+ require "rom/support/axiom/adapter/#{uri.scheme}"
81
+ rescue LoadError
82
+ end
83
+ private_class_method :require_adapter
84
+
74
85
  # Set the uri scheme for an adapter class
75
86
  #
76
87
  # @example for a DataObjects adapter
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- require File.expand_path('../lib/rom/version', __FILE__)
3
+ require File.expand_path('../lib/rom/relation/version', __FILE__)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = 'rom-relation'
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = 'piotr.solnica@gmail.com'
11
11
  gem.homepage = 'http://rom-rb.org'
12
12
  gem.require_paths = ['lib']
13
- gem.version = ROM::Relation::VERSION
13
+ gem.version = ROM::Relation::VERSION.dup
14
14
  gem.files = `git ls-files`.split("\n")
15
15
  gem.test_files = `git ls-files -- {spec}/*`.split("\n")
16
16
  gem.license = 'MIT'
@@ -17,6 +17,6 @@ describe 'Setting up environment' do
17
17
  end
18
18
  end
19
19
 
20
- expect(schema[:users]).to be_instance_of(Axiom::Relation::Variable)
20
+ expect(schema[:users]).to be_instance_of(Axiom::Relation::Variable::Materialized)
21
21
  end
22
22
  end
@@ -22,15 +22,13 @@ end
22
22
 
23
23
  require 'rom-relation'
24
24
  require 'rom-mapper'
25
- require 'rom/support/axiom/adapter/memory'
26
25
 
27
26
  require 'devtools/spec_helper'
28
27
  require 'bogus/rspec'
29
28
 
30
29
  include ROM
31
30
 
32
- ROM_ENV = Environment.setup(test: 'memory://test')
33
- ROM_ADAPTER = ENV.fetch('ROM_ADAPTER', :in_memory).to_sym
31
+ ROM_ENV = Environment.setup(test: 'memory://test')
34
32
 
35
33
  Bogus.configure do |config|
36
34
  config.search_modules << ROM
@@ -14,5 +14,5 @@ describe Repository, '#[]=' do
14
14
 
15
15
  it { should eq(relation) }
16
16
 
17
- it { should be_instance_of(Axiom::Relation::Variable) }
17
+ it { should be_instance_of(Axiom::Relation::Variable::Materialized) }
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-relation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
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: 2013-08-30 00:00:00.000000000 Z
12
+ date: 2013-09-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
@@ -176,6 +176,7 @@ files:
176
176
  - lib/rom/mapping.rb
177
177
  - lib/rom/mapping/definition.rb
178
178
  - lib/rom/relation.rb
179
+ - lib/rom/relation/version.rb
179
180
  - lib/rom/repository.rb
180
181
  - lib/rom/schema.rb
181
182
  - lib/rom/schema/definition.rb
@@ -186,7 +187,6 @@ files:
186
187
  - lib/rom/support/axiom/adapter/memory.rb
187
188
  - lib/rom/support/axiom/adapter/postgres.rb
188
189
  - lib/rom/support/axiom/adapter/sqlite3.rb
189
- - lib/rom/version.rb
190
190
  - rom-relation.gemspec
191
191
  - spec/integration/environment_setup_spec.rb
192
192
  - spec/integration/mapping_relations_spec.rb
@@ -1,7 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module ROM
4
- class Relation
5
- VERSION = '0.1.1'
6
- end
7
- end