dm-sqlite-adapter 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 +11 -8
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/dm-sqlite-adapter.gemspec +5 -5
- data/lib/dm-sqlite-adapter/adapter.rb +6 -1
- data/spec/adapter_spec.rb +10 -0
- data/tasks/local_gemfile.rake +5 -7
- metadata +5 -11
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -35,12 +35,12 @@
|
|
35
35
|
source 'http://rubygems.org'
|
36
36
|
|
37
37
|
DATAMAPPER = 'git://github.com/datamapper'
|
38
|
-
DM_VERSION = '~> 1.0.
|
39
|
-
DO_VERSION = '~> 0.10.
|
38
|
+
DM_VERSION = '~> 1.0.1'
|
39
|
+
DO_VERSION = '~> 0.10.2'
|
40
40
|
|
41
41
|
group :runtime do # Runtime dependencies (as in the gemspec)
|
42
42
|
|
43
|
-
gem 'do_sqlite3', DO_VERSION,
|
43
|
+
gem 'do_sqlite3', DO_VERSION, do_options.dup
|
44
44
|
gem 'dm-do-adapter', DM_VERSION, :git => "#{DATAMAPPER}/dm-do-adapter.git"
|
45
45
|
|
46
46
|
end
|
@@ -50,7 +50,7 @@ group(:development) do # Development dependencies (as in the gemspec)
|
|
50
50
|
gem 'dm-migrations', DM_VERSION, :git => "#{DATAMAPPER}/dm-migrations.git"
|
51
51
|
|
52
52
|
gem 'rake', '~> 0.8.7'
|
53
|
-
gem 'rspec', '~> 1.3'
|
53
|
+
gem 'rspec', '~> 1.3', :git => 'git://github.com/snusnu/rspec', :branch => 'heckle_fix_plus_gemfile'
|
54
54
|
gem 'jeweler', '~> 1.4'
|
55
55
|
|
56
56
|
end
|
@@ -58,16 +58,19 @@ end
|
|
58
58
|
group :datamapper do # We need this because we want to pin these dependencies to their git master sources
|
59
59
|
|
60
60
|
if ENV['EXTLIB']
|
61
|
-
gem 'extlib', '~> 0.9.15',
|
61
|
+
gem 'extlib', '~> 0.9.15', :git => "#{DATAMAPPER}/extlib.git", :require => nil
|
62
62
|
else
|
63
|
-
gem 'activesupport', '~> 3.0.0
|
63
|
+
gem 'activesupport', '~> 3.0.0', :git => 'git://github.com/rails/rails.git', :branch => '3-0-stable', :require => nil
|
64
64
|
end
|
65
65
|
|
66
|
+
do_options = {}
|
67
|
+
do_options[:git] = "#{DATAMAPPER}/do.git" if ENV['DO_GIT'] == 'true'
|
68
|
+
|
66
69
|
gem 'dm-core', DM_VERSION, :git => "#{DATAMAPPER}/dm-core.git"
|
67
|
-
gem 'data_objects', DO_VERSION,
|
70
|
+
gem 'data_objects', DO_VERSION, do_options.dup
|
68
71
|
|
69
72
|
plugins = ENV['PLUGINS'] || ENV['PLUGIN']
|
70
|
-
plugins =
|
73
|
+
plugins = plugins.to_s.tr(',', ' ').split.push('dm-migrations').uniq
|
71
74
|
|
72
75
|
plugins.each do |plugin|
|
73
76
|
gem plugin, DM_VERSION, :git => "#{DATAMAPPER}/#{plugin}.git"
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/dm-sqlite-adapter.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-sqlite-adapter}
|
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 = ["Dan Kubb"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-09-07}
|
13
13
|
s.description = %q{Sqlite3 Adapter for DataMapper}
|
14
14
|
s.email = %q{dan.kubb@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -51,16 +51,16 @@ Gem::Specification.new do |s|
|
|
51
51
|
|
52
52
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
53
53
|
s.add_runtime_dependency(%q<do_sqlite3>, ["~> 0.10.2"])
|
54
|
-
s.add_runtime_dependency(%q<dm-do-adapter>, ["~> 1.0.
|
54
|
+
s.add_runtime_dependency(%q<dm-do-adapter>, ["~> 1.0.1"])
|
55
55
|
s.add_development_dependency(%q<rspec>, ["~> 1.3"])
|
56
56
|
else
|
57
57
|
s.add_dependency(%q<do_sqlite3>, ["~> 0.10.2"])
|
58
|
-
s.add_dependency(%q<dm-do-adapter>, ["~> 1.0.
|
58
|
+
s.add_dependency(%q<dm-do-adapter>, ["~> 1.0.1"])
|
59
59
|
s.add_dependency(%q<rspec>, ["~> 1.3"])
|
60
60
|
end
|
61
61
|
else
|
62
62
|
s.add_dependency(%q<do_sqlite3>, ["~> 0.10.2"])
|
63
|
-
s.add_dependency(%q<dm-do-adapter>, ["~> 1.0.
|
63
|
+
s.add_dependency(%q<dm-do-adapter>, ["~> 1.0.1"])
|
64
64
|
s.add_dependency(%q<rspec>, ["~> 1.3"])
|
65
65
|
end
|
66
66
|
end
|
@@ -17,7 +17,12 @@ module DataMapper
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def normalize_options(options)
|
20
|
-
|
20
|
+
# TODO Once do_sqlite3 accepts both a Pathname or a String,
|
21
|
+
# normalizing database and path won't be necessary anymore
|
22
|
+
db = (options[:database] || options.delete('database')).to_s
|
23
|
+
path = (options[:path ] || options.delete('path')).to_s
|
24
|
+
|
25
|
+
options.update(:adapter => 'sqlite3', :database => db, :path => path)
|
21
26
|
end
|
22
27
|
|
23
28
|
end
|
data/spec/adapter_spec.rb
CHANGED
@@ -29,4 +29,14 @@ describe 'DataMapper::Adapters::SqliteAdapter' do
|
|
29
29
|
it { subject.options[:adapter].should == 'sqlite3' }
|
30
30
|
end
|
31
31
|
|
32
|
+
describe "with 'database' given as Symbol" do
|
33
|
+
subject { DataMapper::Adapters::SqliteAdapter.new(:default, { :adapter => 'sqlite', :database => :name }) }
|
34
|
+
it { subject.options[:database].should == 'name' }
|
35
|
+
end
|
36
|
+
|
37
|
+
describe "with 'path' given as Symbol" do
|
38
|
+
subject { DataMapper::Adapters::SqliteAdapter.new(:default, { :adapter => 'sqlite', :path => :name }) }
|
39
|
+
it { subject.options[:path].should == 'name' }
|
40
|
+
end
|
41
|
+
|
32
42
|
end
|
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-sqlite-adapter
|
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
|
- Dan Kubb
|
@@ -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,7 +25,6 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ~>
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 51
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
- 10
|
@@ -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
|
@@ -105,7 +101,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
101
|
requirements:
|
106
102
|
- - ">="
|
107
103
|
- !ruby/object:Gem::Version
|
108
|
-
hash: 3
|
109
104
|
segments:
|
110
105
|
- 0
|
111
106
|
version: "0"
|
@@ -114,7 +109,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
109
|
requirements:
|
115
110
|
- - ">="
|
116
111
|
- !ruby/object:Gem::Version
|
117
|
-
hash: 3
|
118
112
|
segments:
|
119
113
|
- 0
|
120
114
|
version: "0"
|