diff --git a/.gitignore b/.gitignore index 84dd021..c2f0e98 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,7 @@ .bundle/ log/*.log pkg/ -spec/dummy/db/*.sqlite3 -spec/dummy/db/*.sqlite3-journal -spec/dummy/log/*.log -spec/dummy/tmp/ +spec/internal/db/* +!spec/internal/db/schema.rb +spec/internal/log/*.log gemfiles/*.lock diff --git a/Appraisals b/Appraisals index 03f171b..a9e6bd2 100644 --- a/Appraisals +++ b/Appraisals @@ -2,16 +2,20 @@ appraise '5.2' do gem 'rails', '~> 5.2.0' + gem 'sqlite3', '~> 1.4' end appraise '6.0' do gem 'rails', '~> 6.0.0' + gem 'sqlite3', '~> 1.4' end appraise '6.1' do gem 'rails', '~> 6.1.0' + gem 'sqlite3', '~> 1.4' end appraise '7.0' do gem 'rails', '~> 7.0.0' + gem 'sqlite3', '~> 1.4' end diff --git a/Gemfile.lock b/Gemfile.lock index 0cfcfef..390c462 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,9 +7,9 @@ PATH GEM remote: https://rubygems.org/ specs: - actionpack (7.1.3.3) - actionview (= 7.1.3.3) - activesupport (= 7.1.3.3) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -17,19 +17,19 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actionview (7.1.3.3) - activesupport (= 7.1.3.3) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activemodel (7.1.3.3) - activesupport (= 7.1.3.3) - activerecord (7.1.3.3) - activemodel (= 7.1.3.3) - activesupport (= 7.1.3.3) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) timeout (>= 0.4.0) - activesupport (7.1.3.3) + activesupport (7.1.3.4) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -48,15 +48,13 @@ GEM bigdecimal (3.1.8) builder (3.2.4) coderay (1.1.3) + combustion (1.4.0) + activesupport (>= 3.0.0) + railties (>= 3.0.0) + thor (>= 0.14.6) concurrent-ruby (1.3.1) connection_pool (2.4.1) crass (1.0.6) - database_cleaner (2.0.2) - database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.1.0) - activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) - database_cleaner-core (2.0.1) diff-lcs (1.5.1) drb (2.2.1) erubi (1.12.0) @@ -118,9 +116,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3.3) - actionpack (= 7.1.3.3) - activesupport (= 7.1.3.3) + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -168,16 +166,12 @@ GEM rubocop-ast (1.31.3) parser (>= 3.3.1.0) ruby-progressbar (1.13.0) - sqlite3 (2.0.2-aarch64-linux-gnu) - sqlite3 (2.0.2-aarch64-linux-musl) - sqlite3 (2.0.2-arm-linux-gnu) - sqlite3 (2.0.2-arm-linux-musl) - sqlite3 (2.0.2-arm64-darwin) - sqlite3 (2.0.2-x86-linux-gnu) - sqlite3 (2.0.2-x86-linux-musl) - sqlite3 (2.0.2-x86_64-darwin) - sqlite3 (2.0.2-x86_64-linux-gnu) - sqlite3 (2.0.2-x86_64-linux-musl) + sqlite3 (1.7.3-aarch64-linux) + sqlite3 (1.7.3-arm-linux) + sqlite3 (1.7.3-arm64-darwin) + sqlite3 (1.7.3-x86-linux) + sqlite3 (1.7.3-x86_64-darwin) + sqlite3 (1.7.3-x86_64-linux) stringio (3.1.0) strscan (3.1.0) thor (1.3.1) @@ -206,13 +200,13 @@ PLATFORMS DEPENDENCIES appraisal - database_cleaner + combustion (~> 1.4) factory_bot_rails pry-rails rspec-rails rspec_junit_formatter rubocop - sqlite3 + sqlite3 (~> 1.4) where_chain! BUNDLED WITH diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..1265db9 --- /dev/null +++ b/config.ru @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require "rubygems" +require "bundler" + +Bundler.require :default, :development + +Combustion.initialize! :all +run Combustion::Application diff --git a/gemfiles/5.2.gemfile b/gemfiles/5.2.gemfile index 5a706dc..fe95e67 100644 --- a/gemfiles/5.2.gemfile +++ b/gemfiles/5.2.gemfile @@ -3,5 +3,6 @@ source "https://rubygems.org" gem "rails", "~> 5.2.0" +gem "sqlite3", "~> 1.4" gemspec path: "../" diff --git a/gemfiles/6.0.gemfile b/gemfiles/6.0.gemfile index 15b9b27..f3c380c 100644 --- a/gemfiles/6.0.gemfile +++ b/gemfiles/6.0.gemfile @@ -3,5 +3,6 @@ source "https://rubygems.org" gem "rails", "~> 6.0.0" +gem "sqlite3", "~> 1.4" gemspec path: "../" diff --git a/gemfiles/6.1.gemfile b/gemfiles/6.1.gemfile index dd95a47..fa66f75 100644 --- a/gemfiles/6.1.gemfile +++ b/gemfiles/6.1.gemfile @@ -3,5 +3,6 @@ source "https://rubygems.org" gem "rails", "~> 6.1.0" +gem "sqlite3", "~> 1.4" gemspec path: "../" diff --git a/gemfiles/7.0.gemfile b/gemfiles/7.0.gemfile index 9af0ae3..286d6d3 100644 --- a/gemfiles/7.0.gemfile +++ b/gemfiles/7.0.gemfile @@ -3,5 +3,6 @@ source "https://rubygems.org" gem "rails", "~> 7.0.0" +gem "sqlite3", "~> 1.4" gemspec path: "../" diff --git a/spec/dummy/Rakefile b/spec/dummy/Rakefile deleted file mode 100644 index 488c551..0000000 --- a/spec/dummy/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# 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 diff --git a/spec/dummy/app/controllers/application_controller.rb b/spec/dummy/app/controllers/application_controller.rb deleted file mode 100644 index 280cc28..0000000 --- a/spec/dummy/app/controllers/application_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -class ApplicationController < ActionController::Base - protect_from_forgery with: :exception -end diff --git a/spec/dummy/app/mailers/application_mailer.rb b/spec/dummy/app/mailers/application_mailer.rb deleted file mode 100644 index d84cb6e..0000000 --- a/spec/dummy/app/mailers/application_mailer.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -class ApplicationMailer < ActionMailer::Base - default from: 'from@example.com' - layout 'mailer' -end diff --git a/spec/dummy/app/views/layouts/application.html.erb b/spec/dummy/app/views/layouts/application.html.erb deleted file mode 100644 index a6eb017..0000000 --- a/spec/dummy/app/views/layouts/application.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - - - - Dummy - <%= csrf_meta_tags %> - - <%= stylesheet_link_tag 'application', media: 'all' %> - <%= javascript_include_tag 'application' %> - - - - <%= yield %> - - diff --git a/spec/dummy/bin/bundle b/spec/dummy/bin/bundle deleted file mode 100755 index 2dbb717..0000000 --- a/spec/dummy/bin/bundle +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) -load Gem.bin_path('bundler', 'bundle') diff --git a/spec/dummy/bin/rails b/spec/dummy/bin/rails deleted file mode 100755 index a31728a..0000000 --- a/spec/dummy/bin/rails +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -APP_PATH = File.expand_path('../config/application', __dir__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/spec/dummy/bin/rake b/spec/dummy/bin/rake deleted file mode 100755 index c199955..0000000 --- a/spec/dummy/bin/rake +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/spec/dummy/bin/setup b/spec/dummy/bin/setup deleted file mode 100755 index 3b7333e..0000000 --- a/spec/dummy/bin/setup +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require 'pathname' -require 'fileutils' -include FileUtils - -# path to your application root. -APP_ROOT = Pathname.new File.expand_path('..', __dir__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -chdir APP_ROOT do - # This script is a starting point to setup your application. - # Add necessary setup steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') - - # Install JavaScript dependencies if using Yarn - # system('bin/yarn') - - # puts "\n== Copying sample files ==" - # unless File.exist?('config/database.yml') - # cp 'config/database.yml.sample', 'config/database.yml' - # end - - puts "\n== Preparing database ==" - system! 'bin/rails db:setup' - - 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/spec/dummy/bin/update b/spec/dummy/bin/update deleted file mode 100755 index 1d6aa6a..0000000 --- a/spec/dummy/bin/update +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require 'pathname' -require 'fileutils' -include FileUtils - -# path to your application root. -APP_ROOT = Pathname.new File.expand_path('..', __dir__) - -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/spec/dummy/bin/yarn b/spec/dummy/bin/yarn deleted file mode 100755 index d9c7a36..0000000 --- a/spec/dummy/bin/yarn +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -VENDOR_PATH = File.expand_path('..', __dir__) -Dir.chdir(VENDOR_PATH) do - begin - exec "yarnpkg #{ARGV.join(' ')}" - rescue Errno::ENOENT - warn 'Yarn executable was not detected in the system.' - warn 'Download Yarn at https://yarnpkg.com/en/docs/install' - exit 1 - end -end diff --git a/spec/dummy/config.ru b/spec/dummy/config.ru deleted file mode 100644 index 842bccc..0000000 --- a/spec/dummy/config.ru +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -# This file is used by Rack-based servers to start the application. - -require_relative 'config/environment' - -run Rails.application diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb deleted file mode 100644 index 694c629..0000000 --- a/spec/dummy/config/application.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -require_relative 'boot' - -# Pick the frameworks you want: -require 'rails/all' - -Bundler.require(*Rails.groups) -require 'where_chain' - -module Dummy - class Application < Rails::Application - # Initialize configuration defaults for originally generated Rails version. - # config.load_defaults 5.1 - - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - end -end diff --git a/spec/dummy/config/boot.rb b/spec/dummy/config/boot.rb deleted file mode 100644 index 6d2cba0..0000000 --- a/spec/dummy/config/boot.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__) - -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) -$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__) diff --git a/spec/dummy/config/database.yml b/spec/dummy/config/database.yml deleted file mode 100644 index 3d4c446..0000000 --- a/spec/dummy/config/database.yml +++ /dev/null @@ -1,31 +0,0 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -# -default: - adapter: sqlite3 - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 - -development: - adapter: sqlite3 - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 - database: db/development.sqlite3 - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - adapter: sqlite3 - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 - database: db/test.sqlite3 - -production: - adapter: sqlite3 - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 - database: db/production.sqlite3 diff --git a/spec/dummy/config/environment.rb b/spec/dummy/config/environment.rb deleted file mode 100644 index d5abe55..0000000 --- a/spec/dummy/config/environment.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -# Load the Rails application. -require_relative 'application' - -# Initialize the Rails application. -Rails.application.initialize! diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb deleted file mode 100644 index b4ade96..0000000 --- a/spec/dummy/config/environments/development.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports. - config.consider_all_requests_local = true - - # Enable/disable caching. By default caching is disabled. - 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=#{2.days.seconds.to_i}" - } - else - config.action_controller.perform_caching = false - - config.cache_store = :null_store - end - - # Don't care if the mailer can't send. - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true - - # Suppress logger output for asset requests. - config.assets.quiet = true - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true - - # Use an evented file watcher to asynchronously detect changes in source code, - # routes, locales, etc. This feature depends on the listen gem. - # config.file_watcher = ActiveSupport::EventedFileUpdateChecker -end diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb deleted file mode 100644 index e3a5d3e..0000000 --- a/spec/dummy/config/environments/test.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr - - config.active_record.sqlite3&.represent_boolean_as_integer = true - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true -end diff --git a/spec/dummy/config/initializers/assets.rb b/spec/dummy/config/initializers/assets.rb deleted file mode 100644 index be1cebb..0000000 --- a/spec/dummy/config/initializers/assets.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# 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 = '1.0' - -# Add additional assets to the asset load path. -# Rails.application.config.assets.paths << Emoji.images_path -# Add Yarn node_modules folder to the asset load path. -# Rails.application.config.assets.paths << Rails.root.join('node_modules') - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/spec/dummy/config/initializers/backtrace_silencers.rb b/spec/dummy/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 8a25435..0000000 --- a/spec/dummy/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -# 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/spec/dummy/config/initializers/cookies_serializer.rb b/spec/dummy/config/initializers/cookies_serializer.rb deleted file mode 100644 index ee8dff9..0000000 --- a/spec/dummy/config/initializers/cookies_serializer.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -# 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/spec/dummy/config/initializers/filter_parameter_logging.rb b/spec/dummy/config/initializers/filter_parameter_logging.rb deleted file mode 100644 index 7a4f47b..0000000 --- a/spec/dummy/config/initializers/filter_parameter_logging.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -# 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/spec/dummy/config/initializers/inflections.rb b/spec/dummy/config/initializers/inflections.rb deleted file mode 100644 index dc84742..0000000 --- a/spec/dummy/config/initializers/inflections.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# 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/spec/dummy/config/initializers/mime_types.rb b/spec/dummy/config/initializers/mime_types.rb deleted file mode 100644 index be6fedc..0000000 --- a/spec/dummy/config/initializers/mime_types.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -# 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/spec/dummy/config/initializers/wrap_parameters.rb b/spec/dummy/config/initializers/wrap_parameters.rb deleted file mode 100644 index 2f3c0db..0000000 --- a/spec/dummy/config/initializers/wrap_parameters.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# 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/spec/dummy/config/locales/en.yml b/spec/dummy/config/locales/en.yml deleted file mode 100644 index decc5a8..0000000 --- a/spec/dummy/config/locales/en.yml +++ /dev/null @@ -1,33 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# The following keys must be escaped otherwise they will not be retrieved by -# the default I18n backend: -# -# true, false, on, off, yes, no -# -# Instead, surround them with single quotes. -# -# en: -# 'true': 'foo' -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff --git a/spec/dummy/config/puma.rb b/spec/dummy/config/puma.rb deleted file mode 100644 index 6ec461f..0000000 --- a/spec/dummy/config/puma.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Puma can serve each request in a thread from an internal thread pool. -# The `threads` method setting takes two numbers: a minimum and maximum. -# Any libraries that use thread pools should be configured to match -# the maximum value specified for Puma. Default is set to 5 threads for minimum -# and maximum; this matches the default thread size of Active Record. -# -threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 } -threads threads_count, threads_count - -# Specifies the `port` that Puma will listen on to receive requests; default is 3000. -# -port ENV.fetch('PORT') { 3000 } - -# Specifies the `environment` that Puma will run in. -# -environment ENV.fetch('RAILS_ENV') { 'development' } - -# Specifies the number of `workers` to boot in clustered mode. -# Workers are forked webserver processes. If using threads and workers together -# the concurrency of the application would be max `threads` * `workers`. -# Workers do not work on JRuby or Windows (both of which do not support -# processes). -# -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } - -# Use the `preload_app!` method when specifying a `workers` number. -# This directive tells Puma to first boot the application and load code -# before forking the application. This takes advantage of Copy On Write -# process behavior so workers use less memory. If you use this option -# you need to make sure to reconnect any threads in the `on_worker_boot` -# block. -# -# preload_app! - -# If you are preloading your application and using Active Record, it's -# recommended that you close any connections to the database before workers -# are forked to prevent connection leakage. -# -# before_fork do -# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord) -# end - -# The code in the `on_worker_boot` will be called if you are using -# clustered mode by specifying a number of `workers`. After each worker -# process is booted, this block will be run. If you are using the `preload_app!` -# option, you will want to use this block to reconnect to any threads -# or connections that may have been created at application boot, as Ruby -# cannot share connections between processes. -# -# on_worker_boot do -# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) -# end -# - -# Allow puma to be restarted by `rails restart` command. -plugin :tmp_restart diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb deleted file mode 100644 index 47cc16e..0000000 --- a/spec/dummy/config/routes.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -Rails.application.routes.draw do - # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html -end diff --git a/spec/dummy/config/secrets.yml b/spec/dummy/config/secrets.yml deleted file mode 100644 index f3ab75c..0000000 --- a/spec/dummy/config/secrets.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rails secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -# Shared secrets are available across all environments. - -# shared: -# api_key: a1B2c3D4e5F6 - -# Environmental secrets are only available for that specific environment. - -development: - secret_key_base: 1bb4f4adfb387839f89381739ac630d5cb4abeba2086630d93081c42f1022b539e426651af29c687d16455c0f2b5729521555a2d3104e6d4087bad81dc3869e7 - -test: - secret_key_base: 3e21f73106123eb3d3375c9e5ab4649a6e51ea398a8e80211c2898bc52cbd71078999e881aacb70c0d5bcead8e1b5a959a48e6d9e3fd0201c02308593ada4939 - -# Do not keep production secrets in the unencrypted secrets file. -# Instead, either read values from the environment. -# Or, use `bin/rails secrets:setup` to configure encrypted secrets -# and move the `production:` environment over there. - -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/spec/dummy/config/spring.rb b/spec/dummy/config/spring.rb deleted file mode 100644 index c5933e4..0000000 --- a/spec/dummy/config/spring.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -%w[ - .ruby-version - .rbenv-vars - tmp/restart.txt - tmp/caching-dev.txt -].each { |path| Spring.watch(path) } diff --git a/spec/dummy/db/migrate/20180317082500_create_conferences.rb b/spec/dummy/db/migrate/20180317082500_create_conferences.rb deleted file mode 100644 index 8079911..0000000 --- a/spec/dummy/db/migrate/20180317082500_create_conferences.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class CreateConferences < ActiveRecord::Migration[5.1] - def change - create_table :conferences do |t| - t.integer :number - t.string :name - t.datetime :date - - t.timestamps - end - end -end diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb deleted file mode 100644 index 5727645..0000000 --- a/spec/dummy/db/schema.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# 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: 20_180_317_082_500) do - create_table 'conferences', force: :cascade do |t| - t.integer 'number' - t.string 'name' - t.datetime 'date' - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false - end -end diff --git a/spec/dummy/lib/assets/.keep b/spec/dummy/lib/assets/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/log/.keep b/spec/dummy/log/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/package.json b/spec/dummy/package.json deleted file mode 100644 index caa2d7b..0000000 --- a/spec/dummy/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "dummy", - "private": true, - "dependencies": {} -} diff --git a/spec/dummy/public/404.html b/spec/dummy/public/404.html deleted file mode 100644 index 2be3af2..0000000 --- a/spec/dummy/public/404.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - 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/spec/dummy/public/422.html b/spec/dummy/public/422.html deleted file mode 100644 index c08eac0..0000000 --- a/spec/dummy/public/422.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - 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/spec/dummy/public/500.html b/spec/dummy/public/500.html deleted file mode 100644 index 78a030a..0000000 --- a/spec/dummy/public/500.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - 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/spec/dummy/public/apple-touch-icon-precomposed.png b/spec/dummy/public/apple-touch-icon-precomposed.png deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/public/apple-touch-icon.png b/spec/dummy/public/apple-touch-icon.png deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/app/assets/config/manifest.js b/spec/internal/app/assets/config/manifest.js similarity index 100% rename from spec/dummy/app/assets/config/manifest.js rename to spec/internal/app/assets/config/manifest.js diff --git a/spec/dummy/app/models/conference.rb b/spec/internal/app/models/conference.rb similarity index 100% rename from spec/dummy/app/models/conference.rb rename to spec/internal/app/models/conference.rb diff --git a/spec/internal/config/database.yml b/spec/internal/config/database.yml new file mode 100644 index 0000000..b978119 --- /dev/null +++ b/spec/internal/config/database.yml @@ -0,0 +1,3 @@ +test: + adapter: sqlite3 + database: db/combustion_test.sqlite diff --git a/spec/internal/config/routes.rb b/spec/internal/config/routes.rb new file mode 100644 index 0000000..878c813 --- /dev/null +++ b/spec/internal/config/routes.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +Rails.application.routes.draw do + # Add your own routes here, or remove this file if you don't have need for it. +end diff --git a/spec/internal/db/schema.rb b/spec/internal/db/schema.rb new file mode 100644 index 0000000..3ac36dc --- /dev/null +++ b/spec/internal/db/schema.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +ActiveRecord::Schema.define do + # Set up any tables you need to exist for your test suite that don't belong + # in migrations. + create_table 'conferences', force: :cascade do |t| + t.integer 'number' + t.string 'name' + t.datetime 'date' + t.datetime 'created_at', null: false + t.datetime 'updated_at', null: false + end +end diff --git a/spec/internal/log/.gitignore b/spec/internal/log/.gitignore new file mode 100644 index 0000000..bf0824e --- /dev/null +++ b/spec/internal/log/.gitignore @@ -0,0 +1 @@ +*.log \ No newline at end of file diff --git a/spec/dummy/public/favicon.ico b/spec/internal/public/favicon.ico similarity index 100% rename from spec/dummy/public/favicon.ico rename to spec/internal/public/favicon.ico diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index b31899f..09c58c8 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -2,22 +2,25 @@ ENV['RAILS_ENV'] ||= 'test' -app_path = File.expand_path('dummy', __dir__) -$LOAD_PATH.unshift(app_path) unless $LOAD_PATH.include?(app_path) +# app_path = File.expand_path('dummy', __dir__) +# $LOAD_PATH.unshift(app_path) unless $LOAD_PATH.include?(app_path) + +# require 'config/environment' +require 'combustion' +Combustion.initialize! :active_record -require 'config/environment' require 'rspec/rails' require 'factory_bot' -require 'database_cleaner' +# require 'database_cleaner' require 'pry' puts "Testing Rails v#{Rails.version}" -Rails.backtrace_cleaner.remove_silencers! +# Rails.backtrace_cleaner.remove_silencers! -Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } +# Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } -ActiveRecord::Migration.maintain_test_schema! +# ActiveRecord::Migration.maintain_test_schema! RSpec.configure do |config| require 'rspec/expectations' @@ -32,16 +35,16 @@ FactoryBot.find_definitions end - config.before(:suite) do - DatabaseCleaner.strategy = :transaction - DatabaseCleaner.clean_with(:truncation, except: %w[ar_internal_metadata schema_migrations]) - end + # config.before(:suite) do + # DatabaseCleaner.strategy = :transaction + # DatabaseCleaner.clean_with(:truncation, except: %w[ar_internal_metadata schema_migrations]) + # end - config.around(:each) do |example| - DatabaseCleaner.cleaning do - example.run - end - end + # config.around(:each) do |example| + # DatabaseCleaner.cleaning do + # example.run + # end + # end config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true @@ -51,6 +54,7 @@ config.infer_spec_type_from_file_location! config.filter_rails_from_backtrace! config.shared_context_metadata_behavior = :apply_to_host_groups + config.use_transactional_fixtures = true Kernel.srand config.seed end diff --git a/where_chain.gemspec b/where_chain.gemspec index fbb0c53..b420e5e 100644 --- a/where_chain.gemspec +++ b/where_chain.gemspec @@ -22,14 +22,14 @@ Gem::Specification.new do |s| s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] - s.add_dependency 'activerecord', '>= 4.2' + s.add_runtime_dependency 'activerecord', '>= 4.2' s.add_development_dependency 'appraisal' - s.add_development_dependency 'database_cleaner' + s.add_development_dependency 'combustion', '~> 1.4' s.add_development_dependency 'factory_bot_rails' s.add_development_dependency 'pry-rails' - s.add_development_dependency 'rspec-rails' s.add_development_dependency 'rspec_junit_formatter' + s.add_development_dependency 'rspec-rails' s.add_development_dependency 'rubocop' - s.add_development_dependency 'sqlite3' + s.add_development_dependency 'sqlite3', '~> 1.4' end