From adf960fafdcfffe6e24ffce999df61239945b180 Mon Sep 17 00:00:00 2001 From: Matthew Higgins Date: Sat, 5 Mar 2016 10:08:52 +0200 Subject: [PATCH] Initial Commit Empty Rails app with Sidekiq, created with Suspenders by Thoughtbot. --- .ctags | 2 + .foreman | 1 + .gitignore | 39 +++ .rubocop.yml | 5 + .ruby-version | 1 + .sample.env | 10 + Gemfile | 60 ++++ Gemfile.lock | 319 ++++++++++++++++++ Procfile | 2 + README.md | 40 +++ Rakefile | 17 + app/assets/images/.keep | 0 app/assets/javascripts/application.js | 15 + app/assets/stylesheets/application.scss | 8 + app/controllers/application_controller.rb | 5 + app/controllers/concerns/.keep | 0 app/helpers/application_helper.rb | 2 + app/helpers/flashes_helper.rb | 5 + app/mailers/.keep | 0 app/models/.keep | 0 app/models/concerns/.keep | 0 app/views/application/_analytics.html.erb | 7 + app/views/application/_flashes.html.erb | 7 + app/views/application/_javascript.html.erb | 12 + app/views/layouts/application.html.erb | 21 ++ app/views/pages/.keep | 0 bin/bundle | 3 + bin/deploy | 12 + bin/rails | 9 + bin/rake | 9 + bin/rspec | 8 + bin/setup | 55 +++ bin/spring | 15 + browserslist | 4 + config.ru | 4 + config/application.rb | 28 ++ config/boot.rb | 3 + config/database.yml | 22 ++ config/environment.rb | 2 + config/environments/development.rb | 15 + config/environments/production.rb | 23 ++ config/environments/staging.rb | 11 + config/environments/test.rb | 16 + config/i18n-tasks.yml | 107 ++++++ config/initializers/assets.rb | 11 + config/initializers/backtrace_silencers.rb | 7 + config/initializers/cookies_serializer.rb | 3 + config/initializers/disable_xml_params.rb | 1 + config/initializers/errors.rb | 34 ++ .../initializers/filter_parameter_logging.rb | 4 + config/initializers/inflections.rb | 16 + config/initializers/json_encoding.rb | 1 + config/initializers/mime_types.rb | 4 + config/initializers/session_store.rb | 3 + config/initializers/simple_form.rb | 165 +++++++++ config/initializers/simple_form_bootstrap.rb | 149 ++++++++ config/initializers/wrap_parameters.rb | 14 + config/locales/en.yml | 19 ++ config/locales/simple_form.en.yml | 31 ++ config/newrelic.yml | 34 ++ config/puma.rb | 28 ++ config/routes.rb | 2 + config/smtp.rb | 9 + db/schema.rb | 18 + db/seeds.rb | 7 + lib/assets/.keep | 0 lib/tasks/.keep | 0 lib/tasks/bundler_audit.rake | 12 + lib/tasks/dev.rake | 12 + lib/templates/erb/scaffold/_form.html.erb | 13 + public/404.html | 69 ++++ public/422.html | 69 ++++ public/500.html | 68 ++++ public/favicon.ico | 0 public/robots.txt | 5 + spec/controllers/.keep | 0 spec/factories.rb | 2 + spec/features/.keep | 0 spec/helpers/.keep | 0 spec/i18n_spec.rb | 13 + spec/lib/.keep | 0 spec/rails_helper.rb | 26 ++ spec/spec_helper.rb | 23 ++ spec/support/action_mailer.rb | 5 + spec/support/database_cleaner.rb | 21 ++ spec/support/factory_girl.rb | 3 + spec/support/features/.keep | 0 spec/support/i18n.rb | 3 + spec/support/matchers/.keep | 0 spec/support/mixins/.keep | 0 spec/support/shared_examples/.keep | 0 spec/support/shoulda_matchers.rb | 6 + vendor/assets/javascripts/.keep | 0 vendor/assets/stylesheets/.keep | 0 94 files changed, 1834 insertions(+) create mode 100644 .ctags create mode 100644 .foreman create mode 100644 .gitignore create mode 100644 .rubocop.yml create mode 100644 .ruby-version create mode 100644 .sample.env create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 Procfile create mode 100644 README.md create mode 100644 Rakefile create mode 100644 app/assets/images/.keep create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/stylesheets/application.scss create mode 100644 app/controllers/application_controller.rb create mode 100644 app/controllers/concerns/.keep create mode 100644 app/helpers/application_helper.rb create mode 100644 app/helpers/flashes_helper.rb create mode 100644 app/mailers/.keep create mode 100644 app/models/.keep create mode 100644 app/models/concerns/.keep create mode 100644 app/views/application/_analytics.html.erb create mode 100644 app/views/application/_flashes.html.erb create mode 100644 app/views/application/_javascript.html.erb create mode 100644 app/views/layouts/application.html.erb create mode 100644 app/views/pages/.keep create mode 100755 bin/bundle create mode 100755 bin/deploy create mode 100755 bin/rails create mode 100755 bin/rake create mode 100755 bin/rspec create mode 100755 bin/setup create mode 100755 bin/spring create mode 100644 browserslist create mode 100644 config.ru create mode 100644 config/application.rb create mode 100644 config/boot.rb create mode 100644 config/database.yml create mode 100644 config/environment.rb create mode 100644 config/environments/development.rb create mode 100644 config/environments/production.rb create mode 100644 config/environments/staging.rb create mode 100644 config/environments/test.rb create mode 100644 config/i18n-tasks.yml create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/backtrace_silencers.rb create mode 100644 config/initializers/cookies_serializer.rb create mode 100644 config/initializers/disable_xml_params.rb create mode 100644 config/initializers/errors.rb create mode 100644 config/initializers/filter_parameter_logging.rb create mode 100644 config/initializers/inflections.rb create mode 100644 config/initializers/json_encoding.rb create mode 100644 config/initializers/mime_types.rb create mode 100644 config/initializers/session_store.rb create mode 100644 config/initializers/simple_form.rb create mode 100644 config/initializers/simple_form_bootstrap.rb create mode 100644 config/initializers/wrap_parameters.rb create mode 100644 config/locales/en.yml create mode 100644 config/locales/simple_form.en.yml create mode 100644 config/newrelic.yml create mode 100644 config/puma.rb create mode 100644 config/routes.rb create mode 100644 config/smtp.rb create mode 100644 db/schema.rb create mode 100644 db/seeds.rb create mode 100644 lib/assets/.keep create mode 100644 lib/tasks/.keep create mode 100644 lib/tasks/bundler_audit.rake create mode 100644 lib/tasks/dev.rake create mode 100644 lib/templates/erb/scaffold/_form.html.erb create mode 100644 public/404.html create mode 100644 public/422.html create mode 100644 public/500.html create mode 100644 public/favicon.ico create mode 100644 public/robots.txt create mode 100644 spec/controllers/.keep create mode 100644 spec/factories.rb create mode 100644 spec/features/.keep create mode 100644 spec/helpers/.keep create mode 100644 spec/i18n_spec.rb create mode 100644 spec/lib/.keep create mode 100644 spec/rails_helper.rb create mode 100644 spec/spec_helper.rb create mode 100644 spec/support/action_mailer.rb create mode 100644 spec/support/database_cleaner.rb create mode 100644 spec/support/factory_girl.rb create mode 100644 spec/support/features/.keep create mode 100644 spec/support/i18n.rb create mode 100644 spec/support/matchers/.keep create mode 100644 spec/support/mixins/.keep create mode 100644 spec/support/shared_examples/.keep create mode 100644 spec/support/shoulda_matchers.rb create mode 100644 vendor/assets/javascripts/.keep create mode 100644 vendor/assets/stylesheets/.keep diff --git a/.ctags b/.ctags new file mode 100644 index 0000000..9d189c1 --- /dev/null +++ b/.ctags @@ -0,0 +1,2 @@ +--recurse=yes +--exclude=vendor diff --git a/.foreman b/.foreman new file mode 100644 index 0000000..87c3f5a --- /dev/null +++ b/.foreman @@ -0,0 +1 @@ +port: 3000 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d181bd --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +*.rbc +capybara-*.html +.rspec +/log +/tmp +/db/*.sqlite3 +/db/*.sqlite3-journal +/public/system +/coverage/ +/spec/tmp +**.orig +rerun.txt +pickle-email-*.html + +# TODO Comment out these rules if you are OK with secrets being uploaded to the +# repo +config/initializers/secret_token.rb +config/secrets.yml + +## Environment normalization: +/.bundle +/vendor/bundle + +# these should all be checked in to normalize the environment: +# Gemfile.lock, .ruby-version, .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# if using bower-rails ignore default bower_components path bower.json files +/vendor/assets/bower_components +*.bowerrc +bower.json + +# Ignore pow environment settings +.powenv + +# Ignore Byebug command history file. +.byebug_history diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..2f4ce21 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,5 @@ +Rails: + Enabled: true + +Style/StringLiterals: + EnforcedStyle: double_quotes diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..276cbf9 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.3.0 diff --git a/.sample.env b/.sample.env new file mode 100644 index 0000000..9293961 --- /dev/null +++ b/.sample.env @@ -0,0 +1,10 @@ +# http://ddollar.github.com/foreman/ +ASSET_HOST=localhost:3000 +APPLICATION_HOST=localhost:3000 +RACK_ENV=development +SECRET_KEY_BASE=development_secret +EXECJS_RUNTIME=Node +SMTP_ADDRESS=smtp.example.com +SMTP_DOMAIN=example.com +SMTP_PASSWORD=password +SMTP_USERNAME=username diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..0bc392c --- /dev/null +++ b/Gemfile @@ -0,0 +1,60 @@ +source "https://rubygems.org" + +ruby "2.3.0" + +gem "airbrake" +gem "autoprefixer-rails" +gem "bourbon", "~> 4.2.0" +gem "coffee-rails", "~> 4.1.0" +gem "sidekiq" +gem "email_validator" +gem "flutie" +gem "high_voltage" +gem "jquery-rails" +gem "neat", "~> 1.7.0" +gem "newrelic_rpm", ">= 3.9.8" +gem "normalize-rails", "~> 3.0.0" +gem "pg" +gem "puma" +gem "rack-canonical-host" +gem "rails", "~> 4.2.0" +gem "recipient_interceptor" +gem "sass-rails", "~> 5.0" +gem "simple_form" +gem "title" +gem "uglifier" + +group :development do + gem "quiet_assets" + gem "refills" + gem "spring" + gem "spring-commands-rspec" + gem "web-console" +end + +group :development, :test do + gem "awesome_print" + gem "bundler-audit", require: false + gem "byebug" + gem "dotenv-rails" + gem "factory_girl_rails" + gem "i18n-tasks" + gem "pry-rails" + gem "rspec-rails", "~> 3.3.0" +end + +group :test do + gem "capybara-webkit" + gem "database_cleaner" + gem "formulaic" + gem "launchy" + gem "shoulda-matchers" + gem "simplecov", require: false + gem "timecop" + gem "webmock" +end + +group :staging, :production do + gem "rails_stdout_logging" + gem "rack-timeout" +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..f8edd5c --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,319 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.2.5.2) + actionpack (= 4.2.5.2) + actionview (= 4.2.5.2) + activejob (= 4.2.5.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.5.2) + actionview (= 4.2.5.2) + activesupport (= 4.2.5.2) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.5.2) + activesupport (= 4.2.5.2) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.5.2) + activesupport (= 4.2.5.2) + globalid (>= 0.3.0) + activemodel (4.2.5.2) + activesupport (= 4.2.5.2) + builder (~> 3.1) + activerecord (4.2.5.2) + activemodel (= 4.2.5.2) + activesupport (= 4.2.5.2) + arel (~> 6.0) + activesupport (4.2.5.2) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + addressable (2.4.0) + airbrake (5.1.0) + airbrake-ruby (~> 1.1) + airbrake-ruby (1.1.0) + arel (6.0.3) + ast (2.2.0) + autoprefixer-rails (6.3.3.1) + execjs + awesome_print (1.6.1) + bourbon (4.2.6) + sass (~> 3.4) + thor (~> 0.19) + builder (3.2.2) + bundler-audit (0.5.0) + bundler (~> 1.2) + thor (~> 0.18) + byebug (8.2.2) + capybara (2.6.2) + addressable + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) + capybara-webkit (1.8.0) + capybara (>= 2.3.0, < 2.7.0) + json + coderay (1.1.1) + coffee-rails (4.1.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.1.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.10.0) + concurrent-ruby (1.0.1) + connection_pool (2.2.0) + crack (0.4.3) + safe_yaml (~> 1.0.0) + database_cleaner (1.5.1) + debug_inspector (0.0.2) + diff-lcs (1.2.5) + docile (1.1.5) + dotenv (2.1.0) + dotenv-rails (2.1.0) + dotenv (= 2.1.0) + railties (>= 4.0, < 5.1) + easy_translate (0.5.0) + json + thread + thread_safe + email_validator (1.6.0) + activemodel + erubis (2.7.0) + execjs (2.6.0) + factory_girl (4.5.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.6.0) + factory_girl (~> 4.5.0) + railties (>= 3.0.0) + flutie (2.0.0) + formulaic (0.3.0) + activesupport + capybara + i18n + globalid (0.3.6) + activesupport (>= 4.1.0) + hashdiff (0.3.0) + high_voltage (2.4.0) + highline (1.7.8) + i18n (0.7.0) + i18n-tasks (0.9.4) + activesupport (>= 4.0.2) + ast (>= 2.1.0) + easy_translate (>= 0.5.0) + erubis + highline (>= 1.7.3) + i18n + parser (>= 2.2.3.0) + term-ansicolor (>= 1.3.2) + terminal-table (>= 1.5.1) + jquery-rails (4.1.0) + rails-dom-testing (~> 1.0) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (1.8.3) + launchy (2.4.3) + addressable (~> 2.3) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.3) + mime-types (>= 1.16, < 3) + method_source (0.8.2) + mime-types (2.99.1) + mini_portile2 (2.0.0) + minitest (5.8.4) + neat (1.7.4) + bourbon (>= 4.0) + sass (>= 3.3) + newrelic_rpm (3.15.0.314) + nokogiri (1.6.7.2) + mini_portile2 (~> 2.0.0.rc2) + normalize-rails (3.0.3) + parser (2.3.0.6) + ast (~> 2.2) + pg (0.18.4) + pry (0.10.3) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-rails (0.3.4) + pry (>= 0.9.10) + puma (3.0.2) + quiet_assets (1.1.0) + railties (>= 3.1, < 5.0) + rack (1.6.4) + rack-canonical-host (0.1.0) + addressable + rack (~> 1.0) + rack-test (0.6.3) + rack (>= 1.0) + rack-timeout (0.3.2) + rails (4.2.5.2) + actionmailer (= 4.2.5.2) + actionpack (= 4.2.5.2) + actionview (= 4.2.5.2) + activejob (= 4.2.5.2) + activemodel (= 4.2.5.2) + activerecord (= 4.2.5.2) + activesupport (= 4.2.5.2) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.5.2) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + rails_stdout_logging (0.0.4) + railties (4.2.5.2) + actionpack (= 4.2.5.2) + activesupport (= 4.2.5.2) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (10.5.0) + recipient_interceptor (0.1.2) + mail + redis (3.2.2) + refills (0.1.0) + rspec-core (3.3.2) + rspec-support (~> 3.3.0) + rspec-expectations (3.3.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.3.0) + rspec-mocks (3.3.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.3.0) + rspec-rails (3.3.3) + actionpack (>= 3.0, < 4.3) + activesupport (>= 3.0, < 4.3) + railties (>= 3.0, < 4.3) + rspec-core (~> 3.3.0) + rspec-expectations (~> 3.3.0) + rspec-mocks (~> 3.3.0) + rspec-support (~> 3.3.0) + rspec-support (3.3.0) + safe_yaml (1.0.4) + sass (3.4.21) + sass-rails (5.0.4) + railties (>= 4.0.0, < 5.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + shoulda-matchers (3.1.1) + activesupport (>= 4.0.0) + sidekiq (4.1.1) + concurrent-ruby (~> 1.0) + connection_pool (~> 2.2, >= 2.2.0) + redis (~> 3.2, >= 3.2.1) + simple_form (3.2.1) + actionpack (> 4, < 5.1) + activemodel (> 4, < 5.1) + simplecov (0.11.2) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) + slop (3.6.0) + spring (1.6.4) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + sprockets (3.5.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.0.4) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + term-ansicolor (1.3.2) + tins (~> 1.0) + terminal-table (1.5.2) + thor (0.19.1) + thread (0.2.2) + thread_safe (0.3.5) + tilt (2.0.2) + timecop (0.8.0) + tins (1.8.2) + title (0.0.5) + i18n + rails (>= 3.1) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (2.7.2) + execjs (>= 0.3.0) + json (>= 1.8.0) + web-console (3.1.1) + activemodel (>= 4.2) + debug_inspector + railties (>= 4.2) + webmock (1.24.2) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff + xpath (2.0.0) + nokogiri (~> 1.3) + +PLATFORMS + ruby + +DEPENDENCIES + airbrake + autoprefixer-rails + awesome_print + bourbon (~> 4.2.0) + bundler-audit + byebug + capybara-webkit + coffee-rails (~> 4.1.0) + database_cleaner + dotenv-rails + email_validator + factory_girl_rails + flutie + formulaic + high_voltage + i18n-tasks + jquery-rails + launchy + neat (~> 1.7.0) + newrelic_rpm (>= 3.9.8) + normalize-rails (~> 3.0.0) + pg + pry-rails + puma + quiet_assets + rack-canonical-host + rack-timeout + rails (~> 4.2.0) + rails_stdout_logging + recipient_interceptor + refills + rspec-rails (~> 3.3.0) + sass-rails (~> 5.0) + shoulda-matchers + sidekiq + simple_form + simplecov + spring + spring-commands-rspec + timecop + title + uglifier + web-console + webmock + +BUNDLED WITH + 1.11.2 diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..da9fbbd --- /dev/null +++ b/Procfile @@ -0,0 +1,2 @@ +web: bundle exec puma -p $PORT -C ./config/puma.rb +worker: bundle exec sidekiq diff --git a/README.md b/README.md new file mode 100644 index 0000000..7abda80 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# Tomatobot + +## Getting Started + +After you have cloned this repo, run this setup script to set up your machine +with the necessary dependencies to run and test this app: + + % ./bin/setup + +It assumes you have a machine equipped with Ruby, Postgres, etc. If not, set up +your machine with [this script]. + +[this script]: https://github.com/thoughtbot/laptop + +After setting up, you can run the application using [foreman]: + + % foreman start + +If you don't have `foreman`, see [Foreman's install instructions][foreman]. It +is [purposefully excluded from the project's `Gemfile`][exclude]. + +[foreman]: https://github.com/ddollar/foreman +[exclude]: https://github.com/ddollar/foreman/pull/437#issuecomment-41110407 + +## Guidelines + +Use the following guides for getting things done, programming well, and +programming in style. + +* [Protocol](http://github.com/thoughtbot/guides/blob/master/protocol) +* [Best Practices](http://github.com/thoughtbot/guides/blob/master/best-practices) +* [Style](http://github.com/thoughtbot/guides/blob/master/style) + +## Deploying + +If you have previously run the `./bin/setup` script, +you can deploy to staging and production with: + + $ ./bin/deploy staging + $ ./bin/deploy production diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..a855a0b --- /dev/null +++ b/Rakefile @@ -0,0 +1,17 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path("../config/application", __FILE__) + +Rails.application.load_tasks +task(:default).clear +task default: [:spec] + +if defined? RSpec + task(:spec).clear + RSpec::Core::RakeTask.new(:spec) do |t| + t.verbose = false + end +end + +task default: "bundler:audit" diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000..646c5ab --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,15 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require jquery +//= require jquery_ujs +//= require_tree . diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss new file mode 100644 index 0000000..e701338 --- /dev/null +++ b/app/assets/stylesheets/application.scss @@ -0,0 +1,8 @@ +@charset "utf-8"; + +@import "normalize-rails"; +@import "bourbon"; +@import "base/grid-settings"; +@import "neat"; +@import "base/base"; +@import "refills/flashes"; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..d83690e --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/helpers/flashes_helper.rb b/app/helpers/flashes_helper.rb new file mode 100644 index 0000000..bef014f --- /dev/null +++ b/app/helpers/flashes_helper.rb @@ -0,0 +1,5 @@ +module FlashesHelper + def user_facing_flashes + flash.to_hash.slice("alert", "error", "notice", "success") + end +end diff --git a/app/mailers/.keep b/app/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/.keep b/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/views/application/_analytics.html.erb b/app/views/application/_analytics.html.erb new file mode 100644 index 0000000..5ae6470 --- /dev/null +++ b/app/views/application/_analytics.html.erb @@ -0,0 +1,7 @@ +<% if ENV["SEGMENT_KEY"] %> + +<% end %> diff --git a/app/views/application/_flashes.html.erb b/app/views/application/_flashes.html.erb new file mode 100644 index 0000000..0849058 --- /dev/null +++ b/app/views/application/_flashes.html.erb @@ -0,0 +1,7 @@ +<% if flash.any? %> +
+ <% user_facing_flashes.each do |key, value| -%> +
<%= value %>
+ <% end -%> +
+<% end %> diff --git a/app/views/application/_javascript.html.erb b/app/views/application/_javascript.html.erb new file mode 100644 index 0000000..a738f79 --- /dev/null +++ b/app/views/application/_javascript.html.erb @@ -0,0 +1,12 @@ +<%= javascript_include_tag :application %> + +<%= yield :javascript %> + +<%= render "analytics" %> + +<% if Rails.env.test? %> + <%= javascript_tag do %> + $.fx.off = true; + $.ajaxSetup({ async: false }); + <% end %> +<% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..50a8345 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,21 @@ + + + + + + + <%# + Configure default and controller-, and view-specific titles in + config/locales/en.yml. For more see: + https://github.com/calebthompson/title#usage + %> + <%= t('titles.application') %> + <%= stylesheet_link_tag :application, media: "all" %> + <%= csrf_meta_tags %> + + + <%= render "flashes" -%> + <%= yield %> + <%= render "javascript" %> + + diff --git a/app/views/pages/.keep b/app/views/pages/.keep new file mode 100644 index 0000000..e69de29 diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..fe18745 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) +load Gem.bin_path("bundler", "bundle") diff --git a/bin/deploy b/bin/deploy new file mode 100755 index 0000000..deb2ae9 --- /dev/null +++ b/bin/deploy @@ -0,0 +1,12 @@ +#!/bin/sh + +# Run this script to deploy the app to Heroku. + +set -e + +branch="$(git symbolic-ref HEAD --short)" +target="${1:-staging}" + +git push "$target" "$branch:master" +heroku run rake db:migrate --remote "$target" +heroku restart --remote "$target" diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..af2bb5b --- /dev/null +++ b/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError => e + raise unless e.message.include?("spring") +end +APP_PATH = File.expand_path("../../config/application", __FILE__) +require_relative "../config/boot" +require "rails/commands" diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..3df5805 --- /dev/null +++ b/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError => e + raise unless e.message.include?("spring") +end +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 0000000..6d2fbf9 --- /dev/null +++ b/bin/rspec @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError => e + raise unless e.message.include?("spring") +end +require "bundler/setup" +load Gem.bin_path("rspec-core", "rspec") diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..e189d2e --- /dev/null +++ b/bin/setup @@ -0,0 +1,55 @@ +#!/usr/bin/env sh + +# Set up Rails app. Run this script immediately after cloning the codebase. +# https://github.com/thoughtbot/guides/tree/master/protocol + +# Exit if any subcommand fails +set -e + +# Set up Ruby dependencies via Bundler +gem install bundler --conservative +bundle check || bundle install + +# Set up configurable environment variables +if [ ! -f .env ]; then + cp .sample.env .env +fi + +# Set up database and add any development seed data +bundle exec rake db:setup dev:prime + +# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv +mkdir -p .git/safe + +# Pick a port for Foreman +if ! grep --quiet --no-messages --fixed-strings 'port' .foreman; then + printf 'port: 3000\n' >> .foreman +fi + +if ! command -v foreman > /dev/null; then + gem install foreman +fi + +# Only if this isn't CI +# if [ -z "$CI" ]; then +# fi + +# Set up the staging and production apps. +if heroku join --app tomatobot-stage &> /dev/null; then + git remote add staging git@heroku.com:tomatobot-stage.git || true + printf 'You are a collaborator on the "tomatobot-stage" Heroku app +' +else + printf 'Ask for access to the "tomatobot-stage" Heroku app +' +fi + +if heroku join --app tomatobot &> /dev/null; then + git remote add production git@heroku.com:tomatobot.git || true + printf 'You are a collaborator on the "tomatobot" Heroku app +' +else + printf 'Ask for access to the "tomatobot" Heroku app +' +fi + diff --git a/bin/spring b/bin/spring new file mode 100755 index 0000000..3e7d84e --- /dev/null +++ b/bin/spring @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require "rubygems" + require "bundler" + + if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) + Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) } + gem "spring", match[1] + require "spring/binstub" + end +end diff --git a/browserslist b/browserslist new file mode 100644 index 0000000..1e8f87e --- /dev/null +++ b/browserslist @@ -0,0 +1,4 @@ +Last 2 versions +Explorer >= 9 +iOS >= 7.1 +Android >= 4.4 diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..193e5fe --- /dev/null +++ b/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 Rails.application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..0c44f54 --- /dev/null +++ b/config/application.rb @@ -0,0 +1,28 @@ +require File.expand_path("../boot", __FILE__) +require "rails" +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "sprockets/railtie" +Bundler.require(*Rails.groups) +module Tomatobot + class Application < Rails::Application + config.i18n.enforce_available_locales = true + config.quiet_assets = true + config.generators do |generate| + generate.helper false + generate.javascript_engine false + generate.request_specs false + generate.routing_specs false + generate.stylesheets false + generate.test_framework :rspec + generate.view_specs false + end + config.action_controller.action_on_unpermitted_parameters = :raise + config.active_record.raise_in_transactional_callbacks = true + config.active_job.queue_adapter = :sidekiq + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..fb24cf2 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,3 @@ +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) + +require "bundler/setup" # Set up gems listed in the Gemfile. diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..c61c541 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,22 @@ +development: &default + adapter: postgresql + database: tomatobot_development + encoding: utf8 + host: localhost + min_messages: warning + pool: <%= Integer(ENV.fetch("DB_POOL", 5)) %> + reaping_frequency: <%= Integer(ENV.fetch("DB_REAPING_FREQUENCY", 10)) %> + timeout: 5000 + +test: + <<: *default + database: tomatobot_test + +production: &deploy + encoding: utf8 + min_messages: warning + pool: <%= [Integer(ENV.fetch("MAX_THREADS", 5)), Integer(ENV.fetch("DB_POOL", 5))].max %> + timeout: 5000 + url: <%= ENV.fetch("DATABASE_URL", "") %> + +staging: *deploy diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000..4ef8b83 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,2 @@ +require File.expand_path("../application", __FILE__) +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000..e9fa6e0 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,15 @@ +Rails.application.configure do + config.cache_classes = false + config.eager_load = false + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + config.action_mailer.raise_delivery_errors = true + config.action_mailer.delivery_method = :test + config.active_support.deprecation = :log + config.active_record.migration_error = :page_load + config.assets.debug = true + config.assets.digest = true + config.assets.raise_runtime_errors = true + config.action_view.raise_on_missing_translations = true + config.action_mailer.default_url_options = { host: "localhost:3000" } +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000..bfe2956 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,23 @@ +require Rails.root.join("config/smtp") +Rails.application.configure do + config.cache_classes = true + config.eager_load = true + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + config.serve_static_files = ENV["RAILS_SERVE_STATIC_FILES"].present? + config.middleware.use Rack::Deflater + config.middleware.use Rack::CanonicalHost, ENV.fetch("APPLICATION_HOST") + config.assets.js_compressor = :uglifier + config.assets.compile = false + config.assets.digest = true + config.log_level = :debug + config.action_controller.asset_host = ENV.fetch("ASSET_HOST", ENV.fetch("APPLICATION_HOST")) + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = SMTP_SETTINGS + config.i18n.fallbacks = true + config.active_support.deprecation = :notify + config.log_formatter = ::Logger::Formatter.new + config.active_record.dump_schema_after_migration = false + config.action_mailer.default_url_options = { host: ENV.fetch("APPLICATION_HOST") } +end +Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i diff --git a/config/environments/staging.rb b/config/environments/staging.rb new file mode 100644 index 0000000..1a38057 --- /dev/null +++ b/config/environments/staging.rb @@ -0,0 +1,11 @@ +require_relative "production" + +Mail.register_interceptor( + RecipientInterceptor.new(ENV.fetch("EMAIL_RECIPIENTS")) +) + +Rails.application.configure do + # ... + + config.action_mailer.default_url_options = { host: ENV.fetch("APPLICATION_HOST") } +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000..03a598c --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,16 @@ +Rails.application.configure do + config.cache_classes = true + config.eager_load = false + config.serve_static_files = true + config.static_cache_control = "public, max-age=3600" + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + config.action_dispatch.show_exceptions = false + config.action_controller.allow_forgery_protection = false + config.action_mailer.delivery_method = :test + config.active_support.test_order = :random + config.active_support.deprecation = :stderr + config.action_view.raise_on_missing_translations = true + config.action_mailer.default_url_options = { host: "www.example.com" } + config.active_job.queue_adapter = :inline +end diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml new file mode 100644 index 0000000..2de2348 --- /dev/null +++ b/config/i18n-tasks.yml @@ -0,0 +1,107 @@ +# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks + +# The "main" locale. +base_locale: en +## All available locales are inferred from the data by default. Alternatively, specify them explicitly: +# locales: [es, fr] +## Reporting locale, default: en. Available: en, ru. +# internal_locale: en + +# Read and write translations. +data: + ## Translations are read from the file system. Supported format: YAML, JSON. + ## Provide a custom adapter: + # adapter: I18n::Tasks::Data::FileSystem + + # Locale files or `File.find` patterns where translations are read from: + read: + ## Default: + # - config/locales/%{locale}.yml + ## More files: + # - config/locales/**/*.%{locale}.yml + ## Another gem (replace %#= with %=): + # - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml" + + # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom: + # `i18n-tasks normalize -p` will force move the keys according to these rules + write: + ## For example, write devise and simple form keys to their respective files: + # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml'] + ## Catch-all default: + # - config/locales/%{locale}.yml + + ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class. + # router: convervative_router + + yaml: + write: + # do not wrap lines at 80 characters + line_width: -1 + + ## Pretty-print JSON: + # json: + # write: + # indent: ' ' + # space: ' ' + # object_nl: "\n" + # array_nl: "\n" + +# Find translate calls +search: + ## Paths or `File.find` patterns to search in: + # paths: + # - app/ + + ## Root directories for relative keys resolution. + # relative_roots: + # - app/controllers + # - app/helpers + # - app/mailers + # - app/presenters + # - app/views + + ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting: + ## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json) + exclude: + - app/assets/images + - app/assets/fonts + + ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`: + ## If specified, this settings takes priority over `exclude`, but `exclude` still applies. + # only: ["*.rb", "*.html.slim"] + + ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`. + # strict: true + + ## Multiple scanners can be used. Their results are merged. + ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well. + ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example + +## Google Translate +# translation: +# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate +# api_key: "AbC-dEf5" + +## Do not consider these keys missing: +# ignore_missing: +# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}' +# - '{devise,simple_form}.*' + +## Consider these keys used: +# ignore_unused: +# - 'activerecord.attributes.*' +# - '{devise,kaminari,will_paginate}.*' +# - 'simple_form.{yes,no}' +# - 'simple_form.{placeholders,hints,labels}.*' +# - 'simple_form.{error_notification,required}.:' + +## Exclude these keys from the `i18n-tasks eq-base' report: +# ignore_eq_base: +# all: +# - common.ok +# fr,es: +# - common.brand + +## Ignore these keys completely: +# ignore: +# - kaminari.* diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..13abef8 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = (ENV["ASSETS_VERSION"] || "1.0") + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/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! diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/config/initializers/disable_xml_params.rb b/config/initializers/disable_xml_params.rb new file mode 100644 index 0000000..dab491c --- /dev/null +++ b/config/initializers/disable_xml_params.rb @@ -0,0 +1 @@ +ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML) diff --git a/config/initializers/errors.rb b/config/initializers/errors.rb new file mode 100644 index 0000000..a31f281 --- /dev/null +++ b/config/initializers/errors.rb @@ -0,0 +1,34 @@ +require "net/http" +require "net/smtp" + +# Example: +# begin +# some http call +# rescue *HTTP_ERRORS => error +# notify_hoptoad error +# end + +HTTP_ERRORS = [ + EOFError, + Errno::ECONNRESET, + Errno::EINVAL, + Net::HTTPBadResponse, + Net::HTTPHeaderSyntaxError, + Net::ProtocolError, + Timeout::Error +].freeze + +SMTP_SERVER_ERRORS = [ + IOError, + Net::SMTPAuthenticationError, + Net::SMTPServerBusy, + Net::SMTPUnknownError, + TimeoutError +].freeze + +SMTP_CLIENT_ERRORS = [ + Net::SMTPFatalError, + Net::SMTPSyntaxError +].freeze + +SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) 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(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/config/initializers/json_encoding.rb b/config/initializers/json_encoding.rb new file mode 100644 index 0000000..292542f --- /dev/null +++ b/config/initializers/json_encoding.rb @@ -0,0 +1 @@ +ActiveSupport::JSON::Encoding.time_precision = 0 diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# 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 diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb new file mode 100644 index 0000000..6a94af4 --- /dev/null +++ b/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: "_tomatobot_session" diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb new file mode 100644 index 0000000..1d6ca2b --- /dev/null +++ b/config/initializers/simple_form.rb @@ -0,0 +1,165 @@ +# Use this setup block to configure all options available in SimpleForm. +SimpleForm.setup do |config| + # Wrappers are used by the form builder to generate a + # complete input. You can remove any component from the + # wrapper, change the order or even add your own to the + # stack. The options given below are used to wrap the + # whole input. + config.wrappers :default, class: :input, + hint_class: :field_with_hint, error_class: :field_with_errors do |b| + ## Extensions enabled by default + # Any of these extensions can be disabled for a + # given input by passing: `f.input EXTENSION_NAME => false`. + # You can make any of these extensions optional by + # renaming `b.use` to `b.optional`. + + # Determines whether to use HTML5 (:email, :url, ...) + # and required attributes + b.use :html5 + + # Calculates placeholders automatically from I18n + # You can also pass a string as f.input placeholder: "Placeholder" + b.use :placeholder + + ## Optional extensions + # They are disabled unless you pass `f.input EXTENSION_NAME => true` + # to the input. If so, they will retrieve the values from the model + # if any exists. If you want to enable any of those + # extensions by default, you can change `b.optional` to `b.use`. + + # Calculates maxlength from length validations for string inputs + b.optional :maxlength + + # Calculates pattern from format validations for string inputs + b.optional :pattern + + # Calculates min and max from length validations for numeric inputs + b.optional :min_max + + # Calculates readonly automatically from readonly attributes + b.optional :readonly + + ## Inputs + b.use :label_input + b.use :hint, wrap_with: { tag: :span, class: :hint } + b.use :error, wrap_with: { tag: :span, class: :error } + + ## full_messages_for + # If you want to display the full error message for the attribute, you can + # use the component :full_error, like: + # + # b.use :full_error, wrap_with: { tag: :span, class: :error } + end + + # The default wrapper to be used by the FormBuilder. + config.default_wrapper = :default + + # Define the way to render check boxes / radio buttons with labels. + # Defaults to :nested for bootstrap config. + # inline: input + label + # nested: label > input + config.boolean_style = :nested + + # Default class for buttons + config.button_class = "btn" + + # Method used to tidy up errors. Specify any Rails Array method. + # :first lists the first message for each field. + # Use :to_sentence to list all errors for each field. + # config.error_method = :first + + # Default tag used for error notification helper. + config.error_notification_tag = :div + + # CSS class to add for error notification helper. + config.error_notification_class = "error_notification" + + # ID to add for error notification helper. + # config.error_notification_id = nil + + # Series of attempts to detect a default label method for collection. + # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] + + # Series of attempts to detect a default value method for collection. + # config.collection_value_methods = [ :id, :to_s ] + + # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. + # config.collection_wrapper_tag = nil + + # You can define the class to use on all collection wrappers. Defaulting to none. + # config.collection_wrapper_class = nil + + # You can wrap each item in a collection of radio/check boxes with a tag, + # defaulting to :span. + # config.item_wrapper_tag = :span + + # You can define a class to use in all item wrappers. Defaulting to none. + # config.item_wrapper_class = nil + + # How the label text should be generated altogether with the required text. + # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" } + + # You can define the class to use on all labels. Default is nil. + # config.label_class = nil + + # You can define the default class to be used on forms. Can be overriden + # with `html: { :class }`. Defaulting to none. + # config.default_form_class = nil + + # You can define which elements should obtain additional classes + # config.generate_additional_classes_for = [:wrapper, :label, :input] + + # Whether attributes are required by default (or not). Default is true. + # config.required_by_default = true + + # Tell browsers whether to use the native HTML5 validations (novalidate form option). + # These validations are enabled in SimpleForm's internal config but disabled by default + # in this configuration, which is recommended due to some quirks from different browsers. + # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations, + # change this configuration to true. + config.browser_validations = false + + # Collection of methods to detect if a file type was given. + # config.file_methods = [ :mounted_as, :file?, :public_filename ] + + # Custom mappings for input types. This should be a hash containing a regexp + # to match as key, and the input type that will be used when the field name + # matches the regexp as value. + # config.input_mappings = { /count/ => :integer } + + # Custom wrappers for input types. This should be a hash containing an input + # type as key and the wrapper that will be used for all inputs with specified type. + # config.wrapper_mappings = { string: :prepend } + + # Namespaces where SimpleForm should look for custom input classes that + # override default inputs. + # config.custom_inputs_namespaces << "CustomInputs" + + # Default priority for time_zone inputs. + # config.time_zone_priority = nil + + # Default priority for country inputs. + # config.country_priority = nil + + # When false, do not use translations for labels. + # config.translate_labels = true + + # Automatically discover new inputs in Rails' autoload path. + # config.inputs_discovery = true + + # Cache SimpleForm inputs discovery + # config.cache_discovery = !Rails.env.development? + + # Default class for inputs + # config.input_class = nil + + # Define the default class of the input wrapper of the boolean input. + config.boolean_label_class = "checkbox" + + # Defines if the default input wrapper class should be included in radio + # collection wrappers. + # config.include_default_input_wrapper_class = true + + # Defines which i18n scope will be used in Simple Form. + # config.i18n_scope = 'simple_form' +end diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb new file mode 100644 index 0000000..91b890b --- /dev/null +++ b/config/initializers/simple_form_bootstrap.rb @@ -0,0 +1,149 @@ +# Use this setup block to configure all options available in SimpleForm. +SimpleForm.setup do |config| + config.error_notification_class = "alert alert-danger" + config.button_class = "btn btn-default" + config.boolean_label_class = nil + + config.wrappers :vertical_form, tag: "div", class: "form-group", error_class: "has-error" do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :pattern + b.optional :min_max + b.optional :readonly + b.use :label, class: "control-label" + + b.use :input, class: "form-control" + b.use :error, wrap_with: { tag: "span", class: "help-block" } + b.use :hint, wrap_with: { tag: "p", class: "help-block" } + end + + config.wrappers :vertical_file_input, tag: "div", class: "form-group", error_class: "has-error" do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :readonly + b.use :label, class: "control-label" + + b.use :input + b.use :error, wrap_with: { tag: "span", class: "help-block" } + b.use :hint, wrap_with: { tag: "p", class: "help-block" } + end + + config.wrappers :vertical_boolean, tag: "div", class: "form-group", error_class: "has-error" do |b| + b.use :html5 + b.optional :readonly + + b.wrapper tag: "div", class: "checkbox" do |ba| + ba.use :label_input + end + + b.use :error, wrap_with: { tag: "span", class: "help-block" } + b.use :hint, wrap_with: { tag: "p", class: "help-block" } + end + + config.wrappers :vertical_radio_and_checkboxes, tag: "div", class: "form-group", error_class: "has-error" do |b| + b.use :html5 + b.optional :readonly + b.use :label, class: "control-label" + b.use :input + b.use :error, wrap_with: { tag: "span", class: "help-block" } + b.use :hint, wrap_with: { tag: "p", class: "help-block" } + end + + config.wrappers :horizontal_form, tag: "div", class: "form-group", error_class: "has-error" do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :pattern + b.optional :min_max + b.optional :readonly + b.use :label, class: "col-sm-3 control-label" + + b.wrapper tag: "div", class: "col-sm-9" do |ba| + ba.use :input, class: "form-control" + ba.use :error, wrap_with: { tag: "span", class: "help-block" } + ba.use :hint, wrap_with: { tag: "p", class: "help-block" } + end + end + + config.wrappers :horizontal_file_input, tag: "div", class: "form-group", error_class: "has-error" do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :readonly + b.use :label, class: "col-sm-3 control-label" + + b.wrapper tag: "div", class: "col-sm-9" do |ba| + ba.use :input + ba.use :error, wrap_with: { tag: "span", class: "help-block" } + ba.use :hint, wrap_with: { tag: "p", class: "help-block" } + end + end + + config.wrappers :horizontal_boolean, tag: "div", class: "form-group", error_class: "has-error" do |b| + b.use :html5 + b.optional :readonly + + b.wrapper tag: "div", class: "col-sm-offset-3 col-sm-9" do |wr| + wr.wrapper tag: "div", class: "checkbox" do |ba| + ba.use :label_input + end + + wr.use :error, wrap_with: { tag: "span", class: "help-block" } + wr.use :hint, wrap_with: { tag: "p", class: "help-block" } + end + end + + config.wrappers :horizontal_radio_and_checkboxes, tag: "div", class: "form-group", error_class: "has-error" do |b| + b.use :html5 + b.optional :readonly + + b.use :label, class: "col-sm-3 control-label" + + b.wrapper tag: "div", class: "col-sm-9" do |ba| + ba.use :input + ba.use :error, wrap_with: { tag: "span", class: "help-block" } + ba.use :hint, wrap_with: { tag: "p", class: "help-block" } + end + end + + config.wrappers :inline_form, tag: "div", class: "form-group", error_class: "has-error" do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :pattern + b.optional :min_max + b.optional :readonly + b.use :label, class: "sr-only" + + b.use :input, class: "form-control" + b.use :error, wrap_with: { tag: "span", class: "help-block" } + b.use :hint, wrap_with: { tag: "p", class: "help-block" } + end + + config.wrappers :multi_select, tag: "div", class: "form-group", error_class: "has-error" do |b| + b.use :html5 + b.optional :readonly + b.use :label, class: "control-label" + b.wrapper tag: "div", class: "form-inline" do |ba| + ba.use :input, class: "form-control" + ba.use :error, wrap_with: { tag: "span", class: "help-block" } + ba.use :hint, wrap_with: { tag: "p", class: "help-block" } + end + end + # Wrappers for forms and inputs using the Bootstrap toolkit. + # Check the Bootstrap docs (http://getbootstrap.com) + # to learn about the different styles for forms and inputs, + # buttons and other elements. + config.default_wrapper = :vertical_form + config.wrapper_mappings = { + check_boxes: :vertical_radio_and_checkboxes, + radio_buttons: :vertical_radio_and_checkboxes, + file: :vertical_file_input, + boolean: :vertical_boolean, + datetime: :multi_select, + date: :multi_select, + time: :multi_select + } +end diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..33725e9 --- /dev/null +++ b/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# 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] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..8c3aa9e --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,19 @@ +en: + date: + formats: + default: + "%m/%d/%Y" + with_weekday: + "%a %m/%d/%y" + + time: + formats: + default: + "%a, %b %-d, %Y at %r" + date: + "%b %-d, %Y" + short: + "%B %d" + + titles: + application: Tomatobot diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml new file mode 100644 index 0000000..2374383 --- /dev/null +++ b/config/locales/simple_form.en.yml @@ -0,0 +1,31 @@ +en: + simple_form: + "yes": 'Yes' + "no": 'No' + required: + text: 'required' + mark: '*' + # You can uncomment the line below if you need to overwrite the whole required html. + # When using html, text and mark won't be used. + # html: '*' + error_notification: + default_message: "Please review the problems below:" + # Examples + # labels: + # defaults: + # password: 'Password' + # user: + # new: + # email: 'E-mail to sign in.' + # edit: + # email: 'E-mail.' + # hints: + # defaults: + # username: 'User name to sign in.' + # password: 'No special characters, please.' + # include_blanks: + # defaults: + # age: 'Rather not say' + # prompts: + # defaults: + # age: 'Select your age' diff --git a/config/newrelic.yml b/config/newrelic.yml new file mode 100644 index 0000000..b461d94 --- /dev/null +++ b/config/newrelic.yml @@ -0,0 +1,34 @@ +common: &default_settings + app_name: "tomatobot" + audit_log: + enabled: false + browser_monitoring: + auto_instrument: true + capture_params: false + developer_mode: false + error_collector: + capture_source: true + enabled: true + ignore_errors: "ActionController::RoutingError,Sinatra::NotFound" + license_key: "<%= ENV["NEW_RELIC_LICENSE_KEY"] %>" + log_level: info + monitor_mode: true + transaction_tracer: + enabled: true + record_sql: obfuscated + stack_trace_threshold: 0.500 + transaction_threshold: apdex_f +development: + <<: *default_settings + monitor_mode: false + developer_mode: true +test: + <<: *default_settings + monitor_mode: false +production: + <<: *default_settings + monitor_mode: true +staging: + <<: *default_settings + app_name: "tomatobot (Staging)" + monitor_mode: true diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..e64a0c7 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,28 @@ +# https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server + +# The environment variable WEB_CONCURRENCY may be set to a default value based +# on dyno size. To manually configure this value use heroku config:set +# WEB_CONCURRENCY. +# +# Increasing the number of workers will increase the amount of resting memory +# your dynos use. Increasing the number of threads will increase the amount of +# potential bloat added to your dynos when they are responding to heavy +# requests. +# +# Starting with a low number of workers and threads provides adequate +# performance for most applications, even under load, while maintaining a low +# risk of overusing memory. +workers Integer(ENV.fetch("WEB_CONCURRENCY", 2)) +threads_count = Integer(ENV.fetch("MAX_THREADS", 2)) +threads(threads_count, threads_count) + +preload_app! + +rackup DefaultRackup +environment ENV.fetch("RACK_ENV", "development") + +on_worker_boot do + # Worker specific setup for Rails 4.1+ + # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot + ActiveRecord::Base.establish_connection +end diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..1daf9a4 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,2 @@ +Rails.application.routes.draw do +end diff --git a/config/smtp.rb b/config/smtp.rb new file mode 100644 index 0000000..750ed7f --- /dev/null +++ b/config/smtp.rb @@ -0,0 +1,9 @@ +SMTP_SETTINGS = { + address: ENV.fetch("SMTP_ADDRESS"), # example: "smtp.sendgrid.net" + authentication: :plain, + domain: ENV.fetch("SMTP_DOMAIN"), # example: "heroku.com" + enable_starttls_auto: true, + password: ENV.fetch("SMTP_PASSWORD"), + port: "587", + user_name: ENV.fetch("SMTP_USERNAME") +}.freeze diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..734b510 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,18 @@ +# 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: 0) do + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + enable_extension "hstore" +end diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000..4edb1e8 --- /dev/null +++ b/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: 'Emanuel', city: cities.first) diff --git a/lib/assets/.keep b/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/lib/tasks/bundler_audit.rake b/lib/tasks/bundler_audit.rake new file mode 100644 index 0000000..00c1263 --- /dev/null +++ b/lib/tasks/bundler_audit.rake @@ -0,0 +1,12 @@ +if Rails.env.development? || Rails.env.test? + require "bundler/audit/cli" + + namespace :bundler do + desc "Updates the ruby-advisory-db and runs audit" + task :audit do + %w(update check).each do |command| + Bundler::Audit::CLI.start [command] + end + end + end +end diff --git a/lib/tasks/dev.rake b/lib/tasks/dev.rake new file mode 100644 index 0000000..88efda5 --- /dev/null +++ b/lib/tasks/dev.rake @@ -0,0 +1,12 @@ +if Rails.env.development? || Rails.env.test? + require "factory_girl" + + namespace :dev do + desc "Sample data for local development environment" + task prime: "db:setup" do + include FactoryGirl::Syntax::Methods + + # create(:user, email: "user@example.com", password: "password") + end + end +end diff --git a/lib/templates/erb/scaffold/_form.html.erb b/lib/templates/erb/scaffold/_form.html.erb new file mode 100644 index 0000000..201a069 --- /dev/null +++ b/lib/templates/erb/scaffold/_form.html.erb @@ -0,0 +1,13 @@ +<%%= simple_form_for(@<%= singular_table_name %>) do |f| %> + <%%= f.error_notification %> + +
+ <%- attributes.each do |attribute| -%> + <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %> + <%- end -%> +
+ +
+ <%%= f.button :submit %> +
+<%% end %> diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..7b93ab6 --- /dev/null +++ b/public/404.html @@ -0,0 +1,69 @@ + + + + + + + The page you were looking for doesn't exist (404) + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/public/422.html b/public/422.html new file mode 100644 index 0000000..db2ff83 --- /dev/null +++ b/public/422.html @@ -0,0 +1,69 @@ + + + + + + + The change you wanted was rejected (422) + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/public/500.html b/public/500.html new file mode 100644 index 0000000..e93b854 --- /dev/null +++ b/public/500.html @@ -0,0 +1,68 @@ + + + + + + + We're sorry, but something went wrong (500) + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..3c9c7c0 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,5 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-agent: * +# Disallow: / diff --git a/spec/controllers/.keep b/spec/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/factories.rb b/spec/factories.rb new file mode 100644 index 0000000..1c9bf2b --- /dev/null +++ b/spec/factories.rb @@ -0,0 +1,2 @@ +FactoryGirl.define do +end diff --git a/spec/features/.keep b/spec/features/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/helpers/.keep b/spec/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb new file mode 100644 index 0000000..9b2bd32 --- /dev/null +++ b/spec/i18n_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true +require "i18n/tasks" + +RSpec.describe "I18n" do + let(:i18n) { I18n::Tasks::BaseTask.new } + let(:missing_keys) { i18n.missing_keys } + let(:unused_keys) { i18n.unused_keys } + + it "does not have missing keys" do + expect(missing_keys).to be_empty, + "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them" + end +end diff --git a/spec/lib/.keep b/spec/lib/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb new file mode 100644 index 0000000..d621105 --- /dev/null +++ b/spec/rails_helper.rb @@ -0,0 +1,26 @@ +ENV["RAILS_ENV"] = "test" + +require File.expand_path("../../config/environment", __FILE__) +abort("DATABASE_URL environment variable is set") if ENV["DATABASE_URL"] + +require "rspec/rails" + +Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |file| require file } + +module Features + # Extend this module in spec/support/features/*.rb + include Formulaic::Dsl +end + +RSpec.configure do |config| + config.before(:each, js: true) do + page.driver.block_unknown_urls + end + config.include Features, type: :feature + config.infer_base_class_for_anonymous_controllers = false + config.infer_spec_type_from_file_location! + config.use_transactional_fixtures = false +end + +ActiveRecord::Migration.maintain_test_schema! +Capybara.javascript_driver = :webkit diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..a48a89d --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,23 @@ +if ENV.fetch("COVERAGE", false) + require "simplecov" + SimpleCov.start "rails" +end + +require "webmock/rspec" + +# http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + config.expect_with :rspec do |expectations| + expectations.syntax = :expect + end + + config.mock_with :rspec do |mocks| + mocks.syntax = :expect + mocks.verify_partial_doubles = true + end + + config.example_status_persistence_file_path = "tmp/rspec_examples.txt" + config.order = :random +end + +WebMock.disable_net_connect!(allow_localhost: true) diff --git a/spec/support/action_mailer.rb b/spec/support/action_mailer.rb new file mode 100644 index 0000000..b9563a3 --- /dev/null +++ b/spec/support/action_mailer.rb @@ -0,0 +1,5 @@ +RSpec.configure do |config| + config.before(:each) do + ActionMailer::Base.deliveries.clear + end +end diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb new file mode 100644 index 0000000..36dcc88 --- /dev/null +++ b/spec/support/database_cleaner.rb @@ -0,0 +1,21 @@ +RSpec.configure do |config| + config.before(:suite) do + DatabaseCleaner.clean_with(:deletion) + end + + config.before(:each) do + DatabaseCleaner.strategy = :transaction + end + + config.before(:each, js: true) do + DatabaseCleaner.strategy = :deletion + end + + config.before(:each) do + DatabaseCleaner.start + end + + config.after(:each) do + DatabaseCleaner.clean + end +end diff --git a/spec/support/factory_girl.rb b/spec/support/factory_girl.rb new file mode 100644 index 0000000..eec437f --- /dev/null +++ b/spec/support/factory_girl.rb @@ -0,0 +1,3 @@ +RSpec.configure do |config| + config.include FactoryGirl::Syntax::Methods +end diff --git a/spec/support/features/.keep b/spec/support/features/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/support/i18n.rb b/spec/support/i18n.rb new file mode 100644 index 0000000..3d4094d --- /dev/null +++ b/spec/support/i18n.rb @@ -0,0 +1,3 @@ +RSpec.configure do |config| + config.include AbstractController::Translation +end diff --git a/spec/support/matchers/.keep b/spec/support/matchers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/support/mixins/.keep b/spec/support/mixins/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/support/shared_examples/.keep b/spec/support/shared_examples/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/support/shoulda_matchers.rb b/spec/support/shoulda_matchers.rb new file mode 100644 index 0000000..7d045f3 --- /dev/null +++ b/spec/support/shoulda_matchers.rb @@ -0,0 +1,6 @@ +Shoulda::Matchers.configure do |config| + config.integrate do |with| + with.test_framework :rspec + with.library :rails + end +end diff --git a/vendor/assets/javascripts/.keep b/vendor/assets/javascripts/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/assets/stylesheets/.keep b/vendor/assets/stylesheets/.keep new file mode 100644 index 0000000..e69de29