Skip to content

Commit

Permalink
Merge pull request #10 from testdouble/update-everything
Browse files Browse the repository at this point in the history
Get back to passing
  • Loading branch information
searls authored Jun 16, 2020
2 parents 8593de8 + 3e6cc4e commit 1921d7d
Show file tree
Hide file tree
Showing 30 changed files with 234 additions and 128 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/.bundle/
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
Expand Down
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
language: ruby
sudo: false
rvm:
- 2.2.3
- 2.7.1
before_install:
- BUNDLE_GEMFILE="example/Gemfile" bundle install
env:
- RAILS_VERSION=3.1.0
- RAILS_VERSION=4.0.0
- RAILS_VERSION=4.2.0
- RAILS_VERSION=5.0.0.beta2
- RAILS_VERSION=5.2.4.3
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'
source "https://rubygems.org"

# Specify your gem's dependencies in good_migrations.gemspec
gemspec
111 changes: 111 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
PATH
remote: .
specs:
good_migrations (0.0.2)
activerecord (>= 3.1)
railties (>= 3.1)

GEM
remote: https://rubygems.org/
specs:
actionpack (6.0.3.1)
actionview (= 6.0.3.1)
activesupport (= 6.0.3.1)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (6.0.3.1)
activesupport (= 6.0.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activemodel (6.0.3.1)
activesupport (= 6.0.3.1)
activerecord (6.0.3.1)
activemodel (= 6.0.3.1)
activesupport (= 6.0.3.1)
activesupport (6.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
ast (2.4.1)
builder (3.2.4)
coderay (1.1.3)
concurrent-ruby (1.1.6)
crass (1.0.6)
erubi (1.9.0)
i18n (1.8.3)
concurrent-ruby (~> 1.0)
loofah (2.5.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
method_source (1.0.0)
mini_portile2 (2.4.0)
minitest (5.14.1)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
parallel (1.19.1)
parser (2.7.1.3)
ast (~> 2.4.0)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.0.3.1)
actionpack (= 6.0.3.1)
activesupport (= 6.0.3.1)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
regexp_parser (1.7.1)
rexml (3.2.4)
rubocop (0.85.1)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.7)
rexml
rubocop-ast (>= 0.0.3)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (0.0.3)
parser (>= 2.7.0.1)
rubocop-performance (1.6.1)
rubocop (>= 0.71.0)
ruby-progressbar (1.10.1)
standard (0.4.7)
rubocop (~> 0.85.0)
rubocop-performance (~> 1.6.0)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
unicode-display_width (1.7.0)
zeitwerk (2.3.0)

PLATFORMS
ruby

DEPENDENCIES
bundler
good_migrations!
minitest
pry
rake
standard

BUNDLED WITH
2.1.4
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
require "bundler/gem_tasks"
require "rake/testtask"
require "standard/rake"

Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/*_test.rb']
t.test_files = FileList["test/**/*_test.rb"]
end

task :default => :test
task default: ["standard:fix", :test]
11 changes: 5 additions & 6 deletions example/Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
source 'https://rubygems.org'
source "https://rubygems.org"

rails_version = ENV['RAILS_VERSION'] || '3.1.0'
rails_version = ENV["RAILS_VERSION"] || "5.2.4.3"
puts "<---- Installing Rails at version '#{rails_version}'"
gem 'rails', rails_version
gem "rails", rails_version

gem 'good_migrations', :path => '..'

gem 'sqlite3-ruby', :require => 'sqlite3'
gem "good_migrations", path: ".."

gem "sqlite3"
4 changes: 2 additions & 2 deletions example/Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require 'rake'
require File.expand_path("../config/application", __FILE__)
require "rake"

Example::Application.load_tasks
Empty file.
1 change: 0 additions & 1 deletion example/app/models/pant.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
class Pant < ActiveRecord::Base
end

2 changes: 1 addition & 1 deletion example/config.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment', __FILE__)
require ::File.expand_path("../config/environment", __FILE__)
run Example::Application
4 changes: 2 additions & 2 deletions example/config/application.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.expand_path('../boot', __FILE__)
require File.expand_path("../boot", __FILE__)

require 'rails/all'
require "rails/all"

# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Expand Down
24 changes: 13 additions & 11 deletions example/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
require 'rubygems'
require "rubygems"

# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)
gemfile = File.expand_path("../../Gemfile", __FILE__)
if File.exist?(gemfile)
begin
ENV["BUNDLE_GEMFILE"] = gemfile
require "bundler"
Bundler.setup
rescue Bundler::GemNotFound => e
warn e.message
warn "Try running `bundle install`."
exit!
end
end
2 changes: 1 addition & 1 deletion example/config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Load the rails application
require File.expand_path('../application', __FILE__)
require File.expand_path("../application", __FILE__)

# Initialize the rails application
Example::Application.initialize!
3 changes: 1 addition & 2 deletions example/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
config.whiny_nils = true

# Show full error reports and disable caching
config.consider_all_requests_local = true
config.consider_all_requests_local = true
config.action_controller.perform_caching = false

# Don't care if the mailer can't send
Expand All @@ -22,4 +22,3 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
end

2 changes: 1 addition & 1 deletion example/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
config.cache_classes = true

# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Specifies the header that your server uses for sending files
Expand Down
4 changes: 2 additions & 2 deletions example/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
config.whiny_nils = true

# Show full error reports and disable caching
config.consider_all_requests_local = true
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
config.action_controller.allow_forgery_protection = false

# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
Expand Down
2 changes: 1 addition & 1 deletion example/config/initializers/secret_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# 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.
Example::Application.config.secret_token = '5b687ab969ef4f33a41125ae95e73c368d1c391045639df9a1690221b13f8b8cbeb515db9cf5990548af5c309b8d3ab206648837001866cdf854278030285e3c'
Example::Application.config.secret_token = "5b687ab969ef4f33a41125ae95e73c368d1c391045639df9a1690221b13f8b8cbeb515db9cf5990548af5c309b8d3ab206648837001866cdf854278030285e3c"
2 changes: 1 addition & 1 deletion example/config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.

Example::Application.config.session_store :cookie_store, :key => '_example_session'
Example::Application.config.session_store :cookie_store, key: "_example_session"

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
Expand Down
2 changes: 1 addition & 1 deletion example/db/migrate/20160202162849_create_pants.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreatePants < ActiveRecord::Migration
class CreatePants < ActiveRecord::Migration[4.2]
def change
create_table :pants do |t|
t.integer :length
Expand Down
2 changes: 1 addition & 1 deletion example/db/migrate/20160202163803_change_pants.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ChangePants < ActiveRecord::Migration
class ChangePants < ActiveRecord::Migration[4.2]
class Pant < ActiveRecord::Base
end
def change
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ChangePantsDangerously < ActiveRecord::Migration
class ChangePantsDangerously < ActiveRecord::Migration[4.2]
def up
Pant.find_each do |pant|
# uh oh!
Expand Down
6 changes: 3 additions & 3 deletions example/script/rails
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.

APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'
APP_PATH = File.expand_path("../../config/application", __FILE__)
require File.expand_path("../../config/boot", __FILE__)
require "rails/commands"
6 changes: 3 additions & 3 deletions example/test/performance/browsing_test.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'test_helper'
require 'rails/performance_test_help'
require "test_helper"
require "rails/performance_test_help"

# Profiling results for each test method are written to tmp/performance.
class BrowsingTest < ActionDispatch::PerformanceTest
def test_homepage
get '/'
get "/"
end
end
4 changes: 2 additions & 2 deletions example/test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require File.expand_path("../../config/environment", __FILE__)
require "rails/test_help"

class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
Expand Down
32 changes: 16 additions & 16 deletions good_migrations.gemspec
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'good_migrations/version'
require "good_migrations/version"

Gem::Specification.new do |spec|
spec.name = "good_migrations"
spec.version = GoodMigrations::VERSION
spec.authors = ["Justin Searls", "Kevin Baribeau"]
spec.email = ["[email protected]", "[email protected]"]
spec.name = "good_migrations"
spec.version = GoodMigrations::VERSION
spec.authors = ["Justin Searls", "Kevin Baribeau"]
spec.email = ["[email protected]", "[email protected]"]

spec.summary = %q{Prevents Rails from auto-loading app code in database migrations}
spec.description = %q{Referencing code in app/ from a database migration risks breaking the migration when your app code changes; this gem prevents that mistake}
spec.homepage = "https://github.com/testdouble/good-migrations"
spec.license = "MIT"
spec.summary = "Prevents Rails from auto-loading app code in database migrations"
spec.description = "Referencing code in app/ from a database migration risks breaking the migration when your app code changes; this gem prevents that mistake"
spec.homepage = "https://github.com/testdouble/good-migrations"
spec.license = "MIT"

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "railties", ">= 3.1"
spec.add_dependency "activerecord", ">= 3.1"

spec.add_development_dependency "bundler", "~> 1.10"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "minitest"
spec.add_development_dependency "pry"
spec.add_development_dependency "standard"
end
2 changes: 1 addition & 1 deletion lib/good_migrations/load_error.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module GoodMigrations
class LoadError < ::LoadError
class LoadError < RuntimeError
end
end
2 changes: 1 addition & 1 deletion lib/good_migrations/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module GoodMigrations
class Railtie < Rails::Railtie
rake_tasks do
Dir[File.join(File.dirname(__FILE__), '../../tasks/*.rake')].each do |file|
Dir[File.join(File.dirname(__FILE__), "../../tasks/*.rake")].each do |file|
load file
end
end
Expand Down
Loading

0 comments on commit 1921d7d

Please sign in to comment.