sam / do fork watch download tarball
public
Rubygem
Description: DataObjects
Homepage: http://rubyforge.org/projects/dorb
Clone URL: git://github.com/sam/do.git
Work towards a working autotest...
sam (author)
Mon Feb 11 11:54:33 -0800 2008
commit  bc8bc8f5d9eeddefe47e41a50548bf00a3771f9e
tree    8a0bb0039999657456fd6951e23a77e1cb5c2dce
parent  fa45cd9661e8830541039bbebc330ab261df6a3b
...
1
 
2
...
1
2
3
0
@@ -1 +1,2 @@
0
 pkg
0
+*.db
0
\ No newline at end of file
...
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
 
 
 
 
26
...
1
2
3
4
 
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
7
8
9
10
11
12
0
@@ -1,24 +1,10 @@
0
+require 'set'
0
+require 'fastthread'
0
 require 'date'
0
 require 'logger'
0
-require File.dirname(__FILE__) + '/connection_pool'
0
 
0
-# Thanks http://www.rubyweeklynews.org/20051120
0
-class DateTime
0
- def to_time
0
- Time.mktime(year, mon, day, hour, min, sec)
0
- end
0
-
0
- def to_date
0
- Date.new(year, mon, day)
0
- end
0
-end
0
-
0
-class Time
0
- def to_datetime
0
- DateTime.civil(year, mon, day, hour, min, sec)
0
- end
0
-
0
- def to_s_db
0
- strftime("%Y-%m-%d %X")
0
- end
0
-end
0
\ No newline at end of file
0
+require File.dirname(__FILE__) + "/connection"
0
+require File.dirname(__FILE__) + "/transaction"
0
+require File.dirname(__FILE__) + "/command"
0
+require File.dirname(__FILE__) + "/result_data"
0
+require File.dirname(__FILE__) + "/reader"
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
...
1
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
4
5
0
@@ -1,32 +1,5 @@
0
 require File.dirname(__FILE__) + '/spec_helper'
0
 
0
-describe "Connectable", :shared => true do
0
- before :each do
0
- @c = $adapter_module::Connection.new($connection_string)
0
- @c.open
0
- end
0
-
0
- after :each do
0
- @c.close
0
- end
0
-end
0
-
0
-describe "DO::Connection" do
0
- it_should_behave_like "Connectable"
0
-
0
- it "should be able to be opened" do
0
- @c.should be_is_a($adapter_module::Connection)
0
- @c.state.should == 0
0
- end
0
-
0
- it "should be able to create a related command" do
0
- @c.open
0
- cmd = @c.create_command("select * from table1")
0
- cmd.connection.should == @c
0
- end
0
-
0
-end
0
-
0
 describe "DO::Command" do
0
   it_should_behave_like "Connectable"
0
 
...
1
2
3
4
5
6
7
 
 
8
9
10
11
 
 
12
13
 
14
15
 
16
17
 
18
19
 
20
21
22
...
1
 
 
2
3
4
 
5
6
7
 
 
 
8
9
10
 
11
12
 
13
14
 
15
16
 
17
18
19
20
0
@@ -1,22 +1,20 @@
0
 require 'spec'
0
-$:.push File.join(File.dirname(__FILE__), '..', 'lib')
0
-require 'data_objects'
0
 
0
 adapter = (ENV["ADAPTER"] || "sqlite3").dup
0
 
0
-require "do_#{adapter}"
0
+require File.dirname(__FILE__) + "/../lib/data_objects"
0
+require File.dirname(__FILE__) + "/../../do_#{adapter}/lib/do_#{adapter}"
0
 
0
-adapter_module = adapter.dup
0
-adapter_module[0] = adapter_module[0].chr.upcase
0
-$adapter_module = DataObject.const_get(adapter_module)
0
+adapter_module = adapter.dup.capitalize
0
+$adapter_module = DataObjects.const_get(adapter_module)
0
 
0
-$connection_string = case adapter
0
+$uri = case adapter
0
 when "sqlite3"
0
- "dbname=do_rb"
0
+ "sqlite3://do_rb.db"
0
 when "mysql"
0
- "socket=/tmp/mysql.sock user=root dbname=do_rb"
0
+ "mysql://root@localhost/do_rb//tmp/mysql.sock"
0
 when "postgres"
0
- "dbname=do_rb"
0
+ "postgres://localhost/do_rb"
0
 end
0
 
0
 $escape = $adapter_module::QUOTE_COLUMN

Comments

    No one has commented yet.