Permalink
Browse files

added a simple thor script to generate a test app with a resource

  • Loading branch information...
1 parent ab051dc commit 887e5d73294b1e34348f71a405124b3d026a1118 @mattetti committed Oct 18, 2008
Showing with 19 additions and 0 deletions.
  1. +19 −0 thor-stuff/test-app.thor
View
@@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+
+class TestApp < Thor
+
+ desc "generate APP_NAME", "generate a test apps"
+ def generate(name)
+ Dir["#{name}"].each { |old| FileUtils.rm_rf old }
+ puts "generating a test app called: #{name}"
+ `merb-gen app #{name}`
+ Dir.chdir(Dir.pwd + "/" + name) do
+ `merb-gen resource article title:String,author:String,created_at:DateTime`
+ `rake db:automigrate`
+ end
+
+ puts "run `cd #{name} && merb`"
+ puts "then `http://localhost:4000/articles`"
+ end
+
+end

0 comments on commit 887e5d7

Please sign in to comment.