Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleaned requires

  • Loading branch information...
commit b5f621569612d9675d536d7a5dc0a15d0dce4364 1 parent 3a8ddda
@qoobaa authored
View
8 lib/sqlite3.rb
@@ -1,8 +1,16 @@
+# start (required by translator)
+require "time"
+require "date"
+# end
+
+require "ffi"
+
require "sqlite3/constants"
require "sqlite3/errors"
require "sqlite3/pragmas"
require "sqlite3/statement"
require "sqlite3/translator"
+require "sqlite3/resultset"
require "sqlite3/value"
require "sqlite3/encoding"
require "sqlite3/database"
View
21 lib/sqlite3/driver/ffi/api.rb
@@ -1,5 +1,3 @@
-require "ffi"
-
module SQLite3
module Driver
module FFI
@@ -7,7 +5,24 @@ module FFI
module API
extend ::FFI::Library
- ffi_lib "libsqlite3.so"
+ ffi_lib case RUBY_PLATFORM.downcase
+ when /darwin/
+ "libsqlite3.dylib"
+ when /linux|freebsd|netbsd|openbsd|dragonfly|solaris/
+ "libsqlite3.so"
+ when /win32/
+ "sqlite3.dll"
+ else
+ abort <<-EOF
+==== UNSUPPORTED PLATFORM ======================================================
+The platform '#{RUBY_PLATFORM}' is unsupported. Please help the author by
+editing the following file to allow your sqlite3 library to be found, and
+submitting a patch to qoobaa@gmail.com. Thanks!
+
+#{__FILE__}
+================================================================================
+ EOF
+ end
attach_function :sqlite3_libversion, [], :string
attach_function :sqlite3_open, [:string, :pointer], :int
View
2  lib/sqlite3/errors.rb
@@ -1,5 +1,3 @@
-require "sqlite3/constants"
-
module SQLite3
class Exception < ::StandardError
View
2  lib/sqlite3/pragmas.rb
@@ -1,5 +1,3 @@
-require "sqlite3/errors"
-
module SQLite3
# This module is intended for inclusion solely by the Database class. It
View
3  lib/sqlite3/resultset.rb
@@ -1,6 +1,3 @@
-require "sqlite3/constants"
-require "sqlite3/errors"
-
module SQLite3
# The ResultSet object encapsulates the enumerability of a query's output.
View
3  lib/sqlite3/statement.rb
@@ -1,6 +1,3 @@
-require "sqlite3/errors"
-require "sqlite3/resultset"
-
module SQLite3
# A statement represents a prepared-but-unexecuted SQL query. It will rarely
View
3  lib/sqlite3/translator.rb
@@ -1,6 +1,3 @@
-require "time"
-require "date"
-
module SQLite3
# The Translator class encapsulates the logic and callbacks necessary for
View
2  lib/sqlite3/value.rb
@@ -1,5 +1,3 @@
-require "sqlite3/constants"
-
module SQLite3
class Value
View
1  test/test_database_initialization.rb
@@ -24,7 +24,6 @@ def test_database_closing
assert @db.closed?
end
-
def test_encoding_conversion_from_utf_16_to_utf_8
expected_string = "test"
db_filename = "test_database_encoding.db"
Please sign in to comment.
Something went wrong with that request. Please try again.