Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial Commit. v1.0

  • Loading branch information...
commit e8af9b9847dd977cd2b90cadffec1b4ad3a1ef42 0 parents
@markbates authored
Showing with 767 additions and 0 deletions.
  1. +16 −0 .gitignore
  2. +1 −0  .rvmrc
  3. +9 −0 Gemfile
  4. +134 −0 Gemfile.lock
  5. +21 −0 LICENSE
  6. +3 −0  README.textile
  7. +30 −0 Rakefile
  8. +33 −0 coffeebeans.gemspec
  9. +32 −0 lib/coffeebeans.rb
  10. +4 −0 spec/dummy/.gitignore
  11. +32 −0 spec/dummy/Gemfile
  12. +86 −0 spec/dummy/Gemfile.lock
  13. +3 −0  spec/dummy/app/controllers/application_controller.rb
  14. +8 −0 spec/dummy/app/controllers/drinks_controller.rb
  15. +2 −0  spec/dummy/app/helpers/application_helper.rb
  16. +9 −0 spec/dummy/app/views/drinks/index.html.erb
  17. +1 −0  spec/dummy/app/views/drinks/index.js.coffee
  18. +1 −0  spec/dummy/app/views/layouts/application.html.erb
  19. +4 −0 spec/dummy/config.ru
  20. +47 −0 spec/dummy/config/application.rb
  21. +6 −0 spec/dummy/config/boot.rb
  22. +5 −0 spec/dummy/config/environment.rb
  23. +26 −0 spec/dummy/config/environments/development.rb
  24. +49 −0 spec/dummy/config/environments/production.rb
  25. +35 −0 spec/dummy/config/environments/test.rb
  26. +7 −0 spec/dummy/config/initializers/backtrace_silencers.rb
  27. +10 −0 spec/dummy/config/initializers/inflections.rb
  28. +5 −0 spec/dummy/config/initializers/mime_types.rb
  29. +7 −0 spec/dummy/config/initializers/secret_token.rb
  30. +8 −0 spec/dummy/config/initializers/session_store.rb
  31. +5 −0 spec/dummy/config/locales/en.yml
  32. +59 −0 spec/dummy/config/routes.rb
  33. +7 −0 spec/dummy/db/seeds.rb
  34. 0  spec/dummy/lib/tasks/.gitkeep
  35. +6 −0 spec/dummy/script/rails
  36. 0  spec/dummy/vendor/plugins/.gitkeep
  37. +18 −0 spec/request/coffee_script_spec.rb
  38. +38 −0 spec/spec_helper.rb
