lib/sqlite_ext.rb in sqlite_ext-1.4.0 vs lib/sqlite_ext.rb in sqlite_ext-1.5.0
- old
+ new
@@ -1,16 +1,23 @@
gem "sqlite3"
require "sqlite3"
module SqliteExt
-
require "sqlite_ext/version"
- require "sqlite_ext/db_method_prepends"
-
+ require "sqlite_ext/db_tracks_created_functions"
+ require "sqlite_ext/db_auto_creates_registered_functions"
end
class SQLite3::Database
- prepend SqliteExt::DbMethodPrepends
+ if RUBY_VERSION.split('.').first.to_i >= 2
+ puts 'Ruby >= 2'
+ prepend SqliteExt::DbTracksCreatedFunctions
+ prepend SqliteExt::DbAutoCreatesRegisteredFunctions
+ else
+ puts 'Ruby < 2'
+ include SqliteExt::DbTracksCreatedFunctions
+ include SqliteExt::DbAutoCreatesRegisteredFunctions
+ end
end
module SqliteExt
class << self