welaika-suspenders 2.26.0 → 2.27.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ecce30cf53025a563d920bdab67f869721f4beb
4
- data.tar.gz: 8416bd5f21aaada18c56be47cfaaa918b63edbbb
3
+ metadata.gz: 0b7d61cff79cf0d5c347e8b757138d8d50ea67ed
4
+ data.tar.gz: 8e3ece8af262909611bee9c04ac1b69d232f5259
5
5
  SHA512:
6
- metadata.gz: acde67c5a7d352813e7f924c29cdadd7671f70ef119efe4b913fe98a9bba447e71647d07bcc1cb37961e24e90fbeb2c49244458a2c718435e2a9cec70fdc8a8c
7
- data.tar.gz: ac6bdc80ed994e47251c51da9f40010b7e1068dddfabe556f67e4cfd3ca5546e6773e703ae3b904c51f56f994c044ba04838114caf19a2bfa7a4a7af8b0c4e1a
6
+ metadata.gz: 76de0368d9bb59a427005823ebaab568a15645981bb5dc78af626fb1d8597e716ea2eab424749995f288e460c87cf9f404a08d76ed08bc27968c6bc61f93f7f4
7
+ data.tar.gz: 43e6470856aee3672b5957b5ef09d2ea3f0dd2436c84a6a06b5469e9da2e81aa179b74bb71f5b0e0f43d95017e11db0945c99e0538e6787d80709651e897af81
@@ -1 +1 @@
1
- 2.4.0
1
+ 2.4.1
@@ -1,5 +1,5 @@
1
1
  language: ruby
2
- rvm: 2.4.0
2
+ rvm: 2.4.1
3
3
  cache: bundler
4
4
  sudo: false
5
5
  before_install:
