-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from FundingCircle/rails50-support
Rails 5 Support & Co
- Loading branch information
Showing
51 changed files
with
874 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 5.0.0" | ||
|
||
group :test do | ||
gem "codeclimate-test-reporter", :require => false | ||
end | ||
|
||
gemspec :path => "../" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Loga | ||
VERSION = '1.3.0'.freeze | ||
VERSION = '1.4.0'.freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
# Generating fixture Apps | ||
|
||
## Rails 3.2 | ||
`appraisal rails_3.2 rails new spec/fixtures/rails32 --skip-gemfile --skip-git --skip-active-record --skip-sprockets --skip-javascript --skip-test-unit` | ||
`appraisal rails32 rails new spec/fixtures/rails32 --skip-gemfile --skip-git --skip-active-record --skip-sprockets --skip-javascript --skip-test-unit` | ||
|
||
|
||
## Rails 4.0 | ||
`appraisal rails_4.0 rails new spec/fixtures/rails40 --skip-gemfile --skip-git --skip-keeps --skip-active-record --skip-action-view --skip-sprockets --skip-spring --skip-javascript --skip-test-unit` | ||
`appraisal rails40 rails new spec/fixtures/rails40 --skip-gemfile --skip-git --skip-keeps --skip-active-record --skip-action-view --skip-sprockets --skip-spring --skip-javascript --skip-test-unit` | ||
|
||
## Rails 5.0 | ||
`appraisal rails50 rails new spec/fixtures/rails50 --skip-gemfile --skip-git --skip-keeps --skip-active-record --skip-action-view --skip-sprockets --skip-spring --skip-javascript --skip-test-unit` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# 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 |
28 changes: 28 additions & 0 deletions
28
spec/fixtures/rails50/app/controllers/application_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class ApplicationController < ActionController::Base | ||
protect_from_forgery with: :null_session | ||
|
||
def ok | ||
render text: 'Hello Rails' | ||
end | ||
|
||
def error | ||
nil.name | ||
end | ||
|
||
def show | ||
render json: params | ||
end | ||
|
||
def create | ||
render json: params | ||
end | ||
|
||
def new | ||
redirect_to :ok | ||
end | ||
|
||
def update | ||
@id = params[:id] | ||
render '/user' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module ApplicationHelper | ||
end |
13 changes: 13 additions & 0 deletions
13
spec/fixtures/rails50/app/views/layouts/application.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Rails50</title> | ||
<%= csrf_meta_tags %> | ||
|
||
<%= stylesheet_link_tag 'application', media: 'all' %> | ||
</head> | ||
|
||
<body> | ||
<%= yield %> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>User <%= @id %></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | ||
load Gem.bin_path('bundler', 'bundle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
APP_PATH = File.expand_path('../config/application', __dir__) | ||
require_relative '../config/boot' | ||
require 'rails/commands' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
require_relative '../config/boot' | ||
require 'rake' | ||
Rake.application.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/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 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') | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This file is used by Rack-based servers to start the application. | ||
|
||
require_relative 'config/environment' | ||
|
||
run Rails.application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require_relative 'boot' | ||
|
||
require "rails" | ||
# Pick the frameworks you want: | ||
require "active_model/railtie" | ||
require "active_job/railtie" | ||
# require "active_record/railtie" | ||
require "action_controller/railtie" | ||
require "action_mailer/railtie" | ||
require "action_view/railtie" | ||
require "action_cable/engine" | ||
# require "sprockets/railtie" | ||
# require "rails/test_unit/railtie" | ||
|
||
# Require the gems listed in Gemfile, including any gems | ||
# you've limited to :test, :development, or :production. | ||
Bundler.require(*Rails.groups) | ||
|
||
STREAM = StringIO.new unless defined?(STREAM) | ||
|
||
module Rails50 | ||
class Application < Rails::Application | ||
# 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. | ||
config.log_tags = [ :request_id, 'TEST_TAG' ] | ||
config.loga.configure do |loga| | ||
loga.service_name = 'hello_world_app' | ||
loga.service_version = '1.0' | ||
loga.host = 'bird.example.com' | ||
loga.device = STREAM | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) | ||
|
||
require 'bundler/setup' # Set up gems listed in the Gemfile. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
development: | ||
adapter: async | ||
|
||
test: | ||
adapter: async | ||
|
||
production: | ||
adapter: redis | ||
url: redis://localhost:6379/1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Load the Rails application. | ||
require_relative 'application' | ||
|
||
# Initialize the Rails application. | ||
Rails.application.initialize! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
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=172800' | ||
} | ||
else | ||
config.action_controller.perform_caching = false | ||
|
||
config.cache_store = :null_store | ||
end | ||
|
||
# Don't care if the mailer can't send. | ||
config.action_mailer.raise_delivery_errors = false | ||
|
||
config.action_mailer.perform_caching = false | ||
|
||
# Print deprecation notices to the Rails logger. | ||
config.active_support.deprecation = :log | ||
|
||
|
||
# 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 |
Oops, something went wrong.