Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved basic setup to its on module

  • Loading branch information...
commit f9259b83bac1173eece849227d00c8d467f2a19f 1 parent 0f41ea3
László Bácsi authored
Showing with 50 additions and 50 deletions.
  1. +1 −50 app_lego.rb
  2. +49 −0 basic.rb
51 app_lego.rb
View
@@ -29,6 +29,7 @@ def plugin(name, options)
end
modules = [
+ ["basic", "Do basic setup? (only exclude this if you already have a Rails app skeleton with Rails 2.3+ frozen, or as a gem)"],
["rspec", "Use RSpec instead of test/unit?"],
["haml", "Use haml for views and sass for css?"],
["jquery", "Use jQuery instead of Prototype + Script.aculo.us?"],
@@ -37,56 +38,6 @@ def plugin(name, options)
["misc", "Add miscellaneous stuff (helpers, basic layout, flashes, initializers)?"],
]
-# remove tmp dirs
-run "rmdir tmp/{pids,sessions,sockets,cache}"
-
-# remove unnecessary stuff
-run "rm README log/*.log public/index.html public/images/rails.png"
-
-# keep empty dirs
-run("find . \\( -type d -empty \\) -and \\( -not -regex ./\\.git.* \\) -exec touch {}/.gitignore \\;")
-
-# init git repo
-git :init
-
-# basic .gitignore file
-file '.gitignore',
-%q{log/*.log
-log/*.pid
-db/*.db
-db/*.sqlite3
-db/schema.rb
-tmp/**/*
-.DS_Store
-doc/api
-doc/app
-config/database.yml
-autotest_result.html
-coverage
-public/javascripts/*_[0-9]*.js
-public/stylesheets/*_[0-9]*.css
-public/attachments
-}
-
-# copy sample database config
-run "cp config/database.yml config/database.yml.sample"
-
-# commit changes
-git :add => "."
-git :commit => "-a -m 'Setting up a new rails app. Copy config/database.yml.sample to config/database.yml and customize.'"
-
-# freeze edge rails
-if respond_to?(:braid)
- braid "git://github.com/rails/rails.git", "vendor/rails"
-else
- # Guess full Rails path
- rails_path = Pathname.new($LOAD_PATH.find {|p| p =~ /railties/}.gsub(%r{/railties/.*}, '')).realpath
- run "cp -r '#{rails_path}' vendor/rails"
- run "rm -rf vendor/rails/.git"
-end
-
-log "initialized", "application structure"
-
if @lego_options or yes?("Do you want to play LEGO?")
all_yes = @lego_options ? false : yes?("Install everything without question?")
49 basic.rb
View
@@ -0,0 +1,49 @@
+# remove tmp dirs
+run "rmdir tmp/{pids,sessions,sockets,cache}"
+
+# remove unnecessary stuff
+run "rm README log/*.log public/index.html public/images/rails.png"
+
+# keep empty dirs
+run("find . \\( -type d -empty \\) -and \\( -not -regex ./\\.git.* \\) -exec touch {}/.gitignore \\;")
+
+# init git repo
+git :init
+
+# basic .gitignore file
+file '.gitignore',
+%q{log/*.log
+log/*.pid
+db/*.db
+db/*.sqlite3
+db/schema.rb
+tmp/**/*
+.DS_Store
+doc/api
+doc/app
+config/database.yml
+autotest_result.html
+coverage
+public/javascripts/*_[0-9]*.js
+public/stylesheets/*_[0-9]*.css
+public/attachments
+}
+
+# copy sample database config
+run "cp config/database.yml config/database.yml.sample"
+
+# commit changes
+git :add => "."
+git :commit => "-a -m 'Setting up a new rails app. Copy config/database.yml.sample to config/database.yml and customize.'"
+
+# freeze edge rails
+if respond_to?(:braid)
+ braid "git://github.com/rails/rails.git", "vendor/rails"
+else
+ # Guess full Rails path
+ rails_path = Pathname.new($LOAD_PATH.find {|p| p =~ /railties/}.gsub(%r{/railties/.*}, '')).realpath
+ run "cp -r '#{rails_path}' vendor/rails"
+ run "rm -rf vendor/rails/.git"
+end
+
+log "initialized", "application structure"
Please sign in to comment.
Something went wrong with that request. Please try again.