-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alberto Perdomo
committed
Oct 9, 2010
0 parents
commit 3aab42d
Showing
6 changed files
with
246 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Usage | ||
===== | ||
`rails new app_name -m http://github.com/aentos/rails3-templates/main.rb` | ||
|
||
Gems | ||
==== | ||
|
||
General use | ||
----------- | ||
* [will_paginate](http://github.com/mislav/will_paginate) | ||
* [attrtastic](http://github.com/MBO/attrtastic) | ||
* [formtastic](http://github.com/justinfrench/formtastic) | ||
* [haml-rails](http://github.com/indirect/haml-rails) | ||
* [compass](http://github.com/chriseppstein/compass) | ||
* [inherited_resources] | ||
|
||
Development | ||
----------- | ||
|
||
Testing | ||
------- | ||
* [shoulda] | ||
* [factory_girl] | ||
* [cucumber] | ||
* [capybara] | ||
* [faker](http://faker.rubyforge.org/) | ||
|
||
Optional | ||
-------- | ||
* [hoptoad_notifier](http://github.com/thoughtbot/hoptoad_notifier) | ||
|
||
Plugins | ||
======= | ||
* [asset_packager](http://github.com/sbecker/asset_packager) | ||
|
||
Other tools | ||
=========== | ||
* [960 grid system](http://960.gs/) | ||
* [Hoptoad](http://hoptoadapp.com/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
!!! 5 | ||
%html | ||
%head | ||
= title_tag "optional default title here", :prefix => "optional prefix text", :suffix => "optional suffix text" | ||
= description_tag "optional default meta description here" | ||
= keywords_tag "optional default meta keywords here" | ||
= copyright_tag "optional default meta copyright notice here" | ||
= raw stylesheet_link_merged('screen', :media => 'screen, projection') | ||
= raw stylesheet_link_merged('print', :media => 'print') | ||
/[if lt IE 8] | ||
= raw stylesheet_link_merged('ie', :media => 'screen, projection') | ||
= csrf_meta_tag | ||
%body | ||
#container | ||
#header HEADER | ||
#sidebar SIDEBAR | ||
#content= yield | ||
#footer FOOTER | ||
%script{ :type => "text/javascript", :src => "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" } | ||
%script{ :type => "text/javascript", :src => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js" } | ||
= raw javascript_include_merged(:base) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
javascripts: | ||
- base: | ||
- rails | ||
stylesheets: | ||
- ie: | ||
- ie | ||
- screen: | ||
- screen | ||
- print: | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
task :clean do | ||
system "rm rerun.txt" | ||
end | ||
|
||
task :build => [:clean, 'db:migrate', :test, :cucumber, 'metrics:all', 'deploy'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.DS_Store | ||
.bundle | ||
config/database.yml | ||
db/*.sqlite3 | ||
db/schema.rb | ||
log/*.log | ||
tmp/**/* | ||
coverage | ||
public/cache | ||
public/system | ||
public/stylesheets | ||
public/javascripts/*_packaged.js | ||
doc/specs.html | ||
doc/features.html | ||
tags | ||
*.sw? | ||
*~ | ||
rerun.txt | ||
cache | ||
gems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
puts "Let me ask you a few questions before i start bootstrapping your app" | ||
hoptoad_key = ask("\r\n\r\nWant to use your Hoptoad Account?\n\r\n\rEnter your API Key, or press Enter to skip") | ||
locale_str = ask("Enter a list of locales you want to use separated by commas (e.g. 'es, de, fr'). For a reference list visit http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale/. Press enter to skip: ") | ||
|
||
puts "All set. Bootstrapping!!" | ||
|
||
# GO! | ||
run "rm -Rf .gitignore README public/index.html public/images/rails.png public/javascripts/* test app/views/layouts/*" | ||
|
||
file ("config/example_database.yml") do | ||
<<-FILE | ||
development: | ||
adapter: postgresql | ||
database: #{app_name}_development | ||
host: localhost | ||
username: #{app_name} | ||
password: #{app_name} | ||
timeout: 5000 | ||
staging: | ||
adapter: postgresql | ||
database: #{app_name}_staging | ||
host: localhost | ||
username: #{app_name} | ||
password: #{app_name} | ||
timeout: 5000 | ||
production: | ||
adapter: postgresql | ||
database: #{app_name}_production | ||
host: localhost | ||
username: #{app_name} | ||
password: #{app_name} | ||
timeout: 5000 | ||
# Warning: The database defined as 'test' will be erased and | ||
# re-generated from your development database when you run 'rake'. | ||
# Do not set this db to the same as development or production. | ||
test: &test | ||
adapter: postgresql | ||
database: #{app_name}_test | ||
host: localhost | ||
username: #{app_name} | ||
password: #{app_name} | ||
timeout: 5000 | ||
cucumber: | ||
<<: *test | ||
FILE | ||
end | ||
|
||
gem 'will_paginate', '>=3.0.pre2' | ||
|
||
gem "haml-rails", ">= 0.2" | ||
gem "compass", ">= 0.10.5" | ||
gem "compass-960-plugin" | ||
gem 'inherited_resources', '~> 1.1.2' | ||
gem "formtastic", '~> 1.1.0' | ||
gem "attrtastic" | ||
|
||
# other stuff | ||
gem 'friendly_id', '~>3.1' | ||
|
||
# development | ||
gem "rails-erd", :group => :development | ||
|
||
# testing | ||
gem "factory_girl_rails", :group => [:test, :cucumber] | ||
gem "shoulda", :group => :test | ||
gem "faker", :group => [:test, :cucumber] | ||
|
||
gem 'cucumber', ">=0.6.3", :group => :cucumber | ||
gem 'cucumber-rails', ">=0.3.2", :group => :cucumber | ||
gem 'capybara', ">=0.3.6", :group => :cucumber | ||
gem 'database_cleaner', ">=0.5.0", :group => :cucumber | ||
gem 'spork', ">=0.8.4", :group => :cucumber | ||
gem "pickle", ">=0.4.2", :group => :cucumber | ||
|
||
# staging & production stuff | ||
unless hoptoad_key.empty? | ||
gem "hoptoad_notifier", '~> 2.3.6' | ||
initializer 'hoptoad.rb', <<-FILE | ||
HoptoadNotifier.configure do |config| | ||
config.api_key = '#{hoptoad_key}' | ||
end | ||
FILE | ||
end | ||
|
||
run "bundle install" | ||
|
||
# asset packager FTW | ||
plugin 'asset_packager', :git => 'git://github.com/sbecker/asset_packager.git' | ||
|
||
# TODO: rspec?! | ||
application <<-GENERATORS | ||
config.generators do |g| | ||
g.template_engine :haml | ||
g.test_framework :shoulda | ||
g.fallbacks[:shoulda] = :test_unit | ||
g.integration_tool :cucumber | ||
g.fixture_replacement :factory_girl, :dir => "test/factories" | ||
end | ||
GENERATORS | ||
|
||
generate "cucumber:install --capybara --testunit --spork" | ||
generate "pickle --path --email" | ||
generate "friendly_id" | ||
generate "formtastic:install" | ||
run "gem install compass" | ||
run "compass init -r ninesixty --using 960 --app rails --css-dir public/stylesheets" | ||
|
||
run "rm public/stylesheets/*" | ||
|
||
unless locales.empty? | ||
locales = locale_str.split(",") | ||
locales.each do |loc| | ||
get("http://github.com/svenfuchs/rails-i18n/raw/master/rails/locale/#{loc.strip}.yml", file) | ||
end | ||
end | ||
|
||
# formtastic sass mixins | ||
get "http://github.com/activestylus/formtastic-sass/raw/master/_formtastic_base.sass", "app/stylesheets/_formtastic_base.sass" | ||
|
||
# jquery | ||
get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js" | ||
|
||
get "http://github.com/aentos/rails3_template/raw/master/gitignore" ,".gitignore" | ||
|
||
# TODO: default stylesheets: screen & print | ||
get "http://github.com/aentos/rails3_templates/raw/master/application.html.haml", "app/views/layouts/application.html.haml" | ||
get "http://github.com/aentos/rails3_templates/raw/master/build.rake", "lib/tasks/build.rake" | ||
get "http://github.com/aentos/rails3_templates/raw/master/asset_packages.yml", "config/asset_packages.yml" | ||
|
||
create_file 'config/deploy.rb', <<-DEPLOY | ||
application = '#{app_name}' | ||
repository = '' | ||
hosts = %w() | ||
DEPLOY | ||
|
||
append_file 'Rakefile', <<-METRIC_FU | ||
MetricFu::Configuration.run do |config| | ||
config.rcov[:rcov_opts] << "-Ispec" | ||
end rescue nil | ||
METRIC_FU | ||
|
||
git :init | ||
git :add => '.' | ||
git :commit => '-am "Initial commit"' | ||
|
||
puts "SUCCESS!" |