commit b6b982a852c6a0939b0b095bccba5a1ba2808e76 Author: jimi Date: Mon Nov 14 09:53:33 2011 -0600 Initial commit - require libs - setup database - create Robot model diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..98e6ef6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.db diff --git a/main.rb b/main.rb new file mode 100644 index 0000000..6d1f400 --- /dev/null +++ b/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