Skip to content

Instantly share code, notes, and snippets.

@ivanxuu
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanxuu/9dc7caca634685ccc630 to your computer and use it in GitHub Desktop.
Save ivanxuu/9dc7caca634685ccc630 to your computer and use it in GitHub Desktop.
Torquebox

Cambia a jruby

$ rvm use jruby-9.0.0.0.pre1

Crea una nueva app

$ rails _4.1.9_ new <yourapp>

Use if you dont want minitest

$ rails new --skip-test-unit

Use if you dont want sqlite

$ rails new --database jdbcpostgresql

Crea .ruby-version y .ruby-gemset

$ rvm --create --ruby-version ruby-1.9.3@my-gemset  

Tambien puedes hacerlo asi:

$ mkdir <yourapp>
$ cd <yourapp>
$ rvm --create --ruby-version jruby-9.0.0.0.pre1@my-gemset
$ rails new .

Add to .gitignore

*.swp
app/assets/images/*sprites*.png

# dinamic genereted sitemap
public/sitemap.xml.gz

# paperclip
public/system/*

Install torquebox, compass, slim, pry, factoryGirl, capybara

#[Gemfile]
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.10'

#DB
# Use postgresql as the database for Active Record
gem 'pg', platform: :ruby
# Use jdbcpostgresql as the database for Active Record
gem 'activerecord-jdbcpostgresql-adapter', '~> 1.3.9', platform: :jruby
#gem 'activerecord-postgis-adapter'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby
gem 'therubyrhino', platform: :jruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc


# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

gem 'compass-rails'
gem 'slim-rails'

group :development do
  gem 'i18n-debug'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
end

group :development, :test do
  # DEBUG
  gem 'pry-rails'
  #gem 'pry-byebug', platform: :ruby
  gem 'pry-nav' #, platform: :jruby

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring', platform: :ruby

  gem 'factory_girl_rails'

  gem 'rspec-rails'
end

group :staging, :production do
  # TORQUEBOX
  gem 'torquebox', '4.0.0.alpha1', platform: :jruby
  # torquebox is a meta-gem that includes by default some other gems. If
  # you are only going to use a subset of it feel free to choose as 
  # you need:
  # gem 'torquebox-caching', '4.0.0.alpha1'
  # gem 'torquebox-messaging', '4.0.0.alpha1'
  # gem 'torquebox-scheduling', '4.0.0.alpha1'
  # gem 'torquebox-web', '4.0.0.alpha1'
end

RSPEC

rails generate rspec:install

SASS PREFERENCES

[config/application.rb] # Set prefered css syntax config.sass.preferred_syntax = :sass

CSS Best Practices Change your application.css to application.css.sass and then Osman Üngür compass and your own stylesheets to your hearts content.

$ git mv app/assets/stylesheets/application.css application.css.sass
$ mkdir app/assets/stylesheets/modules app/assets/stylesheets/base
$ touch app/assets/stylesheets/modules/_example.css.sass app/assets/stylesheets/base/_example.css.sass

E.g.: [application.css.sass]

@import "compass"

// Import reusable modules like stylesheets/modules/_header.css.sass
@import 'modules/*'
// Import reusable modules like stylesheets/base/_buttons.css.sass
@import "base/*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment