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/.env b/.env new file mode 100644 index 0000000..b8e8965 --- /dev/null +++ b/.env @@ -0,0 +1,13 @@ +# https://github.com/ddollar/forego +ASSET_HOST=localhost:3000 +APPLICATION_HOST=localhost:3000 +PORT=3000 +RACK_ENV=development +RACK_MINI_PROFILER=0 +SECRET_KEY_BASE=development_secret +EXECJS_RUNTIME=Node +SMTP_ADDRESS=smtp.example.com +SMTP_DOMAIN=example.com +SMTP_PASSWORD=password +SMTP_USERNAME=username +WEB_CONCURRENCY=1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5bd137a --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +!.keep +*.DS_Store +*.swo +*.swp +/.bundle +/.env.local +/coverage/* +/db/*.sqlite3 +/log/* +/public/system +/public/assets +/tags +/tmp/* diff --git a/.hound.yml b/.hound.yml new file mode 100644 index 0000000..9ccdcda --- /dev/null +++ b/.hound.yml @@ -0,0 +1,14 @@ +# See https://houndci.com/configuration for help. +haml: + # config_file: .haml-style.yml + enabled: true +javascript: + # config_file: .javascript-style.json + enabled: true + # ignore_file: .javascript_ignore +ruby: + # config_file: .ruby-style.yml + enabled: true +scss: + # config_file: .scss-style.yml + enabled: true diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..83e16f8 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..2bf1c1c --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.3.1 diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..dd38968 --- /dev/null +++ b/Gemfile @@ -0,0 +1,66 @@ +source "https://rubygems.org" + +ruby "2.3.1" + +gem "autoprefixer-rails" +gem "delayed_job_active_record" +gem "flutie" +gem "honeybadger" +gem "jquery-rails" +gem "normalize-rails", "~> 3.0.0" +gem "pg" +gem "puma" +gem "rack-canonical-host" +gem "rails", "~> 5.0.0" +gem "recipient_interceptor" +gem "sass-rails", "~> 5.0" +gem "simple_form" +gem "skylight" +gem "sprockets", ">= 3.0.0" +gem "sprockets-es6" +gem "suspenders" +gem "title" +gem "uglifier" + +group :development do + gem "listen" + gem "spring" + gem "spring-commands-rspec" + gem "web-console" +end + +group :development, :test do + gem "awesome_print" + gem "bullet" + gem "bundler-audit", ">= 0.5.0", require: false + gem "dotenv-rails" + gem "factory_girl_rails" + gem "pry-byebug" + gem "pry-rails" + gem "rspec-rails", "~> 3.5.0.beta4" +end + +group :development, :staging do + gem "rack-mini-profiler", require: false +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 "rack-timeout" + gem "rails_stdout_logging" +end + +gem 'high_voltage' +gem 'bourbon', '5.0.0.beta.6' +gem 'neat', '~> 1.8.0' +gem 'refills', group: [:development, :test] \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..6cb9eac --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,331 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.0.0.1) + actionpack (= 5.0.0.1) + nio4r (~> 1.2) + websocket-driver (~> 0.6.1) + actionmailer (5.0.0.1) + actionpack (= 5.0.0.1) + actionview (= 5.0.0.1) + activejob (= 5.0.0.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.0.0.1) + actionview (= 5.0.0.1) + activesupport (= 5.0.0.1) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.0.0.1) + activesupport (= 5.0.0.1) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (5.0.0.1) + activesupport (= 5.0.0.1) + globalid (>= 0.3.6) + activemodel (5.0.0.1) + activesupport (= 5.0.0.1) + activerecord (5.0.0.1) + activemodel (= 5.0.0.1) + activesupport (= 5.0.0.1) + arel (~> 7.0) + activesupport (5.0.0.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.4.0) + arel (7.1.1) + autoprefixer-rails (6.4.1) + execjs + awesome_print (1.7.0) + babel-source (5.8.35) + babel-transpiler (0.7.0) + babel-source (>= 4.0, < 6) + execjs (~> 2.0) + bitters (1.4.0) + bourbon (>= 5.0.0.beta.6) + sass (~> 3.4) + thor (~> 0.19) + bourbon (5.0.0.beta.6) + sass (~> 3.4.22) + thor (~> 0.19.1) + builder (3.2.2) + bullet (5.3.0) + activesupport (>= 3.0.0) + uniform_notifier (~> 1.10.0) + bundler-audit (0.5.0) + bundler (~> 1.2) + thor (~> 0.18) + byebug (9.0.5) + capybara (2.7.1) + addressable + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) + capybara-webkit (1.11.1) + capybara (>= 2.3.0, < 2.8.0) + json + coderay (1.1.1) + concurrent-ruby (1.0.2) + crack (0.4.3) + safe_yaml (~> 1.0.0) + database_cleaner (1.5.3) + debug_inspector (0.0.2) + delayed_job (4.1.2) + activesupport (>= 3.0, < 5.1) + delayed_job_active_record (4.1.1) + activerecord (>= 3.0, < 5.1) + delayed_job (>= 3.0, < 5) + diff-lcs (1.2.5) + docile (1.1.5) + dotenv (2.1.1) + dotenv-rails (2.1.1) + dotenv (= 2.1.1) + railties (>= 4.0, < 5.1) + erubis (2.7.0) + execjs (2.7.0) + factory_girl (4.7.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.7.0) + factory_girl (~> 4.7.0) + railties (>= 3.0.0) + ffi (1.9.14) + flutie (2.0.0) + formulaic (0.3.0) + activesupport + capybara + i18n + globalid (0.3.7) + activesupport (>= 4.1.0) + hashdiff (0.3.0) + high_voltage (2.4.0) + honeybadger (2.6.1) + i18n (0.7.0) + jquery-rails (4.2.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (2.0.2) + launchy (2.4.3) + addressable (~> 2.3) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.4) + mime-types (>= 1.16, < 4) + method_source (0.8.2) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.1.0) + minitest (5.9.0) + neat (1.8.0) + sass (>= 3.3) + thor (~> 0.19) + nio4r (1.2.1) + nokogiri (1.6.8) + mini_portile2 (~> 2.1.0) + pkg-config (~> 1.1.7) + normalize-rails (3.0.3) + pg (0.18.4) + pkg-config (1.1.7) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-byebug (3.4.0) + byebug (~> 9.0) + pry (~> 0.10) + pry-rails (0.3.4) + pry (>= 0.9.10) + puma (3.6.0) + rack (2.0.1) + rack-canonical-host (0.2.2) + addressable (> 0, < 3) + rack (>= 1.0.0, < 3) + rack-mini-profiler (0.10.1) + rack (>= 1.2.0) + rack-test (0.6.3) + rack (>= 1.0) + rack-timeout (0.4.2) + rails (5.0.0.1) + actioncable (= 5.0.0.1) + actionmailer (= 5.0.0.1) + actionpack (= 5.0.0.1) + actionview (= 5.0.0.1) + activejob (= 5.0.0.1) + activemodel (= 5.0.0.1) + activerecord (= 5.0.0.1) + activesupport (= 5.0.0.1) + bundler (>= 1.3.0, < 2.0) + railties (= 5.0.0.1) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.1) + activesupport (>= 4.2.0, < 6.0) + nokogiri (~> 1.6.0) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + rails_stdout_logging (0.0.5) + railties (5.0.0.1) + actionpack (= 5.0.0.1) + activesupport (= 5.0.0.1) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (11.2.2) + rb-fsevent (0.9.7) + rb-inotify (0.9.7) + ffi (>= 0.5.0) + recipient_interceptor (0.1.2) + mail + refills (0.2.0) + rspec-core (3.5.3) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + ruby_dep (1.4.0) + safe_yaml (1.0.4) + sass (3.4.22) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) + 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) + simple_form (3.3.1) + actionpack (> 4, < 5.1) + activemodel (> 4, < 5.1) + simplecov (0.12.0) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) + skylight (0.10.6) + activesupport (>= 3.0.0) + slop (3.6.0) + spring (1.7.2) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + sprockets (3.7.0) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-es6 (0.9.1) + babel-source (>= 5.8.11) + babel-transpiler + sprockets (>= 3.0.0) + sprockets-rails (3.2.0) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + suspenders (1.42.0) + bitters (~> 1.3) + bundler (~> 1.3) + rails (~> 5.0.0) + thor (0.19.1) + thread_safe (0.3.5) + tilt (2.0.5) + timecop (0.8.1) + title (0.0.7) + i18n + rails (>= 3.1) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (3.0.2) + execjs (>= 0.3.0, < 3) + uniform_notifier (1.10.0) + web-console (3.3.1) + actionview (>= 5.0) + activemodel (>= 5.0) + debug_inspector + railties (>= 5.0) + webmock (2.1.0) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff + websocket-driver (0.6.4) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) + xpath (2.0.0) + nokogiri (~> 1.3) + +PLATFORMS + ruby + +DEPENDENCIES + autoprefixer-rails + awesome_print + bourbon (= 5.0.0.beta.6) + bullet + bundler-audit (>= 0.5.0) + capybara-webkit + database_cleaner + delayed_job_active_record + dotenv-rails + factory_girl_rails + flutie + formulaic + high_voltage + honeybadger + jquery-rails + launchy + listen + neat (~> 1.8.0) + normalize-rails (~> 3.0.0) + pg + pry-byebug + pry-rails + puma + rack-canonical-host + rack-mini-profiler + rack-timeout + rails (~> 5.0.0) + rails_stdout_logging + recipient_interceptor + refills + rspec-rails (~> 3.5.0.beta4) + sass-rails (~> 5.0) + shoulda-matchers + simple_form + simplecov + skylight + spring + spring-commands-rspec + sprockets (>= 3.0.0) + sprockets-es6 + suspenders + timecop + title + uglifier + web-console + webmock + +RUBY VERSION + ruby 2.3.1p112 + +BUNDLED WITH + 1.12.5 diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..62075a0 --- /dev/null +++ b/Procfile @@ -0,0 +1,2 @@ +web: bundle exec puma -p $PORT -C ./config/puma.rb +worker: bundle exec rake jobs:work diff --git a/README.md b/README.md new file mode 100644 index 0000000..224159e --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# Pass + +## 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 [Heroku Local]: + + % heroku local + +[Heroku Local]: https://devcenter.heroku.com/articles/heroku-local + +## 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..4f677c0 --- /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_relative 'config/application' + +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.json b/app.json new file mode 100644 index 0000000..70fa2a0 --- /dev/null +++ b/app.json @@ -0,0 +1,39 @@ +{ + "name":"pass", + "scripts":{}, + "env":{ + "APPLICATION_HOST":{ + "required":true + }, + "EMAIL_RECIPIENTS":{ + "required":true + }, + "HEROKU_APP_NAME": { + "required":true + }, + "HEROKU_PARENT_APP_NAME": { + "required":true + }, + "RACK_ENV":{ + "required":true + }, + "SECRET_KEY_BASE":{ + "generator":"secret" + }, + "SMTP_ADDRESS":{ + "required":true + }, + "SMTP_DOMAIN":{ + "required":true + }, + "SMTP_PASSWORD":{ + "required":true + }, + "SMTP_USERNAME":{ + "required":true + } + }, + "addons":[ + "heroku-postgresql" + ] +} diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000..b16e53d --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link_directory ../javascripts .js +//= link_directory ../stylesheets .css 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..71a5afb --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// 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. JavaScript code in this file should be added after the last require_* statement. +// +// 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/javascripts/cable.js b/app/assets/javascripts/cable.js new file mode 100644 index 0000000..71ee1e6 --- /dev/null +++ b/app/assets/javascripts/cable.js @@ -0,0 +1,13 @@ +// Action Cable provides the framework to deal with WebSockets in Rails. +// You can generate new channels where WebSocket features live using the rails generate channel command. +// +//= require action_cable +//= require_self +//= require_tree ./channels + +(function() { + this.App || (this.App = {}); + + App.cable = ActionCable.createConsumer(); + +}).call(this); diff --git a/app/assets/javascripts/channels/.keep b/app/assets/javascripts/channels/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss new file mode 100644 index 0000000..53a8c66 --- /dev/null +++ b/app/assets/stylesheets/application.scss @@ -0,0 +1,9 @@ +@charset "utf-8"; + +@import "normalize-rails"; + +@import "bourbon"; +@import "neat"; + +@import "base/base"; +@import "refills/flashes"; diff --git a/app/assets/stylesheets/base/_base.scss b/app/assets/stylesheets/base/_base.scss new file mode 100644 index 0000000..28e0cc3 --- /dev/null +++ b/app/assets/stylesheets/base/_base.scss @@ -0,0 +1,14 @@ +// Bitters 1.4.0 +// http://bitters.bourbon.io +// Copyright 2013-2015 thoughtbot, inc. +// MIT License + +@import "variables"; + +@import "buttons"; +@import "forms"; +@import "layout"; +@import "lists"; +@import "media"; +@import "tables"; +@import "typography"; diff --git a/app/assets/stylesheets/base/_buttons.scss b/app/assets/stylesheets/base/_buttons.scss new file mode 100644 index 0000000..a3d967b --- /dev/null +++ b/app/assets/stylesheets/base/_buttons.scss @@ -0,0 +1,36 @@ +#{$all-buttons} { + appearance: none; + background-color: $action-color; + border: 0; + border-radius: $base-border-radius; + color: #fff; + cursor: pointer; + display: inline-block; + font-family: $base-font-family; + font-size: $base-font-size; + -webkit-font-smoothing: antialiased; + font-weight: 600; + line-height: 1; + padding: $small-spacing $base-spacing; + text-align: center; + text-decoration: none; + transition: background-color $base-duration $base-timing; + user-select: none; + vertical-align: middle; + white-space: nowrap; + + &:hover, + &:focus { + background-color: shade($action-color, 20%); + color: #fff; + } + + &:disabled { + cursor: not-allowed; + opacity: 0.5; + + &:hover { + background-color: $action-color; + } + } +} diff --git a/app/assets/stylesheets/base/_forms.scss b/app/assets/stylesheets/base/_forms.scss new file mode 100644 index 0000000..a50f6a6 --- /dev/null +++ b/app/assets/stylesheets/base/_forms.scss @@ -0,0 +1,82 @@ +fieldset { + background-color: transparent; + border: 0; + margin: 0; + padding: 0; +} + +legend { + font-weight: 600; + margin-bottom: $small-spacing / 2; + padding: 0; +} + +label { + display: block; + font-weight: 600; + margin-bottom: $small-spacing / 2; +} + +input, +select, +textarea { + display: block; + font-family: $base-font-family; + font-size: $base-font-size; +} + +#{$all-text-inputs} { + appearance: none; + background-color: $base-background-color; + border: $base-border; + border-radius: $base-border-radius; + box-shadow: $form-box-shadow; + box-sizing: border-box; + margin-bottom: $small-spacing; + padding: $base-spacing / 3; + transition: border-color $base-duration $base-timing; + width: 100%; + + &:hover { + border-color: shade($base-border-color, 20%); + } + + &:focus { + border-color: $action-color; + box-shadow: $form-box-shadow-focus; + outline: none; + } + + &:disabled { + background-color: shade($base-background-color, 5%); + cursor: not-allowed; + + &:hover { + border: $base-border; + } + } + + &::placeholder { + color: tint($base-font-color, 40%); + } +} + +textarea { + resize: vertical; +} + +[type="checkbox"], +[type="radio"] { + display: inline; + margin-right: $small-spacing / 2; +} + +[type="file"] { + margin-bottom: $small-spacing; + width: 100%; +} + +select { + margin-bottom: $small-spacing; + width: 100%; +} diff --git a/app/assets/stylesheets/base/_layout.scss b/app/assets/stylesheets/base/_layout.scss new file mode 100644 index 0000000..8f2913f --- /dev/null +++ b/app/assets/stylesheets/base/_layout.scss @@ -0,0 +1,14 @@ +html { + box-sizing: border-box; +} + +*, +*::before, +*::after { + box-sizing: inherit; +} + +html, +body { + height: 100%; +} diff --git a/app/assets/stylesheets/base/_lists.scss b/app/assets/stylesheets/base/_lists.scss new file mode 100644 index 0000000..06a7c0a --- /dev/null +++ b/app/assets/stylesheets/base/_lists.scss @@ -0,0 +1,19 @@ +ul, +ol { + list-style-type: none; + margin: 0; + padding: 0; +} + +dl { + margin: 0; +} + +dt { + font-weight: 600; + margin: 0; +} + +dd { + margin: 0; +} diff --git a/app/assets/stylesheets/base/_media.scss b/app/assets/stylesheets/base/_media.scss new file mode 100644 index 0000000..dfa22ea --- /dev/null +++ b/app/assets/stylesheets/base/_media.scss @@ -0,0 +1,9 @@ +figure { + margin: 0; +} + +img, +picture { + margin: 0; + max-width: 100%; +} diff --git a/app/assets/stylesheets/base/_tables.scss b/app/assets/stylesheets/base/_tables.scss new file mode 100644 index 0000000..9863984 --- /dev/null +++ b/app/assets/stylesheets/base/_tables.scss @@ -0,0 +1,24 @@ +table { + border-collapse: collapse; + margin: $small-spacing 0; + table-layout: fixed; + width: 100%; +} + +th { + border-bottom: 1px solid shade($base-border-color, 25%); + font-weight: 600; + padding: $small-spacing 0; + text-align: left; +} + +td { + border-bottom: $base-border; + padding: $small-spacing 0; +} + +tr, +td, +th { + vertical-align: middle; +} diff --git a/app/assets/stylesheets/base/_typography.scss b/app/assets/stylesheets/base/_typography.scss new file mode 100644 index 0000000..50df5c0 --- /dev/null +++ b/app/assets/stylesheets/base/_typography.scss @@ -0,0 +1,42 @@ +body { + color: $base-font-color; + font-family: $base-font-family; + font-size: $base-font-size; + line-height: $base-line-height; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: $heading-font-family; + font-size: modular-scale(1); + line-height: $heading-line-height; + margin: 0 0 $small-spacing; +} + +p { + margin: 0 0 $small-spacing; +} + +a { + color: $action-color; + text-decoration: none; + transition: color $base-duration $base-timing; + + &:active, + &:focus, + &:hover { + color: shade($action-color, 25%); + } +} + +hr { + border-bottom: $base-border; + border-left: 0; + border-right: 0; + border-top: 0; + margin: $base-spacing 0; +} diff --git a/app/assets/stylesheets/base/_variables.scss b/app/assets/stylesheets/base/_variables.scss new file mode 100644 index 0000000..d40f9ec --- /dev/null +++ b/app/assets/stylesheets/base/_variables.scss @@ -0,0 +1,46 @@ +// Breakpoints +$medium-screen: 600px; +$large-screen: 900px; + +// Typography +$base-font-family: $font-stack-system; +$heading-font-family: $base-font-family; + +// Font Sizes +$base-font-size: 1em; + +// Line height +$base-line-height: 1.5; +$heading-line-height: 1.2; + +// Other Sizes +$base-border-radius: 3px; +$base-spacing: $base-line-height * 1em; +$small-spacing: $base-spacing / 2; +$base-z-index: 0; + +// Colors +$blue: #1565c0; +$dark-gray: #333; +$medium-gray: #999; +$light-gray: #ddd; + +// Font Colors +$base-font-color: $dark-gray; +$action-color: $blue; + +// Border +$base-border-color: $light-gray; +$base-border: 1px solid $base-border-color; + +// Background Colors +$base-background-color: #fff; +$secondary-background-color: tint($base-border-color, 75%); + +// Forms +$form-box-shadow: inset 0 1px 3px rgba(#000, 0.06); +$form-box-shadow-focus: $form-box-shadow, 0 0 5px adjust-color($action-color, $lightness: -5%, $alpha: -0.3); + +// Animations +$base-duration: 150ms; +$base-timing: ease; diff --git a/app/assets/stylesheets/refills/_flashes.scss b/app/assets/stylesheets/refills/_flashes.scss new file mode 100644 index 0000000..af9fe8b --- /dev/null +++ b/app/assets/stylesheets/refills/_flashes.scss @@ -0,0 +1,28 @@ +$base-spacing: 1.5em !default; +$flashes: ( + "alert": #fff6bf, + "error": #fbe3e4, + "notice": #e5edf8, + "success": #e6efc2, +) !default; + +@each $flash-type, $color in $flashes { + .flash-#{$flash-type} { + background-color: $color; + color: shade($color, 60%); + display: block; + margin-bottom: $base-spacing / 2; + padding: $base-spacing / 2; + text-align: center; + + a { + color: shade($color, 70%); + text-decoration: underline; + + &:focus, + &:hover { + color: shade($color, 90%); + } + } + } +} diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..d672697 --- /dev/null +++ b/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..0ff5442 --- /dev/null +++ b/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..1c07694 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + 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/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000..a009ace --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 0000000..286b223 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000..10a4cba --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end 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/_css_overrides.html.erb b/app/views/application/_css_overrides.html.erb new file mode 100644 index 0000000..1d7edcb --- /dev/null +++ b/app/views/application/_css_overrides.html.erb @@ -0,0 +1,7 @@ +<% if Rails.env.test? %> + +<% 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..3056ea8 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,22 @@ + + + + + + + <%# + Configure default and controller-, and view-specific titles in + config/locales/en.yml. For more see: + https://github.com/calebthompson/title#usage + %> + <%= title %> + <%= stylesheet_link_tag :application, media: "all" %> + <%= csrf_meta_tags %> + + + <%= render "flashes" -%> + <%= yield %> + <%= render "javascript" %> + <%= render "css_overrides" %> + + diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..cbd34d2 --- /dev/null +++ b/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> 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..66e9889 --- /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/delayed_job b/bin/delayed_job new file mode 100755 index 0000000..edf1959 --- /dev/null +++ b/bin/delayed_job @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby + +require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) +require 'delayed/command' +Delayed::Command.new(ARGV).daemonize diff --git a/bin/deploy b/bin/deploy new file mode 100755 index 0000000..a48a4c1 --- /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 --exit-code --remote "$target" +heroku restart --remote "$target" diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..5badb2f --- /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', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /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..6e67092 --- /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..a114898 --- /dev/null +++ b/bin/setup @@ -0,0 +1,21 @@ +#!/bin/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 database and add any development seed data +bin/rake dev:prime + +# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv +mkdir -p .git/safe + +# Only if this isn't CI +# if [ -z "$CI" ]; then +# fi diff --git a/bin/setup_review_app b/bin/setup_review_app new file mode 100755 index 0000000..c49f5d4 --- /dev/null +++ b/bin/setup_review_app @@ -0,0 +1,19 @@ +#!/bin/sh + +# Run this script to set up a review app's database and worker dyno + +set -e + +if [ -z "$1" ]; then + printf "You must provide a review app (same as the pull request) id.\n" + exit 64 +fi + +heroku pg:backups restore \ + `heroku pg:backups public-url -a pass-staging` \ + DATABASE_URL \ + --confirm pass-staging-pr-$1 \ + --app pass-staging-pr-$1 +heroku run rake db:migrate --exit-code --app pass-staging-pr-$1 +heroku ps:scale worker=1 --app pass-staging-pr-$1 +heroku restart --app pass-staging-pr-$1 diff --git a/bin/spring b/bin/spring new file mode 100755 index 0000000..7fe232c --- /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/bin/update b/bin/update new file mode 100755 index 0000000..a8e4462 --- /dev/null +++ b/bin/update @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + puts "\n== Updating database ==" + system! 'bin/rails db:migrate' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/browserslist b/browserslist new file mode 100644 index 0000000..ebe70c6 --- /dev/null +++ b/browserslist @@ -0,0 +1,3 @@ +Last 2 versions +Explorer >= 11 +Android >= 4.4 diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..62b3fbe --- /dev/null +++ b/circle.yml @@ -0,0 +1,6 @@ +database: + override: + - bin/setup +test: + override: + - COVERAGE=true bin/rake diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..f7ba0b5 --- /dev/null +++ b/config.ru @@ -0,0 +1,5 @@ +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Rails.application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..6d0b307 --- /dev/null +++ b/config/application.rb @@ -0,0 +1,19 @@ +require_relative 'boot' +require 'rails/all' +Bundler.require(*Rails.groups) +module Pass + class Application < Rails::Application + config.assets.quiet = 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_job.queue_adapter = :delayed_job + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..30f5120 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 0000000..0bbde6f --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,9 @@ +development: + adapter: async + +test: + adapter: async + +production: + adapter: redis + url: redis://localhost:6379/1 diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..bb6ef7a --- /dev/null +++ b/config/database.yml @@ -0,0 +1,21 @@ +development: &default + adapter: postgresql + database: pass_development + encoding: utf8 + min_messages: warning + pool: <%= Integer(ENV.fetch("DB_POOL", 5)) %> + reaping_frequency: <%= Integer(ENV.fetch("DB_REAPING_FREQUENCY", 10)) %> + timeout: 5000 + +test: + <<: *default + database: pass_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..5e8656e --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,2 @@ +require_relative 'application' +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000..27f6481 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,30 @@ +Rails.application.configure do + config.cache_classes = false + config.eager_load = false + config.consider_all_requests_local = true + if Rails.root.join('tmp/caching-dev.txt').exist? + config.action_controller.perform_caching = true + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => 'public, max-age=172800' + } + else + config.action_controller.perform_caching = false + config.cache_store = :null_store + end + config.action_mailer.raise_delivery_errors = true + config.after_initialize do + Bullet.enable = true + Bullet.bullet_logger = true + Bullet.rails_logger = true + end + config.action_mailer.delivery_method = :file + config.action_mailer.perform_caching = false + config.active_support.deprecation = :log + config.active_record.migration_error = :page_load + config.assets.debug = true + config.assets.quiet = true + config.action_view.raise_on_missing_translations = true + config.file_watcher = ActiveSupport::EventedFileUpdateChecker + 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..94539c0 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,35 @@ +require Rails.root.join("config/smtp") +Rails.application.configure do + if ENV.fetch("HEROKU_APP_NAME", "").include?("staging-pr-") + ENV["APPLICATION_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com" + end + config.middleware.use Rack::CanonicalHost, ENV.fetch("APPLICATION_HOST") + config.cache_classes = true + config.eager_load = true + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + config.assets.js_compressor = :uglifier + config.assets.compile = false + config.action_controller.asset_host = ENV.fetch("ASSET_HOST", ENV.fetch("APPLICATION_HOST")) + config.log_level = :debug + config.log_tags = [ :request_id ] + config.action_mailer.perform_caching = false + 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 + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + config.active_record.dump_schema_after_migration = false + config.middleware.use Rack::Deflater + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=31557600", + } + 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/test.rb b/config/environments/test.rb new file mode 100644 index 0000000..a56e679 --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,19 @@ +Rails.application.configure do + config.cache_classes = true + config.eager_load = false + config.public_file_server.enabled = true + config.public_file_server.headers = { + '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.perform_caching = false + config.action_mailer.delivery_method = :test + config.active_support.deprecation = :stderr + config.action_view.raise_on_missing_translations = true + config.assets.raise_runtime_errors = true + config.action_mailer.default_url_options = { host: "www.example.com" } + config.active_job.queue_adapter = :inline +end diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb new file mode 100644 index 0000000..51639b6 --- /dev/null +++ b/config/initializers/application_controller_renderer.rb @@ -0,0 +1,6 @@ +# Be sure to restart your server when you modify this file. + +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) 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..5a6a32d --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Specify a serializer for the signed and encrypted cookie jars. +# Valid options are :json, :marshal, and :hybrid. +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/config/initializers/errors.rb b/config/initializers/errors.rb new file mode 100644 index 0000000..6d8ef21 --- /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, +] + +SMTP_SERVER_ERRORS = [ + IOError, + Net::SMTPAuthenticationError, + Net::SMTPServerBusy, + Net::SMTPUnknownError, + Timeout::Error, +] + +SMTP_CLIENT_ERRORS = [ + Net::SMTPFatalError, + Net::SMTPSyntaxError, +] + +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/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb new file mode 100644 index 0000000..0706caf --- /dev/null +++ b/config/initializers/new_framework_defaults.rb @@ -0,0 +1,24 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains migration options to ease your Rails 5.0 upgrade. +# +# Read the Rails 5.0 release notes for more info on each option. + +# Enable per-form CSRF tokens. Previous versions had false. +Rails.application.config.action_controller.per_form_csrf_tokens = true + +# Enable origin-checking CSRF mitigation. Previous versions had false. +Rails.application.config.action_controller.forgery_protection_origin_check = true + +# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`. +# Previous versions had false. +ActiveSupport.to_time_preserves_timezone = true + +# Require `belongs_to` associations by default. Previous versions had false. +Rails.application.config.active_record.belongs_to_required_by_default = true + +# Do not halt callback chains when a callback returns false. Previous versions had true. +ActiveSupport.halt_callback_chains_on_return_false = false + +# Configure SSL options to enable HSTS with subdomains. Previous versions had false. +Rails.application.config.ssl_options = { hsts: { subdomains: true } } diff --git a/config/initializers/rack_mini_profiler.rb b/config/initializers/rack_mini_profiler.rb new file mode 100644 index 0000000..0d2979c --- /dev/null +++ b/config/initializers/rack_mini_profiler.rb @@ -0,0 +1,5 @@ +if ENV["RACK_MINI_PROFILER"].to_i > 0 + require "rack-mini-profiler" + + Rack::MiniProfilerRails.initialize!(Rails.application) +end diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb new file mode 100644 index 0000000..3ac5d99 --- /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: '_pass_session' diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb new file mode 100644 index 0000000..934487a --- /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/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..bbfc396 --- /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] +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..cd03b86 --- /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: Pass 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/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/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000..0bfb22d --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,14 @@ +default: &default + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> + +development: + <<: *default + +test: + <<: *default + +staging: + <<: *default + +production: + <<: *default diff --git a/config/smtp.rb b/config/smtp.rb new file mode 100644 index 0000000..d331ab3 --- /dev/null +++ b/config/smtp.rb @@ -0,0 +1,13 @@ +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") +} + +if ENV["EMAIL_RECIPIENTS"].present? + Mail.register_interceptor RecipientInterceptor.new(ENV["EMAIL_RECIPIENTS"]) +end diff --git a/config/spring.rb b/config/spring.rb new file mode 100644 index 0000000..c9119b4 --- /dev/null +++ b/config/spring.rb @@ -0,0 +1,6 @@ +%w( + .ruby-version + .rbenv-vars + tmp/restart.txt + tmp/caching-dev.txt +).each { |path| Spring.watch(path) } diff --git a/db/migrate/20160909164027_create_delayed_jobs.rb b/db/migrate/20160909164027_create_delayed_jobs.rb new file mode 100644 index 0000000..27fdcf6 --- /dev/null +++ b/db/migrate/20160909164027_create_delayed_jobs.rb @@ -0,0 +1,22 @@ +class CreateDelayedJobs < ActiveRecord::Migration + def self.up + create_table :delayed_jobs, force: true do |table| + table.integer :priority, default: 0, null: false # Allows some jobs to jump to the front of the queue + table.integer :attempts, default: 0, null: false # Provides for retries, but still fail eventually. + table.text :handler, null: false # YAML-encoded string of the object that will do work + table.text :last_error # reason for last failure (See Note below) + table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. + table.datetime :locked_at # Set when a client is working on this object + table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) + table.string :locked_by # Who is working on this object (if locked) + table.string :queue # The name of the queue this job is in + table.timestamps null: true + end + + add_index :delayed_jobs, [:priority, :run_at], name: "delayed_jobs_priority" + end + + def self.down + drop_table :delayed_jobs + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..411fc64 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,33 @@ +# 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: 20160909164027) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "delayed_jobs", force: :cascade do |t| + t.integer "priority", default: 0, null: false + t.integer "attempts", default: 0, null: false + t.text "handler", null: false + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.string "queue" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree + end + +end diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000..1beea2a --- /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 rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) +# Character.create(name: 'Luke', movie: movies.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/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 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/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..86bb988 --- /dev/null +++ b/spec/rails_helper.rb @@ -0,0 +1,22 @@ +ENV["RACK_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.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! diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..56754f3 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,29 @@ +if ENV.fetch("COVERAGE", false) + require "simplecov" + + if ENV["CIRCLE_ARTIFACTS"] + dir = File.join(ENV["CIRCLE_ARTIFACTS"], "coverage") + SimpleCov.coverage_dir(dir) + end + + 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/capybara_webkit.rb b/spec/support/capybara_webkit.rb new file mode 100644 index 0000000..a356c4e --- /dev/null +++ b/spec/support/capybara_webkit.rb @@ -0,0 +1,5 @@ +Capybara.javascript_driver = :webkit + +Capybara::Webkit.configure do |config| + config.block_unknown_urls +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..0c61ce6 --- /dev/null +++ b/spec/support/i18n.rb @@ -0,0 +1,3 @@ +RSpec.configure do |config| + config.include ActionView::Helpers::TranslationHelper +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/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/.keep b/test/fixtures/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..92e39b2 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,10 @@ +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... +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