Skip to content

Instantly share code, notes, and snippets.

@jejacks0n
Last active December 18, 2015 12:29
Show Gist options
  • Save jejacks0n/5783385 to your computer and use it in GitHub Desktop.
Save jejacks0n/5783385 to your computer and use it in GitHub Desktop.
Tiny Rails + Teaspoon setup (uses mocha by default). A good place to start with a small coffeescript project.
require 'rubygems'
require 'bundler/setup'
require 'action_controller/railtie'
require 'sprockets/railtie'
Bundler.require
module App
class Application < Rails::Application
config.session_store :cookie_store, :key => '_app_session'
config.secret_token = '30dd9731a121fb4a3425fb528ffed853'
config.active_support.deprecation = :log
config.consider_all_requests_local = true
config.encoding = 'utf-8'
config.assets.enabled = true
config.assets.version = '1.0'
config.assets.debug = true
config.assets.paths = []
config.assets.paths << 'lib/dependencies'
config.assets.paths << 'lib/javascripts'
config.assets.paths << 'lib/stylesheets'
end
Teaspoon.configure do |config|
config.asset_paths = ['spec']
config.fixture_path = 'spec/fixtures'
config.suite do |suite|
suite.matcher = 'spec/**/*_spec.{js,js.coffee,coffee}'
suite.helper = 'spec_helper'
suite.javascripts = ['teaspoon-mocha', 'support/chai', 'support/sinon', 'support/sinon-chai']
end
end
end
class ApplicationController < ActionController::Base
prepend_view_path Rails.application.root
prepend_view_path Rails.application.root.join('/dependencies/three/examples')
def page
render template: params[:page] || 'index'
end
end
Rails.application.initialize!
Rails.application.routes.draw do
# rendering pages
match '/(:page)' => 'application#page', via: :get
end
run App::Application rescue nil
source 'https://rubygems.org'
gem 'rails'
gem 'haml-rails'
gem 'coffee-rails'
gem 'sass-rails'
# Build process dependencies
gem 'uglifier' # javascript compression
gem 'yui-compressor' # css compression
# Test dependencies
gem 'teaspoon'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment