mysql 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ $my = Mysql.connect($host, $user, $passwd)
@@ -0,0 +1,3 @@
1
+ $my.query("create database #{$db}")
2
+ $created = true
3
+ $my.select_db $db
@@ -0,0 +1 @@
1
+ $my.query("create table test (id int not null, str char(32) not null)")
@@ -0,0 +1,2 @@
1
+ $my.query("insert into test (id, str) values (1, 'foo')")
2
+ $my.query("insert into test (id, str) values (2, 'bar')")
@@ -0,0 +1,4 @@
1
+ res = $my.query("select * from test")
2
+ if res.num_rows != 2 then raise "num_rows: failed" end
3
+ if res.fetch_row != ["1", "foo"] then raise "fetch_row: failed" end
4
+ if res.fetch_hash != {"id"=>"2", "str"=>"bar"} then raise "fetch_hash: failed" end
@@ -0,0 +1,2 @@
1
+ $my.query("update test set id=0, str='hoge'")
2
+ if $my.affected_rows != 2 then raise "update: failed" end
@@ -0,0 +1 @@
1
+ $my.query("drop table test")
@@ -0,0 +1,2 @@
1
+ $my.query("drop database #{$db}")
2
+ $created = false
@@ -0,0 +1 @@
1
+ $my.close
data/test.rb ADDED
@@ -0,0 +1,33 @@
1
+ # This is script to test for mysql-ruby module.
2
+ # $Id: test.rb,v 1.5 2002/01/07 01:17:28 tommy Exp $
3
+ #
4
+ # Execute in mysql-ruby top directory.
5
+ # Modify following $host, $user, $passwd and $db if needed.
6
+ # $host: hostname mysql running
7
+ # $user: mysql username (not unix login user)
8
+ # $passwd: mysql access passwd for $user
9
+ # $db: database name for this test. it must not exist before testing.
10
+
11
+ require "./mysql.o"
12
+
13
+ $host = ARGV.shift
14
+ $user = ARGV.shift
15
+ $passwd = ARGV.shift
16
+ $db = ARGV.shift || "rubytest"
17
+
18
+ begin
19
+ Dir.glob("t/[0-9]*.rb").sort.each do |f|
20
+ f =~ /^t\/\d+(.*)\.rb$/
21
+ print $1 + "."*(20-$1.length)
22
+ $stdout.flush
23
+ load f
24
+ print "ok\n"
25
+ end
26
+ ensure
27
+ if $created
28
+ begin
29
+ Mysql.new($host, $user, $passwd).query("drop database #{$db}")
30
+ rescue
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,128 @@
1
+ body {
2
+ color: black;
3
+ background: white;
4
+ margin-left: 10%;
5
+ margin-right: 10%;
6
+ }
7
+
8
+ h1 {
9
+ color: white;
10
+ background: #08d;
11
+ width: 100%;
12
+ }
13
+
14
+ h1 a {
15
+ color: white;
16
+ }
17
+
18
+ h1 a:link {
19
+ }
20
+
21
+ h1 a:visited {
22
+ color: white;
23
+ }
24
+
25
+ h1 a:hover {
26
+ }
27
+
28
+ h2 {
29
+ width: 100%;
30
+ border: thin #0cc;
31
+ border-style: solid none;
32
+ background: #cff;
33
+ }
34
+
35
+ h3 {
36
+ width: 100%;
37
+ border: thin #0cc;
38
+ border-style: none none solid;
39
+ background: #eff;
40
+ }
41
+
42
+ h4 {
43
+ border: thin #0cc;
44
+ border-style: none none solid;
45
+ }
46
+
47
+ dt {
48
+ font-weight: bold;
49
+ }
50
+
51
+ dd {
52
+ margin-bottom: 3ex;
53
+ }
54
+
55
+ table {
56
+ border-collapse: collapse;
57
+ }
58
+
59
+ th {
60
+ background-color: #00ffff;
61
+ }
62
+
63
+ td {
64
+ background-color: #eeeeee;
65
+ }
66
+
67
+ div.intro {
68
+ margin-right: 10%;
69
+ margin-left: 10%;
70
+ font-size: 90%;
71
+ }
72
+
73
+ div.code {
74
+ margin-left: 10%;
75
+ color: white;
76
+ background: black;
77
+ border: thin inset;
78
+ padding: 4px;
79
+ }
80
+
81
+ div.code2 {
82
+ margin-left: 10%;
83
+ color: white;
84
+ background: darkgreen;
85
+ border: thin inset;
86
+ padding: 4px;
87
+ }
88
+
89
+ pre {
90
+ margin: 20px;
91
+ padding: 4px;
92
+ border: #363 inset;
93
+ color: #fff;
94
+ background: #232;
95
+ width: 80%;
96
+ }
97
+
98
+
99
+ /*
100
+ a {
101
+ background: #eee;
102
+ }
103
+ */
104
+
105
+ a:link {
106
+ color: #008;
107
+ }
108
+
109
+ a:visited {
110
+ color: black;
111
+ }
112
+
113
+ a:hover {
114
+ background: #fcc;
115
+ }
116
+
117
+ .red {
118
+ color: red;
119
+ }
120
+
121
+ .notice {
122
+ font-weight: bold;
123
+ background: #f88;
124
+ }
125
+
126
+ .input {
127
+ font-weight:bold;
128
+ }
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: "0.8"
3
+ specification_version: 1
4
+ name: mysql
5
+ version: !ruby/object:Gem::Version
6
+ version: 2.5.1
7
+ date: 2004-10-20
8
+ summary: MySQL/Ruby provides the same functions for Ruby programs that the MySQL C API provides for C programs.
9
+ require_paths:
10
+ - lib
11
+ author: TOMITA Masahiro
12
+ email: tommy@tmtm.org
13
+ homepage: http://www.tmtm.org/en/mysql/ruby/
14
+ rubyforge_project:
15
+ description:
16
+ autorequire: mysql
17
+ default_executable:
18
+ bindir: bin
19
+ has_rdoc: false
20
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
21
+ requirements:
22
+ -
23
+ - ">"
24
+ - !ruby/object:Gem::Version
25
+ version: 0.0.0
26
+ version:
27
+ platform: ruby
28
+ files:
29
+ - t
30
+ - COPYING
31
+ - COPYING.ja
32
+ - README.html
33
+ - README_ja.html
34
+ - extconf.rb
35
+ - mysql-compat.rb
36
+ - mysql.c.in
37
+ - test.rb
38
+ - tommy.css
39
+ - mysql-ruby-2.5.1.gem
40
+ - mysql-ruby.gemspec
41
+ - t/00connect.rb
42
+ - t/10create_db.rb
43
+ - t/20create_table.rb
44
+ - t/30insert.rb
45
+ - t/40select.rb
46
+ - t/50update.rb
47
+ - t/60drop_table.rb
48
+ - t/70drop_db.rb
49
+ - t/80close.rb
50
+ test_files: []
51
+ rdoc_options: []
52
+ extra_rdoc_files: []
53
+ executables: []
54
+ extensions:
55
+ - extconf.rb
56
+ requirements: []
57
+ dependencies: []