do_mysql 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rake/gempackagetask'
3
3
 
4
4
  PLUGIN = "do_mysql"
5
5
  NAME = "do_mysql"
6
- VERSION = "0.2.2"
6
+ VERSION = "0.2.3"
7
7
  AUTHOR = "Yehuda Katz"
8
8
  EMAIL = "wycats@gmail.com"
9
9
  HOMEPAGE = "http://dataobjects.devjavu.com"
@@ -24,7 +24,7 @@ spec = Gem::Specification.new do |s|
24
24
  s.require_path = 'lib'
25
25
  s.autorequire = PLUGIN
26
26
  s.extensions = ["ext/extconf.rb"]
27
- s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs,ext}/**/*")
27
+ s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs,ext}/**/*").reject {|x| x =~ /\.(o|bundle)$/ }
28
28
  end
29
29
 
30
30
  Rake::GemPackageTask.new(spec) do |pkg|
data/ext/extconf.rb CHANGED
@@ -22,7 +22,6 @@ else
22
22
  end
23
23
 
24
24
  require 'mkmf'
25
- require 'open3'
26
25
 
27
26
  def config_value(type)
28
27
  ENV["MYSQL_#{type.upcase}"] || mysql_config(type)
@@ -33,13 +32,13 @@ end
33
32
  def mysql_config(type)
34
33
  return @mysql_config[type] if @mysql_config[type]
35
34
 
36
- sin, sout, serr = Open3.popen3("#{@mysql_config_bin} --#{type}")
35
+ sout = `#{@mysql_config_bin} --#{type}`
37
36
 
38
- unless serr.read.empty?
37
+ unless $?.success?
39
38
  raise "mysql_config not found"
40
39
  end
41
40
 
42
- @mysql_config[type] = sout.readline.chomp[2..-1]
41
+ @mysql_config[type] = sout.chomp[2..-1]
43
42
  @mysql_config[type]
44
43
  end
45
44
 
@@ -52,12 +51,10 @@ def have_build_env
52
51
  have_library(libs.shift)
53
52
  end
54
53
  true
55
- # have_header('mysql.h')
56
54
  end
57
55
 
58
- required_libraries = [] #%w(m z socket nsl)
56
+ required_libraries = []
59
57
  desired_functions = %w(mysql_ssl_set)
60
- # compat_functions = %w(PQescapeString PQexecParams)
61
58
 
62
59
  if have_build_env
63
60
  $CFLAGS << ' -Wall '
data/lib/do_mysql.rb CHANGED
@@ -32,7 +32,7 @@ module DataObject
32
32
  @db = Mysql_c.mysql_init(nil)
33
33
  raise ConnectionFailed, "could not allocate a MySQL connection" unless @db
34
34
  conn = Mysql_c.mysql_real_connect(@db, @host, @user, @password, @dbname, @port || 0, @socket, @flags || 0)
35
- raise ConnectionFailed, "The connection with connection string #{@connection_string} failed\n#{Mysql_c.mysql_error(@db)}" unless conn
35
+ raise ConnectionFailed, "Unable to connect to database with provided connection string. \n#{Mysql_c.mysql_error(@db)}" unless conn
36
36
  @state = STATE_OPEN
37
37
  true
38
38
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: do_mysql
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.2
7
- date: 2007-11-18 00:00:00 -08:00
6
+ version: 0.2.3
7
+ date: 2008-01-01 00:00:00 -08:00
8
8
  summary: A DataObject.rb driver for mysql
9
9
  require_paths:
10
10
  - lib
@@ -34,19 +34,9 @@ files:
34
34
  - Rakefile
35
35
  - TODO
36
36
  - lib/do_mysql.rb
37
- - ext/conftest.dSYM
38
- - ext/conftest.dSYM/Contents
39
- - ext/conftest.dSYM/Contents/Info.plist
40
- - ext/conftest.dSYM/Contents/Resources
41
- - ext/conftest.dSYM/Contents/Resources/DWARF
42
- - ext/conftest.dSYM/Contents/Resources/DWARF/conftest
43
37
  - ext/extconf.rb
