Skip to content

Commit

Permalink
Load sqlite3 on-demand rather than making it a hard dependency.
Browse files Browse the repository at this point in the history
Fixes #84.
Fixes #95.
Fixes #96.
  • Loading branch information
technomancy committed Apr 27, 2012
1 parent 09e1bd3 commit 0b4b66b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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)
Expand All @@ -56,5 +55,6 @@ DEPENDENCIES
rack-test
rake
rcov
sqlite3 (~> 1.2)
taps!
thin (> 1.2.0)
1 change: 1 addition & 0 deletions lib/taps/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
1 change: 0 additions & 1 deletion lib/taps/config.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'sequel'
require 'sqlite3'
require 'taps/version'

Sequel.datetime_class = DateTime
Expand Down
2 changes: 1 addition & 1 deletion taps.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0b4b66b

Please sign in to comment.