Permalink
Browse files

resolving .gitignore conflict

  • Loading branch information...
akitaonrails committed Apr 15, 2011
2 parents 8da3aa4 + 7d54ff3 commit 6dc753e96cd87b855b4d3ba8bf3737c5b0ae2479
View
@@ -0,0 +1,58 @@
Read the "Gemfile":blob/master/files/Gemfile to understand everything this template installs and pre-configures for you.
One of gems, "Johnson":http://rubygems.org/gems/johnson, still has some issues compiling under Ruby 1.9.2 so you will need to use Ruby 1.8.7 instead.
This template is heavily dependent on wget so, if you're using a Mac, you will need to install it first. The recommended way is to install "Homebrew":https://github.com/mxcl/homebrew first and then:
<pre><code>brew install wget</code></pre>
Since Github started forcing SSL in all its URLs, we need to download the template file separately:
<pre><code>wget --no-check-certificate https://github.com/akitaonrails/rails3_template/raw/master/main.rb -O /tmp/rails3_template.rb</pre></code>
Then whenever you want to create a new project, just do:
<pre><code>rails new app_name -JT -m /tmp/rails3_template.rb</code></pre>
Change <tt>app_name</tt> for your project name. You can configure what you need and run <tt>rake db:migrate</tt> to get started.
h2. CRITERIA
This is intended to be an opinionated template. The options chosen have these reasons:
* Standard ERB instead of HAML - even though HAML is great the pros and cons are too balanced to justify replacing ERB.
* Simple Form instead of Formtastic - to me, "feels" simpler
* SASS instead of pure CSS - this undeniably adds value on top of CSS making it easier to organize
* JQuery instead of Prototype - no need to say more
* Kaminari instead of Will Paginate - cleaner solution for pagination
* Pure Javascript instead of CoffeeScript - as HAML, the syntax gets more elegant, but there is no inherent advantages
* RSpec, Factory Girl Cucumber, Spork, Capybara, Celerity, Faker, Metric Fu - this is the universally accepted main test package, so be it
* Evergreen - testing Javascript is great and this seems to be the best so far
* Devise - the best authentication system so far
* Inherited Resources - lighter controllers
* Compass, Asset Packager, Lemonade - easier way to deal with images and other assets
* Cells - this is experimental but does bring advantages in making controller less cluttered and isolating components
So, opinionated to a point, trying to stick to the basics where advantages are not so obvious.
h2. TESTING
Read Peter Cooper's "excellent tutorial":http://www.rubyinside.com/how-to-rails-3-and-rspec-2-4336.html on how to setup a fast testing environment:
This template tries to do so. Before starting just run:
<pre><code>spork</code></pre>
And in another terminal run:
<pre><code>rake watchr</code></pre>
Also do not forget to modify <tt>config/environments/test.rb</tt> to reload classes:
<pre><code>config.cache_classes = false</code></pre>
h2. CREDITS
This Template is based on "Diego Carrion's template":https://github.com/dcrec1/rails3_template. The changes include removing HAML, Hoptoad, Coffeescript (Barista), Remarkable, adding yajl for json, thin, replacing will_paginate for kaminari, replacing autotest for watchr, enabling spork, replacing formtastic for simple_form, bundling gems within the app,
Author: Fabio Akita (@AkitaOnRails)
View
@@ -0,0 +1,57 @@
source 'http://rubygems.org'
gem 'rails', '3.0.6'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem "rails_admin", :git => 'https://github.com/sferik/rails_admin.git'
gem "inherited_resources"
gem "kaminari"
gem "devise"
gem "simple_form"
gem "friendly_id"
gem "compass"
gem "lemonade"
gem "cells"
gem 'yajl-ruby', :require => 'yajl/json_gem'
group :development do
gem "watchr"
gem "rails3-generators", :git => "https://github.com/indirect/rails3-generators.git"
gem "metric_fu"
end
group :development, :test do
gem "spork"
gem "thin"
gem "evergreen"
gem "factory_girl_rails"
gem "rspec-rails"
gem "rspec-cells"
gem "faker"
gem "evergreen", :require => "evergreen/rails"
platforms :mri_18 do
gem "ruby-debug"
end
platforms :mri_19 do
gem "ruby-debug19", :require => 'ruby-debug'
end
end
group :test do
gem "rspec"
gem "capybara-envjs"
end
group :cucumber do
gem "cucumber"
gem "cucumber-rails"
gem "capybara"
gem "database_cleaner"
gem "spork"
gem "pickle"
end
group :production do
gem "newrelic_rpm"
end
View
@@ -0,0 +1 @@
<!-- Add the rendered HTML from your application over which the javascript will act -->
View
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en" xml:lang="en">
<head>
<title>TITLE</title>
<%= raw stylesheet_link_merged('screen', :media => 'screen, projection') %>
<%= raw stylesheet_link_merged('simple_form', :media => 'screen, projection') %>
<%= raw stylesheet_link_merged('print', :media => 'print') %>
<!--[if lt IE 9]>
<%= javascript_include_tag 'html5' %>
<%= raw stylesheet_link_merged('ie', :media => 'screen, projection') %>
<![endif]-->
<%= csrf_meta_tag %>
</head>
<body>
<div id="container">
<header>HEADER</header>
<sidebar>SIDEBAR</sidebar>
<section id="content">
<% content_for :notice do %><p class="notice"><%= notice %></p><% end %>
<% content_for :alert do %><p class="alert"><%= alert %></p><% end %>
<%= yield %>
</section>
<footer>FOOTER</footer>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script>
<%= raw javascript_include_merged(:base) %>
</body>
</html>
View
@@ -0,0 +1,39 @@
// Example of how to add javascript specs
//
// require("/jquery.js");
// require("/jquery-ui.js");
// require("/application.js");
// $.ready();
//
// describe("with main template", function() {
// template('application.html');
//
// describe("on load", function() {
// beforeEach(function() {
// });
//
// it("should set select as text inputs", function() {
// expect($("#sign_in")).toBeATextInput();
// });
//
// it("should not set all select as text inputs", function() {
// expect($("#select")).not.toBeATextInput();
// });
//
// it("should hide the anchor", function() {
// $("#container a.next").show();
// $("#container a.next").click();
// expect($("#playboard a.next")).toBeHidden();
// });
//
// it("should show .matches nav a.prev", function() {
// $("#container a.prev").hide();
// $("#container a.next").click();
// expect($("#playboard a.prev")).toBeVisible();
// });
//
// it("should prevent the event default", function() {
// expect(eventForSelectorHandler("#container a.prev", "click")).toBeDefaultPrevented();
// });
// })
// })
View
@@ -0,0 +1,11 @@
---
javascripts:
- base:
- rails
stylesheets:
- ie:
- ie
- screen:
- screen
- print:
- print
View
@@ -0,0 +1,6 @@
namespace :db do
desc "Bootstraps the database with demo data"
task :bootstrap => %w(db:setup) do
end
end
View
@@ -0,0 +1,5 @@
task :clean do
system "rm rerun.txt"
end
task :build => [:clean, 'db:migrate', :spec, 'spec:javascripts', :cucumber, 'metrics:all']
View
@@ -0,0 +1,2 @@
bundle install --without=production
rake build
View
@@ -0,0 +1,22 @@
Given /^I am not authenticated$/ do
visit('/users/sign_out') # ensure that at least
end
Given /^I have one\s+user "([^\"]*)" with password "([^\"]*)" and login "([^\"]*)"$/ do |email, password, login|
User.new(:email => email,
:login => login,
:password => password,
:password_confirmation => password).save!
end
Given /^I am a new, authenticated user$/ do
email = 'testing@man.net'
login = 'Testing man'
password = 'secretpass'
Given %{I have one user "#{email}" with password "#{password}" and login "#{login}"}
And %{I go to login}
And %{I fill in "user_email" with "#{email}"}
And %{I fill in "user_password" with "#{password}"}
And %{I press "Sign in"}
end
View
@@ -0,0 +1,6 @@
require 'capybara/envjs'
Evergreen.configure do |config|
config.driver = :envjs
config.public_dir = '/public/javascripts'
end
View
@@ -0,0 +1,2 @@
require 'factory_girl'
Dir.glob("#{File.dirname(__FILE__)}/../../spec/support/factories/*").each { |file| require file }
View
@@ -0,0 +1,25 @@
.DS_Store
log/*
tmp/*
db/*.sqlite3
coverage
solr
public/cache
public/system
public/stylesheets
public/javascripts/*_packaged.js
doc/specs.html
doc/features.html
tags
*.sw?
*~
rerun.txt
.bundle
db/schema.rb
specifications
cache
gems
spec/requests
spec/routing
spec/views
capybara*
View
BIN +199 Bytes files/grid.png
Binary file not shown.
View
@@ -0,0 +1,19 @@
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{THE_REQUEST} ^(GET|HEAD)
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{DOCUMENT_ROOT}/cache/$1.html -f
RewriteRule ^(.*)$ /cache/$1.html
</ifModule>
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 year"
</ifModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/x-javascript
</IfModule>
FileETag None
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 6dc753e

Please sign in to comment.