}
]
end
end
end
================================================
FILE: components/annoyance/app/models/annoyance/meter.rb
================================================
module Annoyance
class Meter
attr_accessor :limit
def initialize(limit)
raise ArgumentError unless limit.is_a? Integer
@limit = limit
end
def annoyance_level(repetition_count)
raise ArgumentError unless limit.is_a? Integer
return "" if repetition_count <= 0
repetition_count -= 1
index = repetition_count * Annoyance::Levels.levels.count/limit.to_f
index_to_access = [index, Annoyance::Levels.levels.count - 1].min
annoyance_level = Annoyance::Levels.levels[index_to_access]
annoyance_level + what_to_duplicate(repetition_count, annoyance_level) * emphasis(repetition_count, index)
end
def annoyance_adjusted(text, repetition_count)
if repetition_count < limit
text + annoyance_level(repetition_count)
else
annoyance_level(repetition_count)
end
end
private
def emphasis(repetition_count, index)
if repetition_count < limit
if index - index.to_i != 0
(1/(index - index.to_i)).ceil - 1
else
0
end
else
repetition_count - limit + 1
end
end
def what_to_duplicate(repetition_count, annoyance_level)
repetition_count < limit ? annoyance_level[-1] : annoyance_level
end
end
end
================================================
FILE: components/annoyance/lib/annoyance/engine.rb
================================================
module Annoyance
class Engine < ::Rails::Engine
end
end
================================================
FILE: components/annoyance/lib/annoyance/version.rb
================================================
module Annoyance
VERSION = "0.0.1"
end
================================================
FILE: components/annoyance/lib/annoyance.rb
================================================
if defined?(Rails)
require 'annoyance/engine'
else
require_relative '../app/models/annoyance/levels'
require_relative '../app/models/annoyance/meter'
end
module Annoyance
end
================================================
FILE: components/annoyance/spec/annoyance/levels_spec.rb
================================================
require File.expand_path("../../../app/models/annoyance/levels", __FILE__)
module Annoyance
describe Annoyance do
describe ".levels" do
it "should be an array of strings" do
Annoyance::Levels.levels.should be_an Array
Annoyance::Levels.levels.select {|level| level.is_a? String }.count.should == Annoyance::Levels.levels.count
end
end
end
end
================================================
FILE: components/annoyance/spec/annoyance/meter_spec.rb
================================================
require File.expand_path("../../../app/models/annoyance/meter", __FILE__)
module Annoyance
describe Annoyance::Meter do
it "should be calibrated on initialize" do
meter = Annoyance::Meter.new(10)
meter.limit.should == 10
end
it "should raise if anything but an Integer is given" do
expect {
meter = Annoyance::Meter.new(:a)
}.to raise_exception ArgumentError
end
describe "#annoyance_level" do
before do
Annoyance::Levels.stub(:levels).and_return(
[
"level 1!",
"level 2!",
"level 3!",
"level 4!",
]
)
end
it "should raise if anything but an Integer is given" do
expect {
meter = Annoyance::Meter.new(5).annoyance_level("a")
}.to raise_exception ArgumentError
end
it "should return the description of the appropriate level of annoyance" do
meter = Annoyance::Meter.new(4)
meter.annoyance_level(1).should == "level 1!"
meter.annoyance_level(2).should == "level 2!"
meter.annoyance_level(3).should == "level 3!"
meter.annoyance_level(4).should == "level 4!"
end
it "should handle impossible user input gracefully" do
meter = Annoyance::Meter.new(3)
meter.annoyance_level(-1).should == ""
end
it "should return empty string for count 0" do
meter = Annoyance::Meter.new(99)
meter.annoyance_level(0).should == ""
meter = Annoyance::Meter.new(15)
meter.annoyance_level(0).should == ""
end
it "should extrapolate from the last appropriate level of annoyance by duplicating the last character" do
meter = Annoyance::Meter.new(8)
meter.annoyance_level(1).should == "level 1!"
meter.annoyance_level(2).should == "level 1!!"
meter.annoyance_level(3).should == "level 2!"
meter.annoyance_level(4).should == "level 2!!"
meter.annoyance_level(5).should == "level 3!"
meter.annoyance_level(6).should == "level 3!!"
meter.annoyance_level(7).should == "level 4!"
meter.annoyance_level(8).should == "level 4!!"
end
it "should extrapolate the last possible input by duplicating the whole result" do
meter = Annoyance::Meter.new(4)
meter.annoyance_level(5).should == "level 4!level 4!"
meter.annoyance_level(6).should == "level 4!level 4!level 4!"
end
end
describe "#annoyance_adjusted" do
before do
Annoyance::Levels.stub(:levels).and_return(
[
"level 1!",
"level 2!"
]
)
end
context "when this limit is not yet reached" do
it "should annoyance adjust a given text by duplicating the last character" do
meter = Annoyance::Meter.new(2)
meter.annoyance_adjusted("text.", 1).should == "text.level 1!"
end
end
context "when this limit is reached" do
it "should annoyance adjust a given text by replacing the text with duplicated annoyance messages" do
meter = Annoyance::Meter.new(2)
meter.annoyance_adjusted("text.", 4).should == "level 2!level 2!level 2!"
end
end
end
end
end
================================================
FILE: components/annoyance/spec/spec_helper.rb
================================================
#needed for newer versions of rspec.
================================================
FILE: components/annoyance/test.sh
================================================
#!/bin/bash
exit_code=0
echo "*** Running annoyance gem specs"
bundle install --jobs=3 --retry=3 | grep Installing
bundle exec rspec spec
exit_code+=$?
exit $exit_code
================================================
FILE: components/email_signup/.gitignore
================================================
.bundle/
log/*.log
pkg/
spec/dummy/db/*.sqlite3
spec/dummy/log/*.log
spec/dummy/tmp/
spec/dummy/.sass-cache
================================================
FILE: components/email_signup/.rspec
================================================
--color
================================================
FILE: components/email_signup/.ruby-gemset
================================================
tnbtes
================================================
FILE: components/email_signup/.ruby-version
================================================
2.1.0
================================================
FILE: components/email_signup/Gemfile
================================================
source "https://rubygems.org"
gemspec
================================================
FILE: components/email_signup/MIT-LICENSE
================================================
Copyright 2013 YOURNAME
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.
================================================
FILE: components/email_signup/README.rdoc
================================================
= EmailSignup
This project rocks and uses MIT-LICENSE.
================================================
FILE: components/email_signup/Rakefile
================================================
#!/usr/bin/env rake
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
begin
require 'rdoc/task'
rescue LoadError
require 'rdoc/rdoc'
require 'rake/rdoctask'
RDoc::Task = Rake::RDocTask
end
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'EmailSignup'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'
Bundler::GemHelper.install_tasks
================================================
FILE: components/email_signup/app/models/email_signup/entry.rb
================================================
module EmailSignup
class Entry < ActiveRecord::Base
# attr_accessible :email, :tries
validates :email, presence: true, uniqueness: true
end
end
================================================
FILE: components/email_signup/app/models/email_signup/entry_manager.rb
================================================
module EmailSignup
class EntryManager
def create(email)
return if find_by_email(email)
EmailSignup::Entry.create email: email
end
def find_by_email(email)
EmailSignup::Entry.find_by_email email
end
end
end
================================================
FILE: components/email_signup/config/routes.rb
================================================
EmailSignup::Engine.routes.draw do
end
================================================
FILE: components/email_signup/db/migrate/20130331124429_create_news_signup_entry.rb
================================================
class CreateNewsSignupEntry < ActiveRecord::Migration
def change
create_table "news_signup_entries", force: true do |t|
t.string "email"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "tries", default: 0
end
end
end
================================================
FILE: components/email_signup/db/migrate/20130331134505_rename_news_signup_etnries_to_email_signup_entries.rb
================================================
class RenameNewsSignupEtnriesToEmailSignupEntries < ActiveRecord::Migration
def change
rename_table :news_signup_entries, :email_signup_entries
end
end
================================================
FILE: components/email_signup/db/migrate/20130403220851_remove_tries_from_email_signup_entry.rb
================================================
class RemoveTriesFromEmailSignupEntry < ActiveRecord::Migration
def change
remove_column :email_signup_entries, :tries
end
end
================================================
FILE: components/email_signup/email_signup.gemspec
================================================
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "email_signup/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "email_signup"
s.version = EmailSignup::VERSION
s.authors = ["Stephan Hagemann"]
s.email = ["stephan.hagemann@gmail.com"]
s.summary = "The engine that is doing signup"
s.description = "The engine that is doing signup"
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.add_dependency "rails", "4.1.8"
s.add_development_dependency "rspec-rails", "3.1.0"
s.add_development_dependency "shoulda-matchers", "2.7.0"
s.add_development_dependency "sqlite3", "1.3.9"
end
================================================
FILE: components/email_signup/lib/email_signup/engine.rb
================================================
module EmailSignup
class Engine < ::Rails::Engine
isolate_namespace EmailSignup
initializer :append_migrations do |app|
unless app.root.to_s.match root.to_s + File::SEPARATOR
config.paths["db/migrate"].expanded.each do |path|
app.config.paths["db/migrate"] << path
end
end
end
end
end
================================================
FILE: components/email_signup/lib/email_signup/version.rb
================================================
module EmailSignup
VERSION = "0.0.1"
end
================================================
FILE: components/email_signup/lib/email_signup.rb
================================================
require "email_signup/engine"
module EmailSignup
end
================================================
FILE: components/email_signup/lib/tasks/news_signup_tasks.rake
================================================
# desc "Explaining what the task does"
# task :email_signup do
# # Task goes here
# end
================================================
FILE: components/email_signup/script/rails
================================================
#!/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.
ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/email_signup/engine', __FILE__)
require 'rails/all'
require 'rails/engine/commands'
================================================
FILE: components/email_signup/spec/dummy/README.rdoc
================================================
== Welcome to Rails
Rails is a web-application framework that includes everything needed to create
database-backed web applications according to the Model-View-Control pattern.
This pattern splits the view (also called the presentation) into "dumb"
templates that are primarily responsible for inserting pre-built data in between
HTML tags. The model contains the "smart" domain objects (such as Account,
Product, Person, Post) that holds all the business logic and knows how to
persist themselves to a database. The controller handles the incoming requests
(such as Save New Account, Update Product, Show Post) by manipulating the model
and directing data to the view.
In Rails, the model is handled by what's called an object-relational mapping
layer entitled Active Record. This layer allows you to present the data from
database rows as objects and embellish these data objects with business logic
methods. You can read more about Active Record in
link:files/vendor/rails/activerecord/README.html.
The controller and view are handled by the Action Pack, which handles both
layers by its two parts: Action View and Action Controller. These two layers
are bundled in a single package due to their heavy interdependence. This is
unlike the relationship between the Active Record and Action Pack that is much
more separate. Each of these packages can be used independently outside of
Rails. You can read more about Action Pack in
link:files/vendor/rails/actionpack/README.html.
== Getting Started
1. At the command prompt, create a new Rails application:
rails new myapp (where myapp is the application name)
2. Change directory to myapp and start the web server:
cd myapp; rails server (run with --help for options)
3. Go to http://localhost:3000/ and you'll see:
"Welcome aboard: You're riding Ruby on Rails!"
4. Follow the guidelines to start developing your application. You can find
the following resources handy:
* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
== Debugging Rails
Sometimes your application goes wrong. Fortunately there are a lot of tools that
will help you debug it and get it back on the rails.
First area to check is the application log files. Have "tail -f" commands
running on the server.log and development.log. Rails will automatically display
debugging and runtime information to these files. Debugging info will also be
shown in the browser on requests from 127.0.0.1.
You can also log your own messages directly into the log file from your code
using the Ruby logger class from inside your controllers. Example:
class WeblogController < ActionController::Base
def destroy
@weblog = Weblog.find(params[:id])
@weblog.destroy
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
end
end
The result will be a message in your log file along the lines of:
Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
More information on how to use the logger is at http://www.ruby-doc.org/core/
Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
several books available online as well:
* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
These two books will bring you up to speed on the Ruby language and also on
programming in general.
== Debugger
Debugger support is available through the debugger command when you start your
Mongrel or WEBrick server with --debugger. This means that you can break out of
execution at any point in the code, investigate and change the model, and then,
resume execution! You need to install ruby-debug to run the server in debugging
mode. With gems, use sudo gem install ruby-debug. Example:
class WeblogController < ActionController::Base
def index
@posts = Post.all
debugger
end
end
So the controller will accept the action, run the first line, then present you
with a IRB prompt in the server window. Here you can do things like:
>> @posts.inspect
=> "[#You may have mistyped the address or the page may have moved.
Maybe you tried to change something you didn't have access to.
You may have mistyped the address or the page may have moved.
Maybe you tried to change something you didn't have access to.
" + responseText + "
"); } ================================================ FILE: components/teaser/app/assets/javascripts/teaser/teaser.js ================================================ Teaser = {} ================================================ FILE: components/teaser/app/assets/stylesheets/teaser/application.css ================================================ /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it's generally better to create a new file per style scope. * *= require_self *= require_tree . */ ================================================ FILE: components/teaser/app/assets/stylesheets/teaser/teaser.css.scss ================================================ /* * Colors from http://design-seeds.com/index.php/home/entry/a-door-green1 * * Thanks to design seeds! */ $lightgreen: #e4e8ae; $browngreen: #786f27; $gray: #b5acad; $darkgray: #424343; $midgreen: #cfcb65; $darkgreen: #758559; /* * You are allowed to do whatever you want with this layout. Though I would be pleased if you placed a link on your site to csseasy.com or to profit42.com (best "blog about hacking" ever). Donations are also welcome: paypal@profit42.com (or follow the donation button on csseasy.com) * * Thanks to css easy! */ * { font-family: 'Lucida Sans Unicode'; } body { background-color: $midgreen; font-size: 16px; margin: 0; padding: 0; } #header { background-color: $browngreen; height: 90px; padding: 50px; font-size: 80px; text-align: center; color: #fff; text-shadow: black 0.05em 0.05em 0.05em; } #top { width: 100%; background-color: $midgreen; height: 50px; } #center { background-color: $lightgreen; min-height: 600px; /* for modern browsers */ height: auto !important; /* for modern browsers */ height: 600px; /* for IE5.x and IE6 */ text-align: center; color: #fff; } #footer { clear: both; background-color: $browngreen; height: 200px; } #content { font-size: 28px; padding: 80px 0px; text-align: center; color: $darkgray; p { line-height: 28px; } input { background-color: white; border: 1px solid $gray; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; -moz-transition: border linear 0.2s, box-shadow linear 0.2s; -o-transition: border linear 0.2s, box-shadow linear 0.2s; transition: border linear 0.2s, box-shadow linear 0.2s; display: inline-block; height: 20px; width: 200px; padding: 4px 6px; margin-top: 20px; margin-bottom: 9px; font-size: 14px; line-height: 20px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } } ================================================ FILE: components/teaser/app/controllers/teaser/application_controller.rb ================================================ module Teaser class ApplicationController < ActionController::Base end end ================================================ FILE: components/teaser/app/controllers/teaser/tease_controller.rb ================================================ module Teaser class TeaseController < Teaser::ApplicationController before_filter :inject_dependencies, only: [:create] def new end def create email = params[:new_sign_up_entry].presence render text: "Hey! Please call this right... I need a new signUp entry!", status: 400 and return unless email if similar_exisiting_entry = @entry_manager.find_by_email(email) tries = @event_counter.log("email_signup_entry_#{similar_exisiting_entry.id}", "signup") render( text: @annoyance_meter.annoyance_adjusted("Hm... Did you already sign up?", tries), status: 400) and return elsif @entry_manager.create(email) render text: "Thanks for signing up!", status: 200 else render text: "Hm... something went seriously wrong.", status: 500 end end private def inject_dependencies @entry_manager = EmailSignup::EntryManager.new @annoyance_meter = Annoyance::Meter.new(10) @event_counter = EventCounter::Logger.new end end end ================================================ FILE: components/teaser/app/views/layouts/teaser/application.html.erb ================================================
You may have mistyped the address or the page may have moved.
Maybe you tried to change something you didn't have access to.
within p
within p
this was a success
'); }); it("should prepend the result to the $resultElement (if there is no responseText)", function () { signUp.handleSubmissionResult("success_class", "this was also a success"); expect(signUp.$resultElement.html()).toEqual('this was also a success
'); }); }); }); ================================================ FILE: components/teaser/spec/request_spec_helper.rb ================================================ ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../dummy/config/environment", __FILE__) require 'rspec/rails' require 'capybara/rspec' require 'capybara/poltergeist' Capybara.javascript_driver = :poltergeist Dir[Teaser::Engine.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| config.use_transactional_fixtures = false config.infer_base_class_for_anonymous_controllers = false config.order = "random" config.include RequestSpecHelpers config.include Capybara::DSL end ================================================ FILE: components/teaser/spec/spec_helper.rb ================================================ ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../dummy/config/environment", __FILE__) require 'rspec/rails' require 'shoulda-matchers' require 'event_counter/test_helper' Dir[Teaser::Engine.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| config.use_transactional_fixtures = true config.infer_base_class_for_anonymous_controllers = false config.order = "random" end ================================================ FILE: components/teaser/spec/support/request_spec_helpers.rb ================================================ module RequestSpecHelpers def press_key_on_selector(key, selector) page.driver.execute_script("var e = $.Event('keydown', { keyCode: #{key} }); $('#{selector}').trigger(e);") end end ================================================ FILE: components/teaser/teaser.gemspec ================================================ $:.push File.expand_path("../lib", __FILE__) # Maintain your gem"s version: require "teaser/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "teaser" s.version = Teaser::VERSION s.authors = ["Stephan Hagemann"] s.email = ["stephan.hagemann@gmail.com"] s.summary = "Teaser gem" s.description = "Teaser gem" s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] s.add_dependency "rails", "4.1.8" s.add_dependency "haml-rails", "0.5.3" s.add_dependency "sass-rails", "4.0.1" s.add_dependency "jquery-rails", "3.1.0" s.add_dependency "event_counter" s.add_dependency "annoyance" s.add_dependency "email_signup" s.add_development_dependency "rspec-rails", "3.1.0" s.add_development_dependency "capybara", "2.4.1" s.add_development_dependency "shoulda-matchers", "2.7.0" s.add_development_dependency "sqlite3", "1.3.9" s.add_development_dependency "poltergeist", "1.5.1" s.add_development_dependency "jasmine", "1.3.2" end ================================================ FILE: components/teaser/test.sh ================================================ #!/bin/bash exit_code=0 echo "*** Running teaser engine specs" bundle install --jobs=3 --retry=3 | grep Installing bundle exec rake db:create bundle exec rake db:migrate RAILS_ENV=test bundle exec rake db:create RAILS_ENV=test bundle exec rake db:migrate bundle exec rspec spec/controllers exit_code+=$? echo "*** Running teaser engine request specs" bundle exec rspec spec/features exit_code+=$? echo "*** Running teaser engine javascript specs" bundle exec rake app:jasmine:ci exit_code+=$? exit $exit_code ================================================ FILE: config/application.rb ================================================ 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 "sprockets/railtie" #require "rails/test_unit/railtie" if defined?(Bundler) # If you precompile assets before deploying to production, use this line Bundler.require(*Rails.groups(:assets => %w(development test))) # If you want your assets lazily compiled in production, use this line # Bundler.require(:default, :assets, Rails.env) end module TheNextBigThing 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 # 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] # Enable escaping HTML in JSON. config.active_support.escape_html_entities_in_json = true # Use SQL instead of Active Record's schema dumper when creating the 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 # Enforce whitelist mode for mass assignment. # This will create an empty whitelist of attributes available for mass-assignment for all models # in your app. As such, your models will need to explicitly whitelist or blacklist accessible # parameters by using an attr_accessible or attr_protected declaration. # config.active_record.whitelist_attributes = true # Enable the asset pipeline config.assets.enabled = true # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' #config.assets.initialize_on_precompile = false config.secret_key_base = "some super secret" end end ================================================ FILE: config/boot.rb ================================================ 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']) ================================================ FILE: config/database.yml ================================================ development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 ================================================ FILE: config/environment.rb ================================================ # Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application TheNextBigThing::Application.initialize! ================================================ FILE: config/environments/development.rb ================================================ TheNextBigThing::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 web server when you make code changes. config.cache_classes = false # Show full error reports and disable caching config.consider_all_requests_local = 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 config.eager_load = false end ================================================ FILE: config/environments/production.rb ================================================ TheNextBigThing::Application.configure do # Settings specified here will take precedence over those in config/application.rb # 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 # Disable Rails's static asset server (Apache or nginx will already do this) config.serve_static_assets = false # Specifies the header that your server uses for sending files # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true # See everything in the log (default is :info) # config.log_level = :debug # Prepend all log lines with the following tags # config.log_tags = [ :subdomain, :uuid ] # Use a different logger for distributed setups # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Use a different cache store in production # config.cache_store = :mem_cache_store # 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 config.eager_load = true end ================================================ FILE: config/environments/test.rb ================================================ TheNextBigThing::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 # Configure static asset server for tests with Cache-Control for performance config.serve_static_assets = true config.static_cache_control = "public, max-age=3600" # 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 # Print deprecation notices to the stderr config.active_support.deprecation = :stderr config.eager_load = false end ================================================ FILE: config/initializers/backtrace_silencers.rb ================================================ # 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! ================================================ FILE: config/initializers/inflections.rb ================================================ # 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 # # These inflection rules are supported but not enabled by default: # ActiveSupport::Inflector.inflections do |inflect| # inflect.acronym 'RESTful' # end ================================================ FILE: config/initializers/mime_types.rb ================================================ # 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 ================================================ FILE: config/initializers/secret_token.rb ================================================ # 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. TheNextBigThing::Application.config.secret_token = 'f0a8e268c6f152a6a8a4833925366d511d62b85fa34098ed120238540e068c9578636785b920537a10c84bc0e512a6f6e0e782e6852971cabeacf96019a85c71' ================================================ FILE: config/initializers/session_store.rb ================================================ # Be sure to restart your server when you modify this file. TheNextBigThing::Application.config.session_store :cookie_store, key: '_the_next_big_thing_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") # TheNextBigThing::Application.config.session_store :active_record_store ================================================ FILE: config/initializers/wrap_parameters.rb ================================================ # Be sure to restart your server when you modify this file. # # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do wrap_parameters format: [:json] end ================================================ FILE: config/locales/en.yml ================================================ # Sample localization file for English. Add more files in this directory for other locales. # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. en: hello: "Hello world" ================================================ FILE: config/routes.rb ================================================ TheNextBigThing::Application.routes.draw do mount Teaser::Engine => "/" end ================================================ FILE: config.ru ================================================ # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run TheNextBigThing::Application ================================================ FILE: db/schema.rb ================================================ # encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(version: 20130403220851) do create_table "email_signup_entries", force: true do |t| t.string "email" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "event_counter_counts", force: true do |t| t.string "object_identifier" t.string "event_identifier" t.integer "count", default: 0 end end ================================================ FILE: db/seeds.rb ================================================ # 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: 'Emanuel', city: cities.first) ================================================ FILE: log/.gitkeep ================================================ ================================================ FILE: migrate_and_prepare_all.sh ================================================ #!/bin/bash [ -s "$HOME/.rvm/scripts/rvm" ] && . "$HOME/.rvm/scripts/rvm" echo "migrating teaser" cd engines/teaser && rake db:migrate app:db:test:prepare && cd ../.. echo "migrating wrapper rails app" rake db:migrate db:test:prepare ================================================ FILE: public/404.html ================================================You may have mistyped the address or the page may have moved.
Maybe you tried to change something you didn't have access to.