taps 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/taps/schema.rb +7 -0
- data/spec/schema_spec.rb +6 -1
- metadata +6 -6
data/VERSION.yml
CHANGED
data/lib/taps/schema.rb
CHANGED
@@ -21,6 +21,13 @@ module Schema
|
|
21
21
|
'password' => uri.password,
|
22
22
|
'host' => uri.host,
|
23
23
|
}
|
24
|
+
config = sqlite_config(url) if config['adapter'] == 'sqlite3'
|
25
|
+
config
|
26
|
+
end
|
27
|
+
|
28
|
+
def sqlite_config(url)
|
29
|
+
m = %r{(sqlite3?)://(.+)}.match(url)
|
30
|
+
{ 'adapter' => 'sqlite3', 'database' => m[2] }
|
24
31
|
end
|
25
32
|
|
26
33
|
def connection(database_url)
|
data/spec/schema_spec.rb
CHANGED
@@ -19,7 +19,12 @@ describe Taps::Schema do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it "translates sqlite in the database url to sqlite3" do
|
22
|
-
Taps::Schema.create_config("sqlite://
|
22
|
+
Taps::Schema.create_config("sqlite://mydb")['adapter'].should == 'sqlite3'
|
23
|
+
end
|
24
|
+
|
25
|
+
it "translates sqlite database path" do
|
26
|
+
Taps::Schema.create_config("sqlite://pathtodb/mydb")['database'].should == 'pathtodb/mydb'
|
27
|
+
Taps::Schema.create_config("sqlite:///pathtodb/mydb")['database'].should == '/pathtodb/mydb'
|
23
28
|
end
|
24
29
|
|
25
30
|
it "connects activerecord to the database" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Chimal, Jr.
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-03-04 00:00:00 -08:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -86,19 +86,19 @@ files:
|
|
86
86
|
- spec/base.rb
|
87
87
|
- spec/utils_spec.rb
|
88
88
|
- spec/server_spec.rb
|
89
|
-
- spec/schema_spec.rb
|
90
89
|
- spec/client_session_spec.rb
|
90
|
+
- spec/schema_spec.rb
|
91
91
|
- lib/taps/db_session.rb
|
92
|
+
- lib/taps/client_session.rb
|
92
93
|
- lib/taps/progress_bar.rb
|
93
94
|
- lib/taps/cli.rb
|
94
95
|
- lib/taps/adapter_hacks.rb
|
95
96
|
- lib/taps/adapter_hacks/invalid_text_limit.rb
|
96
97
|
- lib/taps/adapter_hacks/non_rails_schema_dump.rb
|
97
|
-
- lib/taps/schema.rb
|
98
98
|
- lib/taps/server.rb
|
99
|
-
- lib/taps/
|
100
|
-
- lib/taps/client_session.rb
|
99
|
+
- lib/taps/schema.rb
|
101
100
|
- lib/taps/config.rb
|
101
|
+
- lib/taps/utils.rb
|
102
102
|
- README.rdoc
|
103
103
|
- LICENSE
|
104
104
|
- VERSION.yml
|