Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Commit

Permalink
Add and configure DataMapper for models.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbck committed Feb 11, 2012
1 parent ca0f710 commit 63472c4
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
.bundle .bundle
db/*.db
5 changes: 4 additions & 1 deletion Gemfile
@@ -1,9 +1,12 @@
source :rubygems source :rubygems


gem "sinatra" gem "sinatra"
gem "datamapper", require: "data_mapper"
gem "dm-postgres-adapter"


group :development, :test do group :development, :test do
gem "heroku" gem "heroku"
gem "rspec" gem "rspec"
gem "rack-test" gem "rack-test", require: "rack/test"
gem "dm-sqlite-adapter"
end end
63 changes: 63 additions & 0 deletions Gemfile.lock
Expand Up @@ -2,15 +2,73 @@ GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
addressable (2.2.6) addressable (2.2.6)
bcrypt-ruby (3.0.1)
data_objects (0.10.8)
addressable (~> 2.1)
datamapper (1.2.0)
dm-aggregates (~> 1.2.0)
dm-constraints (~> 1.2.0)
dm-core (~> 1.2.0)
dm-migrations (~> 1.2.0)
dm-serializer (~> 1.2.0)
dm-timestamps (~> 1.2.0)
dm-transactions (~> 1.2.0)
dm-types (~> 1.2.0)
dm-validations (~> 1.2.0)
diff-lcs (1.1.3) diff-lcs (1.1.3)
dm-aggregates (1.2.0)
dm-core (~> 1.2.0)
dm-constraints (1.2.0)
dm-core (~> 1.2.0)
dm-core (1.2.0)
addressable (~> 2.2.6)
dm-do-adapter (1.2.0)
data_objects (~> 0.10.6)
dm-core (~> 1.2.0)
dm-migrations (1.2.0)
dm-core (~> 1.2.0)
dm-postgres-adapter (1.2.0)
dm-do-adapter (~> 1.2.0)
do_postgres (~> 0.10.6)
dm-serializer (1.2.1)
dm-core (~> 1.2.0)
fastercsv (~> 1.5.4)
json (~> 1.6.1)
json_pure (~> 1.6.1)
multi_json (~> 1.0.3)
dm-sqlite-adapter (1.2.0)
dm-do-adapter (~> 1.2.0)
do_sqlite3 (~> 0.10.6)
dm-timestamps (1.2.0)
dm-core (~> 1.2.0)
dm-transactions (1.2.0)
dm-core (~> 1.2.0)
dm-types (1.2.1)
bcrypt-ruby (~> 3.0.0)
dm-core (~> 1.2.0)
fastercsv (~> 1.5.4)
json (~> 1.6.1)
multi_json (~> 1.0.3)
stringex (~> 1.3.0)
uuidtools (~> 2.1.2)
dm-validations (1.2.0)
dm-core (~> 1.2.0)
do_postgres (0.10.8)
data_objects (= 0.10.8)
do_sqlite3 (0.10.8)
data_objects (= 0.10.8)
fastercsv (1.5.4)
heroku (2.19.2) heroku (2.19.2)
launchy (>= 0.3.2) launchy (>= 0.3.2)
rest-client (~> 1.6.1) rest-client (~> 1.6.1)
rubyzip rubyzip
term-ansicolor (~> 1.0.5) term-ansicolor (~> 1.0.5)
json (1.6.5)
json_pure (1.6.5)
launchy (2.0.5) launchy (2.0.5)
addressable (~> 2.2.6) addressable (~> 2.2.6)
mime-types (1.17.2) mime-types (1.17.2)
multi_json (1.0.4)
rack (1.4.1) rack (1.4.1)
rack-protection (1.2.0) rack-protection (1.2.0)
rack rack
Expand All @@ -31,13 +89,18 @@ GEM
rack (~> 1.3, >= 1.3.6) rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2) rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3) tilt (~> 1.3, >= 1.3.3)
stringex (1.3.0)
term-ansicolor (1.0.7) term-ansicolor (1.0.7)
tilt (1.3.3) tilt (1.3.3)
uuidtools (2.1.2)


PLATFORMS PLATFORMS
ruby ruby


DEPENDENCIES DEPENDENCIES
datamapper
dm-postgres-adapter
dm-sqlite-adapter
heroku heroku
rack-test rack-test
rspec rspec
Expand Down
2 changes: 2 additions & 0 deletions config.ru
Expand Up @@ -5,4 +5,6 @@ Bundler.require


require './auction_notifier' require './auction_notifier'


DataMapper.setup(:default, ENV['HEROKU_SHARED_POSTGRESQL_PINK_URL'] || "sqlite3://#{Dir.pwd}/db/development.db")

run Sinatra::Application run Sinatra::Application
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
@@ -1,5 +1,6 @@
require 'sinatra' require 'sinatra'
require 'rack/test' require 'rack/test'
require 'data_mapper'


require File.join(File.dirname(__FILE__), '..', 'auction_notifier.rb') require File.join(File.dirname(__FILE__), '..', 'auction_notifier.rb')


Expand All @@ -9,10 +10,14 @@
set :raise_errors, true set :raise_errors, true
set :logging, false set :logging, false


DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/db/test.db")

def app def app
Sinatra::Application Sinatra::Application
end end


RSpec.configure do |config| RSpec.configure do |config|
config.include Rack::Test::Methods config.include Rack::Test::Methods

config.before(:each) { DataMapper.auto_migrate! }
end end

0 comments on commit 63472c4

Please sign in to comment.