44
- - ext/Makefile
45
- - ext/mkmf.log
46
- - ext/mysql_c.bundle
47
38
  - ext/mysql_c.c
48
39
  - ext/mysql_c.i
49
- - ext/mysql_c.o
50
40
  test_files: []
51
41
 
52
42
  rdoc_options: []
data/ext/Makefile DELETED
@@ -1,149 +0,0 @@
1
-
2
- SHELL = /bin/sh
3
-
4
- #### Start of system configuration section. ####
5
-
6
- srcdir = .
7
- topdir = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
8
- hdrdir = $(topdir)
9
- VPATH = $(srcdir):$(topdir):$(hdrdir)
10
- prefix = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr
11
- exec_prefix = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr
12
- sitedir = $(DESTDIR)/Library/Ruby/Site
13
- rubylibdir = $(libdir)/ruby/$(ruby_version)
14
- docdir = $(datarootdir)/doc/$(PACKAGE)
15
- dvidir = $(docdir)
16
- datarootdir = $(prefix)/share
17
- archdir = $(rubylibdir)/$(arch)
18
- sbindir = $(exec_prefix)/sbin
19
- psdir = $(docdir)
20
- localedir = $(datarootdir)/locale
21
- htmldir = $(docdir)
22
- datadir = $(datarootdir)
23
- includedir = $(prefix)/include
24
- infodir = $(DESTDIR)/usr/share/info
25
- sysconfdir = $(prefix)/etc
26
- mandir = $(DESTDIR)/usr/share/man
27
- libdir = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib
28
- sharedstatedir = $(prefix)/com
29
- oldincludedir = $(DESTDIR)/usr/include
30
- pdfdir = $(docdir)
31
- sitearchdir = $(sitelibdir)/$(sitearch)
32
- bindir = $(exec_prefix)/bin
33
- localstatedir = $(prefix)/var
34
- sitelibdir = $(sitedir)/$(ruby_version)
35
- libexecdir = $(exec_prefix)/libexec
36
-
37
- CC = gcc
38
- LIBRUBY = $(LIBRUBY_SO)
39
- LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
40
- LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
41
- LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)
42
-
43
- RUBY_EXTCONF_H =
44
- CFLAGS = -fno-common -arch i386 -Os -pipe -fno-common -Wall
45
- INCFLAGS = -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I.
46
- CPPFLAGS = -I/usr/local/mysql/include
47
- CXXFLAGS = $(CFLAGS)
48
- DLDFLAGS = -L. -arch i386
49
- LDSHARED = cc -arch i386 -pipe -bundle
50
- AR = ar
51
- EXEEXT =
52
-
53
- RUBY_INSTALL_NAME = ruby
54
- RUBY_SO_NAME = ruby
55
- arch = universal-darwin9.0
56
- sitearch = universal-darwin9.0
57
- ruby_version = 1.8
58
- ruby = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
59
- RUBY = $(ruby)
60
- RM = rm -f
61
- MAKEDIRS = mkdir -p
62
- INSTALL = /usr/bin/install -c
63
- INSTALL_PROG = $(INSTALL) -m 0755
64
- INSTALL_DATA = $(INSTALL) -m 644
65
- COPY = cp
66
-
67
- #### End of system configuration section. ####
68
-
69
- preload =
70
-
71
- libpath = . $(libdir) /usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm
72
- LIBPATH = -L"." -L"$(libdir)" -L""/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm""
73
- DEFFILE =
74
-
75
- CLEANFILES =
76
- DISTCLEANFILES =
77
-
78
- extout =
79
- extout_prefix =
80
- target_prefix =
81
- LOCAL_LIBS =
82
- LIBS = $(LIBRUBYARG_SHARED) -lmysqlclient -lpthread -ldl -lm
83
- SRCS = mysql_c.c
84
- OBJS = mysql_c.o
85
- TARGET = mysql_c
86
- DLLIB = $(TARGET).bundle
87
- EXTSTATIC =
88
- STATIC_LIB =
89
-
90
- RUBYCOMMONDIR = $(sitedir)$(target_prefix)
91
- RUBYLIBDIR = $(sitelibdir)$(target_prefix)
92
- RUBYARCHDIR = $(sitearchdir)$(target_prefix)
93
-
94
- TARGET_SO = $(DLLIB)
95
- CLEANLIBS = $(TARGET).bundle $(TARGET).il? $(TARGET).tds $(TARGET).map
96
- CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
97
-
98
- all: $(DLLIB)
99
- static: $(STATIC_LIB)
100
-
101
- clean:
102
- @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
103
-
104
- distclean: clean
105
- @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
106
- @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
107
-
108
- realclean: distclean
109
- install: install-so install-rb
110
-
111
- install-so: $(RUBYARCHDIR)
112
- install-so: $(RUBYARCHDIR)/$(DLLIB)
113
- $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
114
- $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
115
- install-rb: pre-install-rb install-rb-default
116
- install-rb-default: pre-install-rb-default
117
- pre-install-rb: Makefile
118
- pre-install-rb-default: Makefile
119
- $(RUBYARCHDIR):
120
- $(MAKEDIRS) $@
121
-
122
- site-install: site-install-so site-install-rb
123
- site-install-so: install-so
124
- site-install-rb: install-rb
125
-
126
- .SUFFIXES: .c .m .cc .cxx .cpp .C .o
127
-
128
- .cc.o:
129
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
130
-
131
- .cxx.o:
132
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
133
-
134
- .cpp.o:
135
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
136
-
137
- .C.o:
138
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
139
-
140
- .c.o:
141
- $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
142
-
143
- $(DLLIB): $(OBJS)
144
- @-$(RM) $@
145
- $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
146
-
147
-
148
-
149
- $(OBJS): ruby.h defines.h
@@ -1,25 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>CFBundleDevelopmentRegion</key>
6
- <string>English</string>
7
- <key>CFBundleIdentifier</key>
8
- <string>com.apple.xcode.dsym.conftest</string>
9
- <key>CFBundleInfoDictionaryVersion</key>
10
- <string>6.0</string>
11
- <key>CFBundlePackageType</key>
12
- <string>dSYM</string>
13
- <key>CFBundleShortVersionString</key>
14
- <string>1.0</string>
15
- <key>CFBundleSignature</key>
16
- <string>????</string>
17
- <key>CFBundleVersion</key>
18
- <string>1.0</string>
19
- <key>dSYM_UUID</key>
20
- <dict>
21
- <key>i386</key>
22
- <string>05 b9 4d f7 0d 04 81 0a df 53 f8 8d ab f7 aa 08</string>
23
- </dict>
24
- </dict>
25
- </plist>
data/ext/mkmf.log DELETED
@@ -1,24 +0,0 @@
1
- find_library: checking for mysql_query() in -lmysqlclient... -------------------- yes
2
-
3
- "gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -I/usr/local/mysql/include -arch i386 -Os -pipe -fno-common conftest.c -L"." -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L""/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm"" -L. -arch i386 -lruby -lmysqlclient -lpthread -ldl -lm "
4
- conftest.c: In function ‘t’:
5
- conftest.c:3: error: ‘mysql_query’ undeclared (first use in this function)
6
- conftest.c:3: error: (Each undeclared identifier is reported only once
7
- conftest.c:3: error: for each function it appears in.)
8
- checked program was:
9
- /* begin */
10
- 1: /*top*/
11
- 2: int main() { return 0; }
12
- 3: int t() { void ((*volatile p)()); p = (void ((*)()))mysql_query; return 0; }
13
- /* end */
14
-
15
- "gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -I/usr/local/mysql/include -arch i386 -Os -pipe -fno-common conftest.c -L"." -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L""/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm"" -L. -arch i386 -lruby -lmysqlclient -lpthread -ldl -lm "
16
- checked program was:
17
- /* begin */
18
- 1: /*top*/
19
- 2: int main() { return 0; }
20
- 3: int t() { mysql_query(); return 0; }
21
- /* end */
22
-
23
- --------------------
24
-
data/ext/mysql_c.bundle DELETED
Binary file
data/ext/mysql_c.o DELETED
Binary file