16 .gitignore
@@ -0,0 +1,16 @@
+*.log
+.DS_Store
+doc
+tmp
+pkg
+*.gem
+*.pid
+coverage
+coverage.data
+build/*
+*.pbxuser
+*.mode1v3
+.svn
+profile
+.console_history
+.sass-cache/*
1  .rvmrc
@@ -0,0 +1 @@
+rvm use ruby-1.9.2@coffeescript_rails
9 Gemfile
@@ -0,0 +1,9 @@
+source 'http://rubygems.org'
+
+gem 'rake'
+gem 'rails'
+gem "rspec-rails", "2.6.0"
+gem 'gemstub', ">= 2.0.0"
+gem 'coffee-script'
+gem 'sqlite3'
+gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
134 Gemfile.lock
@@ -0,0 +1,134 @@
+GIT
+ remote: git://github.com/jnicklas/capybara.git
+ revision: 4c3ce57430a1b07e534450dca8a2e551b5363539
+ specs:
+ capybara (1.0.0.beta1)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 0.2.0)
+ xpath (~> 0.1.4)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ abstract (1.0.0)
+ actionmailer (3.0.7)
+ actionpack (= 3.0.7)
+ mail (~> 2.2.15)
+ actionpack (3.0.7)
+ activemodel (= 3.0.7)
+ activesupport (= 3.0.7)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.5.0)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.14)
+ rack-test (~> 0.5.7)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.7)
+ activesupport (= 3.0.7)
+ builder (~> 2.1.2)
+ i18n (~> 0.5.0)
+ activerecord (3.0.7)
+ activemodel (= 3.0.7)
+ activesupport (= 3.0.7)
+ arel (~> 2.0.2)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.7)
+ activemodel (= 3.0.7)
+ activesupport (= 3.0.7)
+ activesupport (3.0.7)
+ arel (2.0.10)
+ builder (2.1.2)
+ childprocess (0.1.9)
+ ffi (~> 1.0.6)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.1.0)
+ diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ execjs (1.0.0)
+ multi_json (~> 1.0)
+ ffi (1.0.8)
+ gemstub (2.0.3)
+ activesupport (>= 3.0.0)
+ genosaurus
+ mark_facets
+ rspec (>= 2.0.0)
+ genosaurus (1.2.4)
+ erubis
+ hashie (1.0.0)
+ i18n (0.5.0)
+ json_pure (1.5.1)
+ mail (2.2.19)
+ activesupport (>= 2.3.6)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mark_facets (0.2.0)
+ hashie
+ mime-types (1.16)
+ multi_json (1.0.2)
+ nokogiri (1.4.4)
+ polyglot (0.3.1)
+ rack (1.2.2)
+ rack-mount (0.6.14)
+ rack (>= 1.0.0)
+ rack-test (0.5.7)
+ rack (>= 1.0)
+ rails (3.0.7)
+ actionmailer (= 3.0.7)
+ actionpack (= 3.0.7)
+ activerecord (= 3.0.7)
+ activeresource (= 3.0.7)
+ activesupport (= 3.0.7)
+ bundler (~> 1.0)
+ railties (= 3.0.7)
+ railties (3.0.7)
+ actionpack (= 3.0.7)
+ activesupport (= 3.0.7)
+ rake (>= 0.8.7)
+ thor (~> 0.14.4)
+ rake (0.8.7)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.0)
+ rspec-expectations (2.6.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.6.0)
+ rspec-rails (2.6.0)
+ actionpack (~> 3.0)
+ activesupport (~> 3.0)
+ railties (~> 3.0)
+ rspec (~> 2.6.0)
+ rubyzip (0.9.4)
+ selenium-webdriver (0.2.0)
+ childprocess (>= 0.1.7)
+ ffi (>= 1.0.7)
+ json_pure
+ rubyzip
+ sqlite3 (1.3.3)
+ thor (0.14.6)
+ treetop (1.4.9)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.27)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ capybara!
+ coffee-script
+ gemstub (>= 2.0.0)
+ rails
+ rake
+ rspec-rails (= 2.6.0)
+ sqlite3
21 LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2011 markbates
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
3  README.textile
@@ -0,0 +1,3 @@
+README
+========================================================================
+coffeescript_rails was developed by: markbates
30 Rakefile
@@ -0,0 +1,30 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+gemfile = File.expand_path('../Gemfile', __FILE__)
+begin
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+rescue Bundler::GemNotFound => e
+ STDERR.puts e.message
+ STDERR.puts "Try running `bundle install`."
+ exit!
+end if File.exist?(gemfile)
+
+Bundler.require
+
+Gemstub.test_framework = :rspec
+
+Gemstub.gem_spec do |s|
+ s.version = '1.0.0'
+ # s.rubyforge_project = 'coffeescript_rails'
+ s.add_dependency('coffee-script')
+ s.add_dependency('actionpack', '>= 3.0.0')
+ s.email = 'mark+github@markbates.com'
+ # s.homepage = ''
+end
+
+Gemstub.rdoc do |rd|
+ rd.title = 'coffeebeans'
+end
33 coffeebeans.gemspec
@@ -0,0 +1,33 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{coffeebeans}
+ s.version = "1.0.0.20110519132850"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = [%q{markbates}]
+ s.date = %q{2011-05-19}
+ s.description = %q{coffeebeans was developed by: markbates}
+ s.email = %q{mark+github@markbates.com}
+ s.extra_rdoc_files = [%q{LICENSE}]
+ s.files = [%q{lib/coffeebeans.rb}, %q{LICENSE}]
+ s.homepage = %q{}
+ s.require_paths = [%q{lib}]
+ s.rubygems_version = %q{1.8.2}
+ s.summary = %q{coffeebeans}
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<coffee-script>, [">= 0"])
+ s.add_runtime_dependency(%q<actionpack>, [">= 3.0.0"])
+ else
+ s.add_dependency(%q<coffee-script>, [">= 0"])
+ s.add_dependency(%q<actionpack>, [">= 3.0.0"])
+ end
+ else
+ s.add_dependency(%q<coffee-script>, [">= 0"])
+ s.add_dependency(%q<actionpack>, [">= 3.0.0"])
+ end
+end
32 lib/coffeebeans.rb
@@ -0,0 +1,32 @@
+require 'coffee-script'
+
+module CoffeeBeans
+ module Handlers
+ module CoffeeScript
+ def self.erb_handler
+ @@erb_handler ||= ActionView::Template.registered_template_handler(:erb)
+ end
+
+ def self.call(template)
+ compiled_source = erb_handler.call(template)
+ "::CoffeeScript.compile(begin;#{compiled_source};end)"
+ end
+ end
+ end
+
+ module ViewHelpers
+
+ def coffee_script_tag(&block)
+ content_tag(:script, coffee_script(&block), :type => 'text/javascript')
+ end
+
+ def coffee_script(&block)
+ ::CoffeeScript.compile(capture(&block))
+ end
+
+ end
+
+end
+
+ActionView::Template.register_template_handler :coffee, CoffeeBeans::Handlers::CoffeeScript
+ActionView::Base.send :include, CoffeeBeans::ViewHelpers
4 spec/dummy/.gitignore
@@ -0,0 +1,4 @@
+.bundle
+db/*.sqlite3
+log/*.log
+tmp/
32 spec/dummy/Gemfile
@@ -0,0 +1,32 @@
+source 'http://rubygems.org'
+
+gem 'rails', '3.0.7'
+
+gem 'coffeescript_rails', :path => '~/gemdev/coffeescript_rails'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+
+# Use unicorn as the web server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
+# gem 'ruby-debug'
+# gem 'ruby-debug19', :require => 'ruby-debug'
+
+# Bundle the extra gems:
+# gem 'bj'
+# gem 'nokogiri'
+# gem 'sqlite3-ruby', :require => 'sqlite3'
+# gem 'aws-s3', :require => 'aws/s3'
+
+# Bundle gems for the local environment. Make sure to
+# put test-only gems in this group so their generators
+# and rake tasks are available in development mode:
+# group :development, :test do
+# gem 'webrat'
+# end
86 spec/dummy/Gemfile.lock
@@ -0,0 +1,86 @@
+PATH
+ remote: ~/gemdev/coffeescript_rails
+ specs:
+ coffeescript_rails (0.0.1.20110519120600)
+ actionpack (>= 3.0.0)
+ coffee-script
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ abstract (1.0.0)
+ actionmailer (3.0.7)
+ actionpack (= 3.0.7)
+ mail (~> 2.2.15)
+ actionpack (3.0.7)
+ activemodel (= 3.0.7)
+ activesupport (= 3.0.7)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.5.0)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.14)
+ rack-test (~> 0.5.7)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.7)
+ activesupport (= 3.0.7)
+ builder (~> 2.1.2)
+ i18n (~> 0.5.0)
+ activerecord (3.0.7)
+ activemodel (= 3.0.7)
+ activesupport (= 3.0.7)
+ arel (~> 2.0.2)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.7)
+ activemodel (= 3.0.7)
+ activesupport (= 3.0.7)
+ activesupport (3.0.7)
+ arel (2.0.10)
+ builder (2.1.2)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.1.0)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ execjs (1.0.0)
+ multi_json (~> 1.0)
+ i18n (0.5.0)
+ mail (2.2.19)
+ activesupport (>= 2.3.6)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ multi_json (1.0.2)
+ polyglot (0.3.1)
+ rack (1.2.2)
+ rack-mount (0.6.14)
+ rack (>= 1.0.0)
+ rack-test (0.5.7)
+ rack (>= 1.0)
+ rails (3.0.7)
+ actionmailer (= 3.0.7)
+ actionpack (= 3.0.7)
+ activerecord (= 3.0.7)
+ activeresource (= 3.0.7)
+ activesupport (= 3.0.7)
+ bundler (~> 1.0)
+ railties (= 3.0.7)
+ railties (3.0.7)
+ actionpack (= 3.0.7)
+ activesupport (= 3.0.7)
+ rake (>= 0.8.7)
+ thor (~> 0.14.4)
+ rake (0.8.7)
+ thor (0.14.6)
+ treetop (1.4.9)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.27)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ coffeescript_rails!
+ rails (= 3.0.7)
3  spec/dummy/app/controllers/application_controller.rb
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
8 spec/dummy/app/controllers/drinks_controller.rb
@@ -0,0 +1,8 @@
+class DrinksController < ApplicationController
+ respond_to :js, :html
+
+ def index
+ render(:action => 'index', :layout => false)
+ end
+
+end
2  spec/dummy/app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
9 spec/dummy/app/views/drinks/index.html.erb
@@ -0,0 +1,9 @@
+<%= coffee_script_tag do %>
+ alert 'coffee script is awesome!'
+<% end %>
+
+<script>
+ <%= coffee_script do %>
+ alert 'coffee script is really awesome!'
+ <% end %>
+</script>
1  spec/dummy/app/views/drinks/index.js.coffee
@@ -0,0 +1 @@
+alert 'i like coffee!'
1  spec/dummy/app/views/layouts/application.html.erb
@@ -0,0 +1 @@
+<%= yield %>
4 spec/dummy/config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Dummy::Application
47 spec/dummy/config/application.rb
@@ -0,0 +1,47 @@
+require File.expand_path('../boot', __FILE__)
+
+# Pick the frameworks you want:
+# require "active_record/railtie"
+require "action_controller/railtie"
+require "action_mailer/railtie"
+require "active_resource/railtie"
+require "rails/test_unit/railtie"
+
+# If you have a Gemfile, require the gems listed there, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+module Dummy
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ # config.autoload_paths += %W(#{config.root}/extras)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # JavaScript files you want as :defaults (application.js is always included).
+ config.action_view.javascript_expansions[:defaults] = %w()
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+ end
+end
6 spec/dummy/config/boot.rb
@@ -0,0 +1,6 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5 spec/dummy/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+Dummy::Application.initialize!
26 spec/dummy/config/environments/development.rb
@@ -0,0 +1,26 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the webserver when you make code changes.
+ config.cache_classes = false
+
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_view.debug_rjs = true
+ config.action_controller.perform_caching = false
+
+ # Don't care if the mailer can't send
+ config.action_mailer.raise_delivery_errors = false
+
+ # Print deprecation notices to the Rails logger
+ config.active_support.deprecation = :log
+
+ # Only use best-standards-support built into browsers
+ config.action_dispatch.best_standards_support = :builtin
+end
+
49 spec/dummy/config/environments/production.rb
@@ -0,0 +1,49 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # The production environment is meant for finished, "live" apps.
+ # Code is not reloaded between requests
+ config.cache_classes = true
+
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Specifies the header that your server uses for sending files
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
+
+ # For nginx:
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
+
+ # If you have no front-end server that supports something like X-Sendfile,
+ # just comment this out and Rails will serve the files
+
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
+
+ # Use a different logger for distributed setups
+ # config.logger = SyslogLogger.new
+
+ # Use a different cache store in production
+ # config.cache_store = :mem_cache_store
+
+ # Disable Rails's static asset server
+ # In production, Apache or nginx will already do this
+ config.serve_static_assets = false
+
+ # Enable serving of images, stylesheets, and javascripts from an asset server
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Disable delivery errors, bad email addresses will be ignored
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners
+ config.active_support.deprecation = :notify
+end
35 spec/dummy/config/environments/test.rb
@@ -0,0 +1,35 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Print deprecation notices to the stderr
+ config.active_support.deprecation = :stderr
+end
7 spec/dummy/config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
10 spec/dummy/config/initializers/inflections.rb
@@ -0,0 +1,10 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format
+# (all these examples are active by default):
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
5 spec/dummy/config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
7 spec/dummy/config/initializers/secret_token.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+Dummy::Application.config.secret_token = '0d98c544fe5edc4a3e519ae3a1b44c4862db73da445e5993b4b6c7b4b6d63d7aff5dcee58c6adba4203565e7d4d52e1cc132ffd8791933d2354692bb25780ac5'
8 spec/dummy/config/initializers/session_store.rb
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
+
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rails generate session_migration")
+# Dummy::Application.config.session_store :active_record_store
5 spec/dummy/config/locales/en.yml
@@ -0,0 +1,5 @@
+# Sample localization file for English. Add more files in this directory for other locales.
+# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+en:
+ hello: "Hello world"
59 spec/dummy/config/routes.rb
@@ -0,0 +1,59 @@
+Dummy::Application.routes.draw do
+ match '/drinks(.:format)', :to => 'drinks#index', :as => :drinks
+ # The priority is based upon order of creation:
+ # first created -> highest priority.
+
+ # Sample of regular route:
+ # match 'products/:id' => 'catalog#view'
+ # Keep in mind you can assign values other than :controller and :action
+
+ # Sample of named route:
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
+ # This route can be invoked with purchase_url(:id => product.id)
+
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
+ # resources :products
+
+ # Sample resource route with options:
+ # resources :products do
+ # member do
+ # get 'short'
+ # post 'toggle'
+ # end
+ #
+ # collection do
+ # get 'sold'
+ # end
+ # end
+
+ # Sample resource route with sub-resources:
+ # resources :products do
+ # resources :comments, :sales
+ # resource :seller
+ # end
+
+ # Sample resource route with more complex sub-resources
+ # resources :products do
+ # resources :comments
+ # resources :sales do
+ # get 'recent', :on => :collection
+ # end
+ # end
+
+ # Sample resource route within a namespace:
+ # namespace :admin do
+ # # Directs /admin/products/* to Admin::ProductsController
+ # # (app/controllers/admin/products_controller.rb)
+ # resources :products
+ # end
+
+ # You can have the root of your site routed with "root"
+ # just remember to delete public/index.html.
+ root :to => "drinks#index"
+
+ # See how all your routes lay out with "rake routes"
+
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
+ # Note: This route will make all actions in every controller accessible via GET requests.
+ # match ':controller(/:action(/:id(.:format)))'
+end
7 spec/dummy/db/seeds.rb
@@ -0,0 +1,7 @@
+# This file should contain all the record creation needed to seed the database with its default values.
+# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
+#
+# Examples:
+#
+# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
+# Mayor.create(:name => 'Daley', :city => cities.first)
0  spec/dummy/lib/tasks/.gitkeep
No changes.
6 spec/dummy/script/rails
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
+
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require File.expand_path('../../config/boot', __FILE__)
+require 'rails/commands'
0  spec/dummy/vendor/plugins/.gitkeep
No changes.
18 spec/request/coffee_script_spec.rb
@@ -0,0 +1,18 @@
+require 'spec_helper'
+
+feature "CoffeeScript" do
+
+ scenario "should render a .js.coffee file." do
+ visit drinks_url(:format => 'js')
+
+ page.should have_content("(function() { alert('i like coffee!'); }).call(this);")
+ end
+
+ scenario "should render a block with helper tags" do
+ visit drinks_url
+
+ page.body.to_s.should == "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=US-ASCII\">\n<script type=\"text/javascript\">(function() {\n alert('coffee script is awesome!');\n}).call(this);\n</script><script>\n (function() {\n alert('coffee script is really awesome!');\n}).call(this);\n</script>\n</head></html>\n"
+
+ end
+
+end
38 spec/spec_helper.rb
@@ -0,0 +1,38 @@
+ENV["RAILS_ENV"] = "test"
+
+require File.expand_path("../dummy/config/environment.rb", __FILE__)
+
+require 'rubygems'
+require 'rspec/rails'
+
+ActionMailer::Base.delivery_method = :test
+ActionMailer::Base.perform_deliveries = true
+ActionMailer::Base.default_url_options[:host] = "test.com"
+
+Rails.backtrace_cleaner.remove_silencers!
+
+require File.join(File.dirname(__FILE__), '..', 'lib', 'coffeebeans')
+
+require "capybara/rails"
+# Capybara.default_driver = :rack_test
+# Capybara.default_selector = :css
+
+RSpec.configure do |config|
+
+ config.before(:all) do
+
+ end
+
+ config.after(:all) do
+
+ end
+
+ config.before(:each) do
+
+ end
+
+ config.after(:each) do
+
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.