dm-constraints 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +18 -19
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/dm-constraints.gemspec +8 -8
- data/lib/dm-constraints.rb +1 -1
- data/spec/integration/constraints_spec.rb +4 -2
- data/spec/spec_helper.rb +2 -0
- data/tasks/local_gemfile.rake +5 -7
- metadata +7 -13
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -71,14 +71,14 @@
|
|
71
71
|
source 'http://rubygems.org'
|
72
72
|
|
73
73
|
DATAMAPPER = 'git://github.com/datamapper'
|
74
|
-
DM_VERSION = '~> 1.0.
|
74
|
+
DM_VERSION = '~> 1.0.1'
|
75
75
|
|
76
76
|
group :runtime do # Runtime dependencies (as in the gemspec)
|
77
77
|
|
78
78
|
if ENV['EXTLIB']
|
79
|
-
gem 'extlib', '~> 0.9.15',
|
79
|
+
gem 'extlib', '~> 0.9.15', :git => "#{DATAMAPPER}/extlib.git"
|
80
80
|
else
|
81
|
-
gem 'activesupport', '~> 3.0.0
|
81
|
+
gem 'activesupport', '~> 3.0.0', :git => 'git://github.com/rails/rails.git', :branch => '3-0-stable', :require => nil
|
82
82
|
end
|
83
83
|
|
84
84
|
gem 'dm-core', DM_VERSION, :git => "#{DATAMAPPER}/dm-core.git"
|
@@ -88,7 +88,7 @@ end
|
|
88
88
|
group(:development) do # Development dependencies (as in the gemspec)
|
89
89
|
|
90
90
|
gem 'rake', '~> 0.8.7'
|
91
|
-
gem 'rspec', '~> 1.3'
|
91
|
+
gem 'rspec', '~> 1.3', :git => 'git://github.com/snusnu/rspec', :branch => 'heckle_fix_plus_gemfile'
|
92
92
|
gem 'jeweler', '~> 1.4'
|
93
93
|
|
94
94
|
end
|
@@ -107,32 +107,31 @@ end
|
|
107
107
|
group :datamapper do # We need this because we want to pin these dependencies to their git master sources
|
108
108
|
|
109
109
|
adapters = ENV['ADAPTER'] || ENV['ADAPTERS']
|
110
|
-
adapters = adapters.to_s.
|
110
|
+
adapters = adapters.to_s.tr(',', ' ').split.uniq - %w[ in_memory ]
|
111
111
|
|
112
|
-
|
112
|
+
DO_VERSION = '~> 0.10.2'
|
113
|
+
DM_DO_ADAPTERS = %w[ sqlite postgres mysql oracle sqlserver ]
|
113
114
|
|
114
|
-
|
115
|
-
|
115
|
+
if (do_adapters = DM_DO_ADAPTERS & adapters).any?
|
116
|
+
options = {}
|
117
|
+
options[:git] = "#{DATAMAPPER}/do.git" if ENV['DO_GIT'] == 'true'
|
116
118
|
|
117
|
-
gem 'data_objects', DO_VERSION,
|
119
|
+
gem 'data_objects', DO_VERSION, options.dup
|
118
120
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
gem "do_#{adapter}", DO_VERSION, :git => "#{DATAMAPPER}/do.git"
|
123
|
-
end
|
121
|
+
do_adapters.each do |adapter|
|
122
|
+
adapter = 'sqlite3' if adapter == 'sqlite'
|
123
|
+
gem "do_#{adapter}", DO_VERSION, options.dup
|
124
124
|
end
|
125
125
|
|
126
126
|
gem 'dm-do-adapter', DM_VERSION, :git => "#{DATAMAPPER}/dm-do-adapter.git"
|
127
|
+
end
|
127
128
|
|
128
|
-
|
129
|
-
|
130
|
-
end
|
131
|
-
|
129
|
+
adapters.each do |adapter|
|
130
|
+
gem "dm-#{adapter}-adapter", DM_VERSION, :git => "#{DATAMAPPER}/dm-#{adapter}-adapter.git"
|
132
131
|
end
|
133
132
|
|
134
133
|
plugins = ENV['PLUGINS'] || ENV['PLUGIN']
|
135
|
-
plugins =
|
134
|
+
plugins = plugins.to_s.tr(',', ' ').split.push('dm-migrations').uniq
|
136
135
|
|
137
136
|
plugins.each do |plugin|
|
138
137
|
gem plugin, DM_VERSION, :git => "#{DATAMAPPER}/#{plugin}.git"
|
data/Rakefile
CHANGED
@@ -15,8 +15,8 @@ begin
|
|
15
15
|
|
16
16
|
gem.rubyforge_project = 'datamapper'
|
17
17
|
|
18
|
-
gem.add_dependency 'dm-core', '~> 1.0.
|
19
|
-
gem.add_dependency 'dm-migrations', '~> 1.0.
|
18
|
+
gem.add_dependency 'dm-core', '~> 1.0.1'
|
19
|
+
gem.add_dependency 'dm-migrations', '~> 1.0.1'
|
20
20
|
|
21
21
|
gem.add_development_dependency 'rspec', '~> 1.3'
|
22
22
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/dm-constraints.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-constraints}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dirkjan Bussink"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-09-07}
|
13
13
|
s.description = %q{DataMapper plugin constraining relationships}
|
14
14
|
s.email = %q{d.bussink [a] gmail [d] com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -68,17 +68,17 @@ Gem::Specification.new do |s|
|
|
68
68
|
s.specification_version = 3
|
69
69
|
|
70
70
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
71
|
-
s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.
|
72
|
-
s.add_runtime_dependency(%q<dm-migrations>, ["~> 1.0.
|
71
|
+
s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.1"])
|
72
|
+
s.add_runtime_dependency(%q<dm-migrations>, ["~> 1.0.1"])
|
73
73
|
s.add_development_dependency(%q<rspec>, ["~> 1.3"])
|
74
74
|
else
|
75
|
-
s.add_dependency(%q<dm-core>, ["~> 1.0.
|
76
|
-
s.add_dependency(%q<dm-migrations>, ["~> 1.0.
|
75
|
+
s.add_dependency(%q<dm-core>, ["~> 1.0.1"])
|
76
|
+
s.add_dependency(%q<dm-migrations>, ["~> 1.0.1"])
|
77
77
|
s.add_dependency(%q<rspec>, ["~> 1.3"])
|
78
78
|
end
|
79
79
|
else
|
80
|
-
s.add_dependency(%q<dm-core>, ["~> 1.0.
|
81
|
-
s.add_dependency(%q<dm-migrations>, ["~> 1.0.
|
80
|
+
s.add_dependency(%q<dm-core>, ["~> 1.0.1"])
|
81
|
+
s.add_dependency(%q<dm-migrations>, ["~> 1.0.1"])
|
82
82
|
s.add_dependency(%q<rspec>, ["~> 1.3"])
|
83
83
|
end
|
84
84
|
end
|
data/lib/dm-constraints.rb
CHANGED
@@ -39,7 +39,7 @@ module DataMapper
|
|
39
39
|
|
40
40
|
def self.include_constraint_api
|
41
41
|
DataMapper::Adapters::AbstractAdapter.descendants.each do |adapter_class|
|
42
|
-
DataMapper::Adapters.include_constraint_api(
|
42
|
+
DataMapper::Adapters.include_constraint_api(DataMapper::Inflector.demodulize(adapter_class.name))
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -78,8 +78,10 @@ describe 'DataMapper::Constraints', "(with #{DataMapper::Spec.adapter_name})" do
|
|
78
78
|
|
79
79
|
supported_by :postgres, :mysql do
|
80
80
|
it 'should not be able to create related objects with a failing foreign key constraint' do
|
81
|
-
|
82
|
-
|
81
|
+
pending_if 'JRuby throws a DataObjects::SQLError for integrity errors, which is wrong', RUBY_ENGINE == 'jruby' do
|
82
|
+
article = Article.create(:title => 'Man on the Moon')
|
83
|
+
lambda { Comment.create(:body => 'So true!', :article_id => article.id + 1) }.should raise_error(DataObjects::IntegrityError)
|
84
|
+
end
|
83
85
|
end
|
84
86
|
end
|
85
87
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,6 +3,7 @@ require 'rubygems'
|
|
3
3
|
require 'dm-core/spec/setup'
|
4
4
|
require 'dm-core/spec/lib/spec_helper'
|
5
5
|
require 'dm-core/spec/lib/adapter_helpers'
|
6
|
+
require 'dm-core/spec/lib/pending_helpers'
|
6
7
|
|
7
8
|
require 'dm-constraints'
|
8
9
|
|
@@ -10,6 +11,7 @@ Spec::Runner.configure do |config|
|
|
10
11
|
|
11
12
|
config.extend(DataMapper::Spec::Adapters::Helpers)
|
12
13
|
config.extend(DataMapper::Spec::Helpers)
|
14
|
+
config.include(DataMapper::Spec::PendingHelpers)
|
13
15
|
|
14
16
|
config.before(:each) do
|
15
17
|
DataMapper.finalize
|
data/tasks/local_gemfile.rake
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
desc "Support bundling from local source code (allows BUNDLE_GEMFILE=Gemfile.local bundle foo)"
|
2
2
|
task :local_gemfile do |t|
|
3
3
|
|
4
|
-
root
|
5
|
-
datamapper
|
6
|
-
|
7
|
-
source_regex = /DATAMAPPER = 'git:\/\/github.com\/datamapper'/
|
8
|
-
gem_source_regex = /:git => \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/
|
4
|
+
root = Pathname(__FILE__).dirname.parent
|
5
|
+
datamapper = root.parent
|
9
6
|
|
10
7
|
root.join('Gemfile.local').open('w') do |f|
|
11
8
|
root.join('Gemfile').open.each do |line|
|
12
|
-
line.sub!(
|
13
|
-
line.sub!(
|
9
|
+
line.sub!(/DATAMAPPER = 'git:\/\/github.com\/datamapper'/, "DATAMAPPER = '#{datamapper}'")
|
10
|
+
line.sub!(/:git => \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/, ':path => "#{DATAMAPPER}/\1"')
|
11
|
+
line.sub!(/do_options\[:git\] = \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/, 'do_options[:path] = "#{DATAMAPPER}/\1"')
|
14
12
|
f.puts line
|
15
13
|
end
|
16
14
|
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-constraints
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 23
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 1
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
8
|
+
- 1
|
9
|
+
version: 1.0.1
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Dirkjan Bussink
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-09-07 00:00:00 -07:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +25,11 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ~>
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 23
|
30
28
|
segments:
|
31
29
|
- 1
|
32
30
|
- 0
|
33
|
-
-
|
34
|
-
version: 1.0.
|
31
|
+
- 1
|
32
|
+
version: 1.0.1
|
35
33
|
type: :runtime
|
36
34
|
version_requirements: *id001
|
37
35
|
- !ruby/object:Gem::Dependency
|
@@ -42,12 +40,11 @@ dependencies:
|
|
42
40
|
requirements:
|
43
41
|
- - ~>
|
44
42
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 23
|
46
43
|
segments:
|
47
44
|
- 1
|
48
45
|
- 0
|
49
|
-
-
|
50
|
-
version: 1.0.
|
46
|
+
- 1
|
47
|
+
version: 1.0.1
|
51
48
|
type: :runtime
|
52
49
|
version_requirements: *id002
|
53
50
|
- !ruby/object:Gem::Dependency
|
@@ -58,7 +55,6 @@ dependencies:
|
|
58
55
|
requirements:
|
59
56
|
- - ~>
|
60
57
|
- !ruby/object:Gem::Version
|
61
|
-
hash: 9
|
62
58
|
segments:
|
63
59
|
- 1
|
64
60
|
- 3
|
@@ -120,7 +116,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
116
|
requirements:
|
121
117
|
- - ">="
|
122
118
|
- !ruby/object:Gem::Version
|
123
|
-
hash: 3
|
124
119
|
segments:
|
125
120
|
- 0
|
126
121
|
version: "0"
|
@@ -129,7 +124,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
124
|
requirements:
|
130
125
|
- - ">="
|
131
126
|
- !ruby/object:Gem::Version
|
132
|
-
hash: 3
|
133
127
|
segments:
|
134
128
|
- 0
|
135
129
|
version: "0"
|