ghazel-mysql2 0.2.6.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.
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/CHANGELOG.md +117 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +240 -0
- data/Rakefile +5 -0
- data/VERSION +1 -0
- data/benchmark/active_record.rb +53 -0
- data/benchmark/allocations.rb +33 -0
- data/benchmark/escape.rb +39 -0
- data/benchmark/query_with_mysql_casting.rb +83 -0
- data/benchmark/query_without_mysql_casting.rb +50 -0
- data/benchmark/sequel.rb +39 -0
- data/benchmark/setup_db.rb +115 -0
- data/examples/eventmachine.rb +21 -0
- data/examples/threaded.rb +20 -0
- data/ext/mysql2/client.c +728 -0
- data/ext/mysql2/client.h +41 -0
- data/ext/mysql2/extconf.rb +69 -0
- data/ext/mysql2/mysql2_ext.c +12 -0
- data/ext/mysql2/mysql2_ext.h +38 -0
- data/ext/mysql2/result.c +478 -0
- data/ext/mysql2/result.h +20 -0
- data/lib/active_record/connection_adapters/em_mysql2_adapter.rb +62 -0
- data/lib/active_record/connection_adapters/mysql2_adapter.rb +657 -0
- data/lib/active_record/fiber_patches.rb +104 -0
- data/lib/arel/engines/sql/compilers/mysql2_compiler.rb +11 -0
- data/lib/mysql2.rb +16 -0
- data/lib/mysql2/client.rb +240 -0
- data/lib/mysql2/em.rb +37 -0
- data/lib/mysql2/em_fiber.rb +29 -0
- data/lib/mysql2/error.rb +15 -0
- data/lib/mysql2/result.rb +5 -0
- data/mysql2.gemspec +90 -0
- data/spec/em/em_spec.rb +49 -0
- data/spec/mysql2/client_spec.rb +367 -0
- data/spec/mysql2/error_spec.rb +25 -0
- data/spec/mysql2/result_spec.rb +318 -0
- data/spec/rcov.opts +3 -0
- data/spec/spec_helper.rb +67 -0
- data/tasks/benchmarks.rake +8 -0
- data/tasks/compile.rake +54 -0
- data/tasks/jeweler.rake +17 -0
- data/tasks/rspec.rake +16 -0
- data/tasks/vendor_mysql.rake +41 -0
- metadata +119 -0
data/tasks/jeweler.rake
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
begin
|
2
|
+
require 'jeweler'
|
3
|
+
JEWELER = Jeweler::Tasks.new do |gem|
|
4
|
+
gem.name = "mysql2"
|
5
|
+
gem.summary = "A simple, fast Mysql library for Ruby, binding to libmysql"
|
6
|
+
gem.email = "seniorlopez@gmail.com"
|
7
|
+
gem.homepage = "http://github.com/brianmario/mysql2"
|
8
|
+
gem.authors = ["Brian Lopez"]
|
9
|
+
gem.require_paths = ["lib", "ext"]
|
10
|
+
gem.extra_rdoc_files = `git ls-files *.rdoc`.split("\n")
|
11
|
+
gem.files = `git ls-files`.split("\n")
|
12
|
+
gem.extensions = ["ext/mysql2/extconf.rb"]
|
13
|
+
gem.files.include %w(lib/jeweler/templates/.document lib/jeweler/templates/.gitignore)
|
14
|
+
end
|
15
|
+
rescue LoadError
|
16
|
+
puts "jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler"
|
17
|
+
end
|
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
begin
|
2
|
+
require 'rspec'
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
desc "Run all examples with RCov"
|
6
|
+
RSpec::Core::RakeTask.new('spec:rcov') do |t|
|
7
|
+
t.rcov = true
|
8
|
+
end
|
9
|
+
RSpec::Core::RakeTask.new('spec') do |t|
|
10
|
+
t.verbose = true
|
11
|
+
end
|
12
|
+
|
13
|
+
task :default => :spec
|
14
|
+
rescue LoadError
|
15
|
+
puts "rspec, or one of its dependencies, is not available. Install it with: sudo gem install rspec"
|
16
|
+
end
|
@@ -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
|
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ghazel-mysql2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 69
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 6
|
10
|
+
- 1
|
11
|
+
version: 0.2.6.1
|
12
|
+
platform: ruby
|
13
|
+
authors:
|
14
|
+
- Brian Lopez
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2010-10-19 00:00:00 -07:00
|
20
|
+
default_executable:
|
21
|
+
dependencies: []
|
22
|
+
|
23
|
+
description:
|
24
|
+
email: seniorlopez@gmail.com
|
25
|
+
executables: []
|
26
|
+
|
27
|
+
extensions:
|
28
|
+
- ext/mysql2/extconf.rb
|
29
|
+
extra_rdoc_files:
|
30
|
+
- README.rdoc
|
31
|
+
files:
|
32
|
+
- .gitignore
|
33
|
+
- .rspec
|
34
|
+
- CHANGELOG.md
|
35
|
+
- MIT-LICENSE
|
36
|
+
- README.rdoc
|
37
|
+
- Rakefile
|
38
|
+
- VERSION
|
39
|
+
- benchmark/active_record.rb
|
40
|
+
- benchmark/allocations.rb
|
41
|
+
- benchmark/escape.rb
|
42
|
+
- benchmark/query_with_mysql_casting.rb
|
43
|
+
- benchmark/query_without_mysql_casting.rb
|
44
|
+
- benchmark/sequel.rb
|
45
|
+
- benchmark/setup_db.rb
|
46
|
+
- examples/eventmachine.rb
|
47
|
+
- examples/threaded.rb
|
48
|
+
- ext/mysql2/client.c
|
49
|
+
- ext/mysql2/client.h
|
50
|
+
- ext/mysql2/extconf.rb
|
51
|
+
- ext/mysql2/mysql2_ext.c
|
52
|
+
- ext/mysql2/mysql2_ext.h
|
53
|
+
- ext/mysql2/result.c
|
54
|
+
- ext/mysql2/result.h
|
55
|
+
- lib/active_record/connection_adapters/em_mysql2_adapter.rb
|
56
|
+
- lib/active_record/connection_adapters/mysql2_adapter.rb
|
57
|
+
- lib/active_record/fiber_patches.rb
|
58
|
+
- lib/arel/engines/sql/compilers/mysql2_compiler.rb
|
59
|
+
- lib/mysql2.rb
|
60
|
+
- lib/mysql2/client.rb
|
61
|
+
- lib/mysql2/em.rb
|
62
|
+
- lib/mysql2/em_fiber.rb
|
63
|
+
- lib/mysql2/error.rb
|
64
|
+
- lib/mysql2/result.rb
|
65
|
+
- mysql2.gemspec
|
66
|
+
- spec/em/em_spec.rb
|
67
|
+
- spec/mysql2/client_spec.rb
|
68
|
+
- spec/mysql2/error_spec.rb
|
69
|
+
- spec/mysql2/result_spec.rb
|
70
|
+
- spec/rcov.opts
|
71
|
+
- spec/spec_helper.rb
|
72
|
+
- tasks/benchmarks.rake
|
73
|
+
- tasks/compile.rake
|
74
|
+
- tasks/jeweler.rake
|
75
|
+
- tasks/rspec.rake
|
76
|
+
- tasks/vendor_mysql.rake
|
77
|
+
has_rdoc: true
|
78
|
+
homepage: http://github.com/brianmario/mysql2
|
79
|
+
licenses: []
|
80
|
+
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options:
|
83
|
+
- --charset=UTF-8
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
- ext
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 3
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
hash: 3
|
102
|
+
segments:
|
103
|
+
- 0
|
104
|
+
version: "0"
|
105
|
+
requirements: []
|
106
|
+
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 1.4.2
|
109
|
+
signing_key:
|
110
|
+
specification_version: 3
|
111
|
+
summary: A simple, fast Mysql library for Ruby, binding to libmysql
|
112
|
+
test_files:
|
113
|
+
- spec/em/em_spec.rb
|
114
|
+
- spec/mysql2/client_spec.rb
|
115
|
+
- spec/mysql2/error_spec.rb
|
116
|
+
- spec/mysql2/result_spec.rb
|
117
|
+
- spec/spec_helper.rb
|
118
|
+
- examples/eventmachine.rb
|
119
|
+
- examples/threaded.rb
|