Permalink
Browse files

Load sqlite3 on-demand rather than making it a hard dependency.

Fixes #84.
Fixes #95.
Fixes #96.
  • Loading branch information...
1 parent 09e1bd3 commit 0b4b66b112dce260f6c4b6c721d9adcd063f23c5 @technomancy technomancy committed Apr 27, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 Gemfile.lock
  2. +1 −0 lib/taps/cli.rb
  3. +0 −1 lib/taps/config.rb
  4. +1 −1 taps.gemspec
View
4 Gemfile.lock
@@ -6,7 +6,6 @@ PATH
rest-client (>= 1.4.0, < 1.7.0)
sequel (~> 3.20.0)
sinatra (~> 1.0.0)
- sqlite3-ruby (~> 1.2)
GEM
remote: http://rubygems.org/
@@ -36,7 +35,7 @@ GEM
sequel (3.20.0)
sinatra (1.0)
rack (>= 1.0)
- sqlite3-ruby (1.3.2)
+ sqlite3 (1.3.6)
thin (1.2.7)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
@@ -56,5 +55,6 @@ DEPENDENCIES
rack-test
rake
rcov
+ sqlite3 (~> 1.2)
taps!
thin (> 1.2.0)
View
1 lib/taps/cli.rb
@@ -7,6 +7,7 @@
Taps::Config.taps_database_url = ENV['TAPS_DATABASE_URL'] || begin
# this is dirty but it solves a weird problem where the tempfile disappears mid-process
+ require 'sqlite3'
$__taps_database = Tempfile.new('taps.db')
$__taps_database.open()
"sqlite://#{$__taps_database.path}"
View
1 lib/taps/config.rb
@@ -1,5 +1,4 @@
require 'sequel'
-require 'sqlite3'
require 'taps/version'
Sequel.datetime_class = DateTime
View
2 taps.gemspec
@@ -17,8 +17,8 @@ Gem::Specification.new do |gem|
gem.add_dependency "rest-client", ">= 1.4.0", "< 1.7.0"
gem.add_dependency "sequel", "~> 3.20.0"
gem.add_dependency "sinatra", "~> 1.0.0"
- gem.add_dependency "sqlite3-ruby", "~> 1.2"
+ gem.add_development_dependency "sqlite3", "~> 1.2"
gem.add_development_dependency "bacon"
gem.add_development_dependency "mocha"
gem.add_development_dependency "rack-test"

0 comments on commit 0b4b66b

Please sign in to comment.