mysql 2.8.1-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +56 -0
- data/COPYING.ja +51 -0
- data/History.txt +12 -0
- data/Manifest.txt +16 -0
- data/README.txt +23 -0
- data/Rakefile +22 -0
- data/ext/mysql_api/extconf.rb +98 -0
- data/ext/mysql_api/mysql.c +2273 -0
- data/extra/README.html +1098 -0
- data/extra/README_ja.html +1323 -0
- data/extra/tommy.css +134 -0
- data/lib/1.8/mysql_api.so +0 -0
- data/lib/1.9/mysql_api.so +0 -0
- data/lib/mysql.rb +16 -0
- data/tasks/gem.rake +24 -0
- data/tasks/native.rake +30 -0
- data/tasks/vendor_mysql.rake +41 -0
- data/test/test_mysql.rb +1488 -0
- metadata +100 -0
data/extra/tommy.css
ADDED
@@ -0,0 +1,134 @@
|
|
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
|
+
border: thin solid;
|
58
|
+
}
|
59
|
+
|
60
|
+
tr,th,td {
|
61
|
+
border: thin solid;
|
62
|
+
padding: 3px;
|
63
|
+
}
|
64
|
+
|
65
|
+
th {
|
66
|
+
background-color: #00ffff;
|
67
|
+
}
|
68
|
+
|
69
|
+
td {
|
70
|
+
background-color: #eeeeee;
|
71
|
+
}
|
72
|
+
|
73
|
+
div.intro {
|
74
|
+
margin-right: 10%;
|
75
|
+
margin-left: 10%;
|
76
|
+
font-size: 90%;
|
77
|
+
}
|
78
|
+
|
79
|
+
div.code {
|
80
|
+
margin-left: 10%;
|
81
|
+
color: white;
|
82
|
+
background: black;
|
83
|
+
border: thin inset;
|
84
|
+
padding: 4px;
|
85
|
+
}
|
86
|
+
|
87
|
+
div.code2 {
|
88
|
+
margin-left: 10%;
|
89
|
+
color: white;
|
90
|
+
background: darkgreen;
|
91
|
+
border: thin inset;
|
92
|
+
padding: 4px;
|
93
|
+
}
|
94
|
+
|
95
|
+
pre {
|
96
|
+
margin: 20px;
|
97
|
+
padding: 4px;
|
98
|
+
border: #363 inset;
|
99
|
+
color: #fff;
|
100
|
+
background: #232;
|
101
|
+
width: 80%;
|
102
|
+
}
|
103
|
+
|
104
|
+
|
105
|
+
/*
|
106
|
+
a {
|
107
|
+
background: #eee;
|
108
|
+
}
|
109
|
+
*/
|
110
|
+
|
111
|
+
a:link {
|
112
|
+
color: #008;
|
113
|
+
}
|
114
|
+
|
115
|
+
a:visited {
|
116
|
+
color: black;
|
117
|
+
}
|
118
|
+
|
119
|
+
a:hover {
|
120
|
+
background: #fcc;
|
121
|
+
}
|
122
|
+
|
123
|
+
.red {
|
124
|
+
color: red;
|
125
|
+
}
|
126
|
+
|
127
|
+
.notice {
|
128
|
+
font-weight: bold;
|
129
|
+
background: #f88;
|
130
|
+
}
|
131
|
+
|
132
|
+
.input {
|
133
|
+
font-weight:bold;
|
134
|
+
}
|
Binary file
|
Binary file
|
data/lib/mysql.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# support multiple ruby version (fat binaries under windows)
|
2
|
+
begin
|
3
|
+
require 'mysql_api'
|
4
|
+
rescue LoadError
|
5
|
+
if RUBY_PLATFORM =~ /mingw|mswin/ then
|
6
|
+
RUBY_VERSION =~ /(\d+.\d+)/
|
7
|
+
require "#{$1}/mysql_api"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# define version string to be used internally for the Gem by Hoe.
|
12
|
+
class Mysql
|
13
|
+
module GemVersion
|
14
|
+
VERSION = '2.8.1'
|
15
|
+
end
|
16
|
+
end
|
data/tasks/gem.rake
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'rubygems/package_task'
|
2
|
+
require 'hoe'
|
3
|
+
|
4
|
+
HOE = Hoe.spec 'mysql' do
|
5
|
+
self.rubyforge_name = 'mysql-win'
|
6
|
+
self.author = ['TOMITA Masahiro']
|
7
|
+
self.email = %w[tommy@tmtm.org]
|
8
|
+
self.need_tar = false
|
9
|
+
self.need_zip = false
|
10
|
+
|
11
|
+
spec_extras[:required_ruby_version] = Gem::Requirement.new('>= 1.8.6')
|
12
|
+
|
13
|
+
spec_extras[:extensions] = ["ext/mysql_api/extconf.rb"]
|
14
|
+
|
15
|
+
extra_dev_deps << ['rake-compiler', "~> 0.5"]
|
16
|
+
end
|
17
|
+
|
18
|
+
file "#{HOE.spec.name}.gemspec" => ['Rakefile', 'tasks/gem.rake'] do |t|
|
19
|
+
puts "Generating #{t.name}"
|
20
|
+
File.open(t.name, 'w') { |f| f.puts HOE.spec.to_yaml }
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "Generate or update the standalone gemspec file for the project"
|
24
|
+
task :gemspec => ["#{HOE.spec.name}.gemspec"]
|
data/tasks/native.rake
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# use rake-compiler for building the extension
|
2
|
+
require 'rake/extensiontask'
|
3
|
+
|
4
|
+
MYSQL_VERSION = "5.0.83"
|
5
|
+
MYSQL_MIRROR = ENV['MYSQL_MIRROR'] || "http://mysql.localhost.net.ar"
|
6
|
+
|
7
|
+
Rake::ExtensionTask.new('mysql_api', HOE.spec) do |ext|
|
8
|
+
# reference where the vendored MySQL got extracted
|
9
|
+
mysql_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', "mysql-#{MYSQL_VERSION}-win32"))
|
10
|
+
|
11
|
+
# define target for extension (supporting fat binaries)
|
12
|
+
if RUBY_PLATFORM =~ /mingw/ then
|
13
|
+
ruby_ver = RUBY_VERSION.match(/(\d+\.\d+)/)[1]
|
14
|
+
ext.lib_dir = "lib/#{ruby_ver}"
|
15
|
+
end
|
16
|
+
|
17
|
+
# automatically add build options to avoid need of manual input
|
18
|
+
if RUBY_PLATFORM =~ /mswin|mingw/ then
|
19
|
+
ext.config_options << "--with-mysql-include=#{mysql_lib}/include"
|
20
|
+
ext.config_options << "--with-mysql-lib=#{mysql_lib}/lib/opt"
|
21
|
+
else
|
22
|
+
ext.cross_compile = true
|
23
|
+
ext.cross_platform = ['i386-mingw32', 'i386-mswin32']
|
24
|
+
ext.cross_config_options << "--with-mysql-include=#{mysql_lib}/include"
|
25
|
+
ext.cross_config_options << "--with-mysql-lib=#{mysql_lib}/lib/opt"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# ensure things are compiled prior testing
|
30
|
+
task :test => [:compile]
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'rake/clean'
|
2
|
+
require 'rake/extensioncompiler'
|
3
|
+
|
4
|
+
# download mysql library and headers
|
5
|
+
directory "vendor"
|
6
|
+
|
7
|
+
file "vendor/mysql-noinstall-#{MYSQL_VERSION}-win32.zip" => ['vendor'] do |t|
|
8
|
+
base_version = MYSQL_VERSION.gsub(/\.[0-9]+$/, '')
|
9
|
+
url = "http://dev.mysql.com/get/Downloads/MySQL-#{base_version}/#{File.basename(t.name)}/from/#{MYSQL_MIRROR}/"
|
10
|
+
when_writing "downloading #{t.name}" do
|
11
|
+
cd File.dirname(t.name) do
|
12
|
+
sh "wget -c #{url} || curl -C - -O #{url}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
file "vendor/mysql-#{MYSQL_VERSION}-win32/include/mysql.h" => ["vendor/mysql-noinstall-#{MYSQL_VERSION}-win32.zip"] do |t|
|
18
|
+
full_file = File.expand_path(t.prerequisites.last)
|
19
|
+
when_writing "creating #{t.name}" do
|
20
|
+
cd "vendor" do
|
21
|
+
sh "unzip #{full_file} mysql-#{MYSQL_VERSION}-win32/bin/** mysql-#{MYSQL_VERSION}-win32/include/** mysql-#{MYSQL_VERSION}-win32/lib/**"
|
22
|
+
end
|
23
|
+
# update file timestamp to avoid Rake perform this extraction again.
|
24
|
+
touch t.name
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# clobber expanded packages
|
29
|
+
CLOBBER.include("vendor/mysql-#{MYSQL_VERSION}-win32")
|
30
|
+
|
31
|
+
# vendor:mysql
|
32
|
+
task 'vendor:mysql' => ["vendor/mysql-#{MYSQL_VERSION}-win32/include/mysql.h"]
|
33
|
+
|
34
|
+
# hook into cross compilation vendored mysql dependency
|
35
|
+
if RUBY_PLATFORM =~ /mingw|mswin/ then
|
36
|
+
Rake::Task['compile'].prerequisites.unshift 'vendor:mysql'
|
37
|
+
else
|
38
|
+
if Rake::Task.tasks.map {|t| t.name }.include? 'cross'
|
39
|
+
Rake::Task['cross'].prerequisites.unshift 'vendor:mysql'
|
40
|
+
end
|
41
|
+
end
|