Browse Source

Initial commit

- require libs
  - setup database
  - create Robot model
master
jimi 13 years ago
commit
b6b982a852
  1. 1
      .gitignore
  2. 12
      main.rb

1
.gitignore

@ -0,0 +1 @@
*.db

12
main.rb

@ -0,0 +1,12 @@
%w[sinatra dm-core dm-migrations slim sass].each{ |lib| require lib }
DataMapper.setup(:default, File.join("sqlite3://",settings.root,"development.db"))
class Robot
include DataMapper::Resource
property :id, Serial
property :top, Integer, default: proc { |m,p| 1+rand(6) }
property :mid, Integer, default: proc { |m,p| 1+rand(4) }
property :bot, Integer, default: proc { |m,p| 1+rand(5) }
end
DataMapper.finalize