Permalink
Browse files

Updated readme. Smaller screenshot.

  • Loading branch information...
tomas committed Jul 28, 2011
1 parent 204ac3f commit 1fc578d4c8dff5a7c23deb48dca871f9bec3da39
Showing with 27 additions and 47 deletions.
  1. +19 −13 README.md
  2. BIN screenshot.png
  3. +4 −1 test/config.ru
  4. +4 −19 test/datamapper.rb
  5. +0 −14 test/mongomapper.rb
View
@@ -1,12 +1,12 @@
-### Bowtie: Zeroconf admin scaffold for your MongoMapper & DataMapper models
+## Bowtie: Zeroconf admin scaffold for your MongoMapper & DataMapper models
Bowtie reads the information on your models and creates a nice panel in which you can view, edit and destroy records easily.
-### How does it look?
+## How does it look?
![Bowtie!](https://github.com/tomas/bowtie/raw/master/screenshot.png)
-### Installation
+## Installation
Include it in your Gemfile and update your bundle:
@@ -18,11 +18,11 @@ Or install it by hand:
$ gem install bowtie
-### Configuration
+## Configuration
Mount Bowtie wherever you want by editing your config.ru file, after loading your models. You can optionally include the admin/pass combination for the panel.
- require 'my_models'
+ require 'my_app' # models are loaded
require 'bowtie'
BOWTIE_AUTH = {:user => 'admin', :pass => '12345' }
@@ -41,22 +41,28 @@ Mount Bowtie wherever you want by editing your config.ru file, after loading you
Now you can go to /admin in your app's path and try out Bowtie using your user/pass combination. If not set, it defaults to admin/bowtie.
-### Important notes
+## Important notes
-Bowtie requires a few gems but they're not included in the gemspec to prevent forcing your from installing unneeded gems. Therefore you need to make sue that Bowtie will have the following gems to work with:
+Bowtie requires a few gems but they're not included in the gemspec to prevent forcing your from installing unneeded gems. Therefore you need to make sure that Bowtie will have the following gems to work with:
-For DataMapper models: dm-core, dm-types, dm-validations, dm-pager
+For DataMapper models:
-For MongoMapper models: mongo_mapper
+ * dm-core
+ * dm-validations
+ * dm-aggregates
+ * dm-pager
+
+For MongoMapper models:
+
+ * mongo_mapper
From version 0.3, Bowtie is meant to be used from DataMapper 1.0.0 on. For previous versions please install with -v=0.2.5.
-### TODO
+## TODO
* Better handling of types (Text, JSON, IPAddress) in #show
* Better handling of relationships in #show
-### Copyright
+## Copyright
-(c) 2010-2011 - Tomás Pollak for Fork Ltd.
-Released under the MIT license.
+(c) 2010-2011 - Tomás Pollak for Fork Ltd. Released under the MIT license.
View
Binary file not shown.
View
@@ -1,10 +1,13 @@
current_path = File.expand_path(File.dirname(__FILE__))
-adapter = ARGV[1] || 'datamapper'
+adapter = ARGV[1] || 'mongomapper'
require current_path + "/#{adapter}"
+require current_path + '/demo_data'
require current_path + '/../lib/bowtie'
+add_demo_data!
+
app = Rack::Builder.new {
# BOWTIE_AUTH = {:user => 'admin', :pass => 'secret'}
View
@@ -4,7 +4,7 @@
require 'dm-migrations'
sqlite_db = "sqlite3://#{File.expand_path(File.dirname(__FILE__))}/db.sqlite3"
-DataMapper.setup(:default, sqlite_db) # for testing purposes, no need for additional gems
+DataMapper.setup(:default, sqlite_db)
# DataMapper.setup(:default, "in_memory::") # for testing purposes, no need for additional gems
class City
@@ -14,8 +14,7 @@ class City
has 1, :major
property :id, Serial
- property :name, String
-
+ property :name, String, :required => true
end
class Major
@@ -25,7 +24,6 @@ class Major
property :id, Serial
property :name, String
-
end
class Place
@@ -41,24 +39,11 @@ class Place
end
class Restaurant < Place
- # property :food_type, String, :required => true
-end
-class Cinema < Place
- # property :number_of_movies, Integer
end
-DataMapper.auto_migrate!
+class Cinema < Place
-def add_places!(city)
- # Place.delete_all
- city.places << Cinema.create(:name => "Busterblock", :address => "234 Mission St")
- city.places << Restaurant.create(:name => "Freddo's", :address => "123 Park Lane")
end
-city = City.create(:name => "SF222O2222")
-major = Major.create(:name => "John Lennon X")
-city.major = major
-major.save
-
-add_places!(city)
+DataMapper.auto_migrate!
View
@@ -11,7 +11,6 @@ class City
one :major
key :name, String, :required => true
-
end
class Major
@@ -41,16 +40,3 @@ class Cinema < Place
# property :number_of_movies, Integer
end
-def add_places!(city)
- # Place.delete_all
- city.places << Cinema.create(:name => "Busterblock", :address => "234 Mission St")
- city.places << Restaurant.create(:name => "Freddo's", :address => "123 Park Lane")
- city.save
-end
-
-city = City.create(:name => "SF222O2222")
-major = Major.create(:name => "John Lennon X")
-city.major = major
-major.save
-
-add_places!(city)

0 comments on commit 1fc578d

Please sign in to comment.