data/README.md CHANGED
@@ -5,7 +5,14 @@ Big thanks to [thoughtbot](http://thoughtbot.com/community) for providing such a
5
5
 
6
6
  ## Installation
7
7
 
8
- First install the suspenders gem:
8
+ First ensure you have PostgreSQL, npm and yarn.
9
+
10
+ $ brew install postgresql
11
+ $ brew install node
12
+ $ npm install npm@latest -g # To update npm if you have already installed it
13
+ $ brew install yarn
14
+
15
+ then install the suspenders gem:
9
16
 
10
17
  gem install welaika-suspenders
11
18
 
@@ -23,7 +30,7 @@ You can optionally specify alternate Heroku flags:
23
30
 
24
31
  welaika-suspenders projectname \
25
32
  --heroku true \
26
- --heroku-flags "--region eu --addons sendgrid,ssl"
33
+ --heroku-flags "--region eu --addons heroku-postgresql,sendgrid,logentries,scheduler,newrelic"
27
34
 
28
35
  See all possible Heroku flags:
29
36
 
@@ -44,14 +44,6 @@ module Suspenders
44
44
  'raise_delivery_errors = false', 'raise_delivery_errors = true'
45
45
  end
46
46
 
47
- def remove_turbolinks
48
- replace_in_file(
49
- "app/assets/javascripts/application.js",
50
- "//= require turbolinks",
51
- ""
52
- )
53
- end
54
-
55
47
  def set_test_delivery_method
56
48
  inject_into_file(
57
49
  "config/environments/development.rb",
@@ -291,8 +283,8 @@ config.public_file_server.headers = {
291
283
  copy_file 'action_mailer.rb', 'spec/support/action_mailer.rb'
292
284
  end
293
285
 
294
- def configure_capybara_webkit
295
- copy_file "capybara_webkit.rb", "spec/support/capybara_webkit.rb"
286
+ def configure_capybara
287
+ copy_file "capybara.rb", "spec/support/capybara.rb"
296
288
  end
297
289
 
298
290
  def configure_locales_and_time_zone
@@ -324,6 +316,18 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
324
316
  bundle_command "exec rails generate simple_form:install"
325
317
  end
326
318
 
319
+ def configure_draper
320
+ bundle_command "exec rails generate draper:install"
321
+ end
322
+
323
+ def configure_active_interaction
324
+ copy_file "sample_service.rb", "app/services/sample_service.rb"
325
+ end
326
+
327
+ def configure_errbit
328
+ copy_file "errbit.rb", "config/initializers/errbit.rb"
329
+ end
330
+
327
331
  def configure_action_mailer
328
332
  action_mailer_host "development", %{"localhost:3000"}
329
333
  action_mailer_host "test", %{"www.example.com"}
@@ -407,9 +411,15 @@ you can deploy to staging and production with:
407
411
  copy_file "brakeman.rake", "lib/tasks/brakeman.rake"
408
412
  end
409
413
 
414
+ def setup_slim_lint
415
+ copy_file "slim-lint.rake", "lib/tasks/slim-lint.rake"
416
+ copy_file "slim-lint.yml", ".slim-lint.yml"
417
+ end
418
+
410
419
  def setup_rubocop
411
420
  copy_file "rubocop.rake", "lib/tasks/rubocop.rake"
412
421
  copy_file "rubocop.yml", ".rubocop.yml"
422
+ copy_file "rubocop_todo.yml", ".rubocop_todo.yml"
413
423
  end
414
424
 
415
425
  def setup_bundler_audit
@@ -423,6 +433,7 @@ you can deploy to staging and production with:
423
433
  def create_binstubs
424
434
  bundle_command "binstubs brakeman"
425
435
  bundle_command "binstubs rubocop"
436
+ bundle_command "binstubs slim_lint"
426
437
  end
427
438
 
428
439
  def copy_miscellaneous_files
@@ -485,9 +496,10 @@ if defined? RSpec
485
496
  end
486
497
 
487
498
  task default: :rubocop
499
+ task default: :slim_lint
500
+ task default: 'brakeman:check'
501
+ task default: 'bundle:audit'
488
502
  task default: :spec
489
- task default: "brakeman:check"
490
- task default: "bundle:audit"
491
503
  EOS
492
504
  end
493
505
  end
@@ -26,6 +26,12 @@ module Suspenders
26
26
  class_option :skip_test, type: :boolean, default: true,
27
27
  desc: "Skip Test Unit"
28
28
 
29
+ class_option :skip_system_test, type: :boolean, default: true,
30
+ desc: "Skip system test files"
31
+
32
+ class_option :skip_turbolinks, type: :boolean, default: true,
33
+ desc: "Skip turbolinks gem"
34
+
29
35
  def finish_template
30
36
  invoke :suspenders_customization
31
37
  super
@@ -59,6 +65,9 @@ module Suspenders
59
65
  build :set_ruby_to_version_being_used
60
66
  bundle_command 'install'
61
67
  build :configure_simple_form
68
+ build :configure_draper
69
+ build :configure_active_interaction
70
+ build :configure_errbit
62
71
  end
63
72
 
64
73
  def setup_database
@@ -75,7 +84,6 @@ module Suspenders
75
84
  say 'Setting up the development environment'
76
85
  build :raise_on_missing_assets_in_test
77
86
  build :raise_on_delivery_errors
78
- build :remove_turbolinks
79
87
  build :set_test_delivery_method
80
88
  build :add_bullet_gem_configuration
81
89
  build :raise_on_unpermitted_parameters
@@ -85,6 +93,7 @@ module Suspenders
85
93
  build :configure_i18n_for_missing_translations
86
94
  build :configure_quiet_assets
87
95
  build :setup_rubocop
96
+ build :setup_slim_lint
88
97
  build :setup_brakeman
89
98
  build :setup_bundler_audit
90
99
  end
@@ -104,7 +113,7 @@ module Suspenders
104
113
  build :configure_i18n_for_test_environment
105
114
  build :configure_action_mailer_in_specs
106
115
  build :set_up_faker
107
- build :configure_capybara_webkit
116
+ build :configure_capybara
108
117
  end
109
118
 
110
119
  def setup_production_environment
@@ -17,5 +17,9 @@ module Suspenders
17
17
  def remove_prior_config
18
18
  remove_file "app/assets/stylesheets/application.css"
19
19
  end
20
+
21
+ def install_normalize_css
22
+ run "bin/yarn add normalize.css"
23
+ end
20
24
  end
21
25
  end
@@ -1,8 +1,8 @@
1
1
  module Suspenders
2
- RAILS_VERSION = "~> 5.0.0".freeze
2
+ RAILS_VERSION = "~> 5.1.2".freeze
3
3
  RUBY_VERSION = IO.
4
4
  read("#{File.dirname(__FILE__)}/../../.ruby-version").
5
5
  strip.
6
6
  freeze
7
- VERSION = "2.26.0".freeze
7
+ VERSION = "2.27.0".freeze
8
8
  end
@@ -1,7 +1 @@
1
- require 'suspenders/version'
2
- require 'suspenders/generators/app_generator'
3
- require 'suspenders/generators/static_generator'
4
- require 'suspenders/generators/stylesheet_base_generator'
5
- require 'suspenders/actions'
6
- require "suspenders/adapters/heroku"
7
- require 'suspenders/app_builder'
1
+ require_relative 'suspenders'
@@ -74,8 +74,8 @@ RSpec.describe "Suspend a new project with default configuration" do
74
74
  expect(File).to exist("#{project_path}/spec/support/action_mailer.rb")
75
75
  end
76
76
 
77
- it "configures capybara-webkit" do
78
- expect(File).to exist("#{project_path}/spec/support/capybara_webkit.rb")
77
+ it "configures capybara" do
78
+ expect(File).to exist("#{project_path}/spec/support/capybara.rb")
79
79
  end
80
80
 
81
81
  it "adds support file for i18n" do
@@ -165,8 +165,8 @@ RSpec.describe "Suspend a new project with default configuration" do
165
165
 
166
166
  it "configs simplecov" do
167
167
  spec_helper_file = IO.read("#{project_path}/spec/spec_helper.rb")
168
- expect(spec_helper_file).to match(/^require "simplecov"$/)
169
- expect(spec_helper_file).to match(/^SimpleCov.start "rails" do$/)
168
+ expect(spec_helper_file).to match(/^require 'simplecov'$/)
169
+ expect(spec_helper_file).to match(/^SimpleCov.start 'rails' do$/)
170
170
  end
171
171
 
172
172
  it "uses APPLICATION_HOST, not HOST in the production config" do
@@ -288,6 +288,11 @@ RSpec.describe "Suspend a new project with default configuration" do
288
288
  expect(app_js).not_to match(/turbolinks/)
289
289
  end
290
290
 
291
+ it "configures Timecop safe mode" do
292
+ spec_helper = read_project_file(%w(spec spec_helper.rb))
293
+ expect(spec_helper).to match(/Timecop.safe_mode = true/)
294
+ end
295
+
291
296
  def development_config
292
297
  @_development_config ||=
293
298
  read_project_file %w(config environments development.rb)
@@ -9,6 +9,8 @@ Dir['./spec/support/**/*.rb'].each { |file| require file }
9
9
  RSpec.configure do |config|
10
10
  config.include SuspendersTestHelpers
11
11
 
12
+ config.example_status_persistence_file_path = 'tmp/rspec_examples.txt'
13
+
12
14
  config.before(:all) do
13
15
  add_fakes_to_path
14
16
  create_tmp_directory
@@ -9,15 +9,16 @@ ruby "<%= Suspenders::RUBY_VERSION %>"
9
9
 
10
10
  gem "bundler", ">= 1.8.4"
11
11
 
12
+ gem "active_interaction", "~> 3.5"
12
13
  gem "airbrake"
13
14
  gem "autoprefixer-rails"
14
15
  gem "coffee-rails", "~> 4.2"
15
16
  gem "delayed_job_active_record"
17
+ gem "draper"
16
18
  gem "email_validator"
17
19
  gem "flutie"
18
- gem "jquery-rails"
19
20
  gem "pg"
20
- gem "puma", "~> 3.0"
21
+ gem "puma", "~> 3.7"
21
22
  gem "rack-canonical-host"
22
23
  gem "rails", "<%= Suspenders::RAILS_VERSION %>"
23
24
  gem "rails-i18n"
@@ -28,15 +29,14 @@ gem "skylight"
28
29
  gem "slim-rails"
29
30
  gem "title"
30
31
  gem "uglifier", ">= 1.3.0"
32
+ <% if options[:webpack] %>
33
+ gem "webpacker"
34
+ <% end %>
31
35
  gem "welaika-suspenders"
32
36
 
33
- source "https://rails-assets.org" do
34
- gem "rails-assets-normalize-css"
35
- end
36
-
37
37
  group :development do
38
38
  gem "letter_opener"
39
- gem "listen", "~> 3.0.5"
39
+ gem "listen", ">= 3.0.5", "< 3.2"
40
40
  gem "spring"
41
41
  gem "spring-commands-rspec"
42
42
  gem "spring-watcher-listen", "~> 2.0.0"
@@ -53,8 +53,11 @@ group :development, :test do
53
53
  gem "faker"
54
54
  gem "pry-byebug"
55
55
  gem "pry-rails"
56
- gem "rspec-rails", "~> 3.5"
56
+ gem "rspec-rails", "~> 3.6"
57
+ gem "rspec_junit_formatter"
57
58
  gem "rubocop", require: false
59
+ gem "rubocop-rspec", require: false
60
+ gem "slim_lint", require: false
58
61
  end
59
62
 
60
63
  group :development, :staging do
@@ -62,12 +65,12 @@ group :development, :staging do
62
65
  end
63
66
 
64
67
  group :test do
65
- gem "capybara-webkit"
68
+ gem "capybara"
66
69
  gem "database_cleaner"
67
70
  gem "launchy"
71
+ gem "selenium-webdriver"
68
72
  gem "shoulda-matchers"
69
73
  gem "simplecov", require: false
70
- gem "simplecov-json", require: false
71
74
  gem "timecop"
72
75
  gem "webmock"
73
76
  end
@@ -7,7 +7,7 @@ with the necessary dependencies to run and test this app:
7
7
 
8
8
  % ./bin/setup
9
9
 
10
- It assumes you have a machine equipped with Ruby, Postgres or MySQL, Node, Qt and ImageMagick.
10
+ It assumes you have a machine equipped with Ruby, Postgres or MySQL, Node, Yarn and ImageMagick.
11
11
 
12
12
  To install Ruby, read the [rbenv guide](https://github.com/rbenv/rbenv#installation)
13
13
  or the [rvm guide](https://rvm.io/rvm/install).
@@ -15,22 +15,29 @@ or the [rvm guide](https://rvm.io/rvm/install).
15
15
  To install Postgres:
16
16
 
17
17
  $ brew install postgresql
18
-
18
+
19
19
  To install MySQL:
20
-
20
+
21
21
  $ brew tap homebrew/versions
22
22
  $ brew install mysql55
23
23
  $ brew link --force mysql55
24
-
24
+
25
25
  To install Node:
26
26
 
27
27
  $ brew install node
28
-
29
- To install Qt:
30
28
 
31
- $ brew install qt5
32
- $ brew link --force qt5
33
-
29
+ To update Node:
30
+
31
+ $ npm install npm@latest -g
32
+
33
+ To install Yarn:
34
+
35
+ $ brew install yarn
36
+
37
+ To install Chromedriver (for integration test):
38
+
39
+ $ brew install chromedriver
40
+
34
41
  To install ImageMagick:
35
42
 
36
43
  $ brew install imagemagick
@@ -31,6 +31,9 @@
31
31
  },
32
32
  "SMTP_USERNAME":{
33
33
  "required":true
34
+ },
35
+ "ERRBIT_API_KEY":{
36
+ "required":true
34
37
  }
35
38
  },
36
39
  "addons":[
@@ -1,3 +1,3 @@
1
1
  @charset 'utf-8'
2
2
 
3
- @import 'normalize-css'
3
+ @import 'normalize.css/normalize.css'
@@ -1,14 +1,14 @@
1
1
  if Rails.env.development? || Rails.env.test?
2
2
  namespace :brakeman do
3
- desc "Run Brakeman"
3
+ desc 'Run Brakeman'
4
4
  task :run, :output_files do |_t, args|
5
5
  require 'brakeman'
6
6
 
7
7
  files = args[:output_files].split(' ') if args[:output_files]
8
- Brakeman.run app_path: ".", output_files: files, print_report: true
8
+ Brakeman.run app_path: '.', output_files: files, print_report: true
9
9
  end
10
10
 
11
- desc "Check your code with Brakeman"
11
+ desc 'Check your code with Brakeman'
12
12
  task :check do
13
13
  require 'brakeman'
14
14
  result = Brakeman.run app_path: '.', print_report: true
@@ -1,4 +1,4 @@
1
1
  if Rails.env.development? || Rails.env.test?
2
- require "bundler/audit/task"
2
+ require 'bundler/audit/task'
3
3
  Bundler::Audit::Task.new
4
4
  end
@@ -0,0 +1,29 @@
1
+ Capybara.register_driver :chrome do |app|
2
+ # https://stackoverflow.com/questions/26354834/netreadtimeout-netreadtimeout-selenium-ruby
3
+ client = Selenium::WebDriver::Remote::Http::Default.new
4
+ client.read_timeout = 15
5
+ client.open_timeout = 15
6
+
7
+ profile = Selenium::WebDriver::Chrome::Profile.new
8
+ profile['intl.accept_languages'] = I18n.default_locale
9
+ Capybara::Selenium::Driver.new(app, browser: :chrome, profile: profile, http_client: client)
10
+ end
11
+ Capybara.javascript_driver = :chrome
12
+ Capybara.default_driver = :chrome
13
+ Capybara.default_max_wait_time = 4
14
+
15
+ Capybara.asset_host = 'http://localhost:3000'
16
+
17
+ module CapybaraHelper
18
+ def page!
19
+ save_and_open_page
20
+ end
21
+
22
+ def screenshot!
23
+ save_and_open_screenshot
24
+ end
25
+ end
26
+
27
+ RSpec.configure do |config|
28
+ config.include CapybaraHelper, type: :feature
29
+ end
@@ -1,6 +1,15 @@
1
- database:
2
- override:
3
- - bin/setup
1
+ machine:
2
+ timezone:
3
+ Europe/Rome
4
+ dependencies:
5
+ pre:
6
+ - npm install yarn
7
+ bundler:
8
+ without: [production, staging]
4
9
  test:
5
- override:
6
- - COVERAGE=true bin/rake
10
+ pre:
11
+ - mkdir $CIRCLE_ARTIFACTS/coverage $CIRCLE_ARTIFACTS/quality $CIRCLE_ARTIFACTS/security
12
+ - bundle exec rubocop --format html -o $CIRCLE_ARTIFACTS/quality/rubocop.html
13
+ - bundle exec slim-lint app/views/ &> $CIRCLE_ARTIFACTS/quality/slim-lint.txt
14
+ - bundle exec brakeman --exit-on-warn -o $CIRCLE_ARTIFACTS/security/brakeman.html
15
+ - bundle exec bundle-audit check --update
@@ -1,12 +1,12 @@
1
1
  if Rails.env.development? || Rails.env.test?
2
- require "factory_girl"
2
+ require 'factory_girl'
3
3
 
4
4
  namespace :dev do
5
- desc "Sample data for local development environment"
6
- task prime: "db:setup" do
5
+ desc 'Sample data for local development environment'
6
+ task prime: 'db:setup' do
7
7
  include FactoryGirl::Syntax::Methods
8
8
 
9
- # create(:user, email: "user@example.com", password: "password")
9
+ # create(:user, email: 'user@example.com', password: 'password')
10
10
  end
11
11
  end
12
12
  end
@@ -11,3 +11,4 @@ SMTP_DOMAIN=example.com
11
11
  SMTP_PASSWORD=password
12
12
  SMTP_USERNAME=username
13
13
  WEB_CONCURRENCY=1
14
+ ERRBIT_API_KEY=
@@ -0,0 +1,12 @@
1
+ if ENV['ERRBIT_API_KEY'].present?
2
+ Airbrake.configure do |config|
3
+ config.host = 'http://errbit.welaika.com'
4
+ config.project_id = 1
5
+ config.project_key = ENV.fetch('ERRBIT_API_KEY')
6
+ config.root_directory = Rails.root
7
+ config.logger = Rails.logger
8
+ config.environment = Rails.env
9
+ config.ignore_environments = %w[test development]
10
+ config.blacklist_keys = [/password/i]
11
+ end
12
+ end
@@ -1 +1 @@
1
- Faker::Config.locale = "it"
1
+ Faker::Config.locale = 'it'
@@ -1,6 +1,6 @@
1
1
  module FixturesHelpers
2
2
  def fixture_path_for(filename)
3
- File.expand_path(File.join("..", "..", "fixtures", filename), __FILE__)
3
+ File.expand_path(File.join('..', '..', 'fixtures', filename), __FILE__)
4
4
  end
5
5
  end
6
6
 
@@ -1,5 +1,5 @@
1
1
  module FlashesHelper
2
2
  def user_facing_flashes
3
- flash.to_hash.slice("alert", "error", "notice", "success")
3
+ flash.to_hash.slice('alert', 'error', 'notice', 'success')
4
4
  end
5
5
  end
@@ -1,11 +1,11 @@
1
- ENV["RACK_ENV"] = "test"
1
+ ENV['RACK_ENV'] = 'test'
2
2
 
3
- require File.expand_path("../../config/environment", __FILE__)
4
- abort("DATABASE_URL environment variable is set") if ENV["DATABASE_URL"]
3
+ require File.expand_path('../../config/environment', __FILE__)
4
+ abort('DATABASE_URL environment variable is set') if ENV['DATABASE_URL']
5
5
 
6
- require "rspec/rails"
6
+ require 'rspec/rails'
7
7
 
8
- Dir[Rails.root.join("spec", "support", "**", "*.rb")].sort.each { |file| require file }
8
+ Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |file| require file }
9
9
 
10
10
  RSpec.configure do |config|
11
11
  config.infer_base_class_for_anonymous_controllers = false
@@ -13,7 +13,7 @@ RSpec.configure do |config|
13
13
 
14
14
  config.filter_rails_from_backtrace!
15
15
  # arbitrary gems may also be filtered via:
16
- # config.filter_gems_from_backtrace("gem name")
16
+ # config.filter_gems_from_backtrace('gem name')
17
17
  end
18
18
 
19
19
  ActiveRecord::Migration.maintain_test_schema!
@@ -1,23 +1,38 @@
1
- Rails:
2
- Enabled: true
1
+ require: rubocop-rspec
2
+ inherit_from: .rubocop_todo.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.3
5
+ TargetRubyVersion: 2.4
6
6
  Exclude:
7
- - "db/**/*"
8
- - "config/**/*"
9
- - "bin/*"
7
+ - 'bin/*'
8
+ - 'config/**/*'
9
+ - 'db/**/*'
10
+ - 'tmp/**/*'
11
+ - 'vendor/**/*'
12
+
13
+ Layout/TrailingBlankLines:
14
+ Exclude:
15
+ - "Gemfile"
10
16
 
11
17
  Lint/Debugger:
12
18
  Exclude:
13
- - "spec/support/capybara_webkit.rb"
19
+ - "spec/support/capybara.rb"
14
20
 
15
21
  Metrics/AbcSize:
16
- Max: 18
22
+ Max: 20
23
+
24
+ Metrics/BlockLength:
25
+ Exclude:
26
+ - 'app/admin/**/*'
27
+ - 'lib/tasks/*.rake'
28
+ - 'spec/**/*'
17
29
 
18
30
  Metrics/LineLength:
19
31
  Max: 100
20
32
 
33
+ Rails:
34
+ Enabled: true
35
+
21
36
  Style/Documentation:
22
37
  Enabled: false
23
38
 
@@ -26,8 +41,3 @@ Style/FrozenStringLiteralComment:
26
41
 
27
42
  Style/StringLiterals:
28
43
  Enabled: false
29
- EnforcedStyle: double_quotes
30
-
31
- Style/TrailingBlankLines:
32
- Exclude:
33
- - "Gemfile"
File without changes
@@ -0,0 +1,5 @@
1
+ class SampleService < ActiveInteraction::Base
2
+ def execute
3
+ # https://github.com/orgsync/active_interaction
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ if Rails.env.development? || Rails.env.test?
2
+ require 'slim_lint/rake_task'
3
+ SlimLint::RakeTask.new do |t|
4
+ t.files = ['app/views']
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ exclude:
2
+ - 'lib/templates/slim/scaffold/_form.html.slim'
3
+
4
+ linters:
5
+ LineLength:
6
+ max: 130
@@ -1,11 +1,16 @@
1
- require "simplecov"
2
- require "simplecov-json"
3
- SimpleCov.start "rails" do
4
- add_group "Services", "app/services"
1
+ require 'simplecov'
2
+ SimpleCov.start 'rails' do
3
+ add_group 'Services', 'app/services'
5
4
  end
6
- SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
7
5
 
8
- require "webmock/rspec"
6
+ # Save to CircleCI's artifacts directory if we're on CircleCI
7
+ if ENV['CIRCLE_ARTIFACTS']
8
+ dir = File.join(ENV['CIRCLE_ARTIFACTS'], 'coverage')
9
+ SimpleCov.coverage_dir(dir)
10
+ end
11
+
12
+ require 'webmock/rspec'
13
+ require 'timecop'
9
14
 
10
15
  # http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
11
16
  RSpec.configure do |config|
@@ -18,10 +23,13 @@ RSpec.configure do |config|
18
23
  mocks.verify_partial_doubles = true
19
24
  end
20
25
 
21
- config.example_status_persistence_file_path = "tmp/rspec_examples.txt"
26
+ config.example_status_persistence_file_path = 'tmp/rspec_examples.txt'
22
27
  config.order = :random
23
28
 
24
29
  config.default_formatter = 'doc' if config.files_to_run.one?
25
30
  end
26
31
 
27
32
  WebMock.disable_net_connect!(allow_localhost: true)
33
+
34
+ # Only allow Timecop with block syntax
35
+ Timecop.safe_mode = true
@@ -6,8 +6,12 @@
6
6
  /.env.local
7
7
  /coverage/*
8
8
  /db/*.sqlite3
9
+ /db/*.sqlite3-journal
9
10
  /log/*
10
11
  /public/system
11
12
  /public/assets
12
13
  /tags
13
14
  /tmp/*
15
+ /yarn-error.log
16
+ /public/packs
17
+ /node_modules
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: welaika-suspenders
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.26.0
4
+ version: 2.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-21 00:00:00.000000000 Z
12
+ date: 2017-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 5.0.0
34
+ version: 5.1.2
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 5.0.0
41
+ version: 5.1.2
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -113,13 +113,14 @@ files:
113
113
  - templates/brakeman.rake
114
114
  - templates/browserslist
115
115
  - templates/bundler_audit.rake
116
- - templates/capybara_webkit.rb
116
+ - templates/capybara.rb
117
117
  - templates/circle.yml.erb
118
118
  - templates/config_locales_it.yml.erb
119
119
  - templates/database_cleaner_rspec.rb
120
120
  - templates/dev.rake
121
121
  - templates/dotfiles/.ctags
122
122
  - templates/dotfiles/.env
123
+ - templates/errbit.rb
123
124
  - templates/errors.rb
124
125
  - templates/factories.rb
125
126
  - templates/factory_girl_rspec.rb
@@ -135,8 +136,12 @@ files:
135
136
  - templates/rails_helper.rb
136
137
  - templates/rubocop.rake
137
138
  - templates/rubocop.yml
139
+ - templates/rubocop_todo.yml
140
+ - templates/sample_service.rb
138
141
  - templates/secrets.yml
139
142
  - templates/shoulda_matchers_config_rspec.rb
143
+ - templates/slim-lint.rake
144
+ - templates/slim-lint.yml
140
145
  - templates/slim.rb
141
146
  - templates/smtp.rb
142
147
  - templates/spec_helper.rb
@@ -155,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
160
  requirements:
156
161
  - - ">="
157
162
  - !ruby/object:Gem::Version
158
- version: 2.4.0
163
+ version: 2.4.1
159
164
  required_rubygems_version: !ruby/object:Gem::Requirement
160
165
  requirements:
161
166
  - - ">="
@@ -163,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
168
  version: '0'
164
169
  requirements: []
165
170
  rubyforge_project:
166
- rubygems_version: 2.6.11
171
+ rubygems_version: 2.6.12
167
172
  signing_key:
168
173
  specification_version: 4
169
174
  summary: Generate a Rails app using thoughtbot's best practices.
@@ -1,20 +0,0 @@
1
- Capybara.javascript_driver = :webkit
2
- Capybara.asset_host = "http://localhost:3000"
3
-
4
- module CapybaraHelper
5
- def page!
6
- save_and_open_page
7
- end
8
-
9
- def screenshot!
10
- save_and_open_screenshot
11
- end
12
- end
13
-
14
- Capybara::Webkit.configure do |config|
15
- config.allow_url(%w[fonts.googleapis.com])
16
- end
17
-
18
- RSpec.configure do |config|
19
- config.include CapybaraHelper, type: :feature
20
- end