Skip to content

Commit f256850

Browse files
committed
Added test_app_5_2
Updated gemfile Updated travis
1 parent aa4094a commit f256850

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+895
-11
lines changed

.travis.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@ language: ruby
22
sudo: false
33
cache: bundler
44
rvm:
5-
- 2.2.9
6-
- 2.3.6
7-
- 2.4.3
8-
- 2.5.0
5+
- 2.2.10
6+
- 2.3.7
7+
- 2.4.4
8+
- 2.5.1
99
gemfile:
1010
- gemfiles/rails_4.0.gemfile
1111
- gemfiles/rails_4.1.gemfile
1212
- gemfiles/rails_4.2.gemfile
1313
- gemfiles/rails_5.0.gemfile
1414
- gemfiles/rails_5.1.gemfile
15+
- gemfiles/rails_5.2.gemfile
1516
matrix:
1617
exclude:
17-
- rvm: 2.4.3
18+
- rvm: 2.4.4
1819
gemfile: gemfiles/rails_4.0.gemfile
19-
- rvm: 2.4.3
20+
- rvm: 2.4.4
2021
gemfile: gemfiles/rails_4.1.gemfile
21-
- rvm: 2.5.0
22+
- rvm: 2.5.1
2223
gemfile: gemfiles/rails_4.0.gemfile
23-
- rvm: 2.5.0
24+
- rvm: 2.5.1
2425
gemfile: gemfiles/rails_4.1.gemfile
2526
before_install:
2627
- gem update --system

Appraisals

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
%w[4.0 4.1 4.2 5.0 5.1].each do |rails_version|
3+
%w[4.0 4.1 4.2 5.0 5.1 5.2].each do |rails_version|
44
appraise "rails-#{rails_version}" do
55
gem 'rails', "~> #{rails_version}.0"
66
end

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# BaseRailsGem
2-
A basic gem structure for rails with test_apps from 4.0 to 5.1
2+
A basic gem structure for rails with test_apps from 4.0 to 5.2
33

44
Travis configured for ruby 2.2 to 2.5
55

@@ -14,6 +14,8 @@ bundle exec appraisal rails-4.1 rspec
1414
bundle exec appraisal rails-4.2 rspec
1515
bundle exec appraisal rails-5.0 rspec
1616
bundle exec appraisal rails-5.1 rspec
17+
bundle exec appraisal rails-5.2 rspec
18+
1719
```
1820
## Contributing
1921
Contribution directions go here.

gemfiles/rails_5.2.gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", "~> 5.2.0"
6+
7+
gemspec path: "../"

spec/rails_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
require 'spec_helper'
44
ENV['RAILS_ENV'] ||= 'test'
5-
if ENV['BUNDLE_GEMFILE'] =~ /5.1/
5+
if ENV['BUNDLE_GEMFILE'] =~ /5.2/
6+
require File.expand_path('../test_app_5_2/config/environment', __FILE__)
7+
elsif ENV['BUNDLE_GEMFILE'] =~ /5.1/
68
require File.expand_path('../test_app_5_1/config/environment', __FILE__)
79
elsif ENV['BUNDLE_GEMFILE'] =~ /5.0/
810
require File.expand_path('../test_app_5_0/config/environment', __FILE__)

spec/test_app_5_2/Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require_relative 'config/application'
5+
6+
Rails.application.load_tasks
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//= link_tree ../images
2+
//= link_directory ../javascripts .js
3+
//= link_directory ../stylesheets .css
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
9+
//
10+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require rails-ujs
14+
//= require activestorage
15+
//= require_tree .
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Action Cable provides the framework to deal with WebSockets in Rails.
2+
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
3+
//
4+
//= require action_cable
5+
//= require_self
6+
//= require_tree ./channels
7+
8+
(function() {
9+
this.App || (this.App = {});
10+
11+
App.cable = ActionCable.createConsumer();
12+
13+
}).call(this);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* This is a manifest file that'll be compiled into application.css, which will include all the files
3+
* listed below.
4+
*
5+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7+
*
8+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10+
* files in this directory. Styles in this file should be added after the last require_* statement.
11+
* It is generally better to create a new file per style scope.
12+
*
13+
*= require_tree .
14+
*= require_self
15+
*/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ApplicationCable
2+
class Channel < ActionCable::Channel::Base
3+
end
4+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ApplicationCable
2+
class Connection < ActionCable::Connection::Base
3+
end
4+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationController < ActionController::Base
2+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationJob < ActiveJob::Base
2+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class ApplicationMailer < ActionMailer::Base
2+
default from: '[email protected]'
3+
layout 'mailer'
4+
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class ApplicationRecord < ActiveRecord::Base
2+
self.abstract_class = true
3+
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>TestApp52</title>
5+
<%= csrf_meta_tags %>
6+
<%= csp_meta_tag %>
7+
8+
<%= stylesheet_link_tag 'application', media: 'all' %>
9+
<%= javascript_include_tag 'application' %>
10+
</head>
11+
12+
<body>
13+
<%= yield %>
14+
</body>
15+
</html>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<style>
6+
/* Email styles need to be inline */
7+
</style>
8+
</head>
9+
10+
<body>
11+
<%= yield %>
12+
</body>
13+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= yield %>

spec/test_app_5_2/bin/bundle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env ruby
2+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3+
load Gem.bin_path('bundler', 'bundle')

spec/test_app_5_2/bin/rails

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
APP_PATH = File.expand_path('../config/application', __dir__)
3+
require_relative '../config/boot'
4+
require 'rails/commands'

spec/test_app_5_2/bin/rake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
require_relative '../config/boot'
3+
require 'rake'
4+
Rake.application.run

spec/test_app_5_2/bin/setup

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env ruby
2+
require 'fileutils'
3+
include FileUtils
4+
5+
# path to your application root.
6+
APP_ROOT = File.expand_path('..', __dir__)
7+
8+
def system!(*args)
9+
system(*args) || abort("\n== Command #{args} failed ==")
10+
end
11+
12+
chdir APP_ROOT do
13+
# This script is a starting point to setup your application.
14+
# Add necessary setup steps to this file.
15+
16+
puts '== Installing dependencies =='
17+
system! 'gem install bundler --conservative'
18+
system('bundle check') || system!('bundle install')
19+
20+
# Install JavaScript dependencies if using Yarn
21+
# system('bin/yarn')
22+
23+
# puts "\n== Copying sample files =="
24+
# unless File.exist?('config/database.yml')
25+
# cp 'config/database.yml.sample', 'config/database.yml'
26+
# end
27+
28+
puts "\n== Preparing database =="
29+
system! 'bin/rails db:setup'
30+
31+
puts "\n== Removing old logs and tempfiles =="
32+
system! 'bin/rails log:clear tmp:clear'
33+
34+
puts "\n== Restarting application server =="
35+
system! 'bin/rails restart'
36+
end

spec/test_app_5_2/bin/update

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env ruby
2+
require 'fileutils'
3+
include FileUtils
4+
5+
# path to your application root.
6+
APP_ROOT = File.expand_path('..', __dir__)
7+
8+
def system!(*args)
9+
system(*args) || abort("\n== Command #{args} failed ==")
10+
end
11+
12+
chdir APP_ROOT do
13+
# This script is a way to update your development environment automatically.
14+
# Add necessary update steps to this file.
15+
16+
puts '== Installing dependencies =='
17+
system! 'gem install bundler --conservative'
18+
system('bundle check') || system!('bundle install')
19+
20+
# Install JavaScript dependencies if using Yarn
21+
# system('bin/yarn')
22+
23+
puts "\n== Updating database =="
24+
system! 'bin/rails db:migrate'
25+
26+
puts "\n== Removing old logs and tempfiles =="
27+
system! 'bin/rails log:clear tmp:clear'
28+
29+
puts "\n== Restarting application server =="
30+
system! 'bin/rails restart'
31+
end

spec/test_app_5_2/bin/yarn

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env ruby
2+
APP_ROOT = File.expand_path('..', __dir__)
3+
Dir.chdir(APP_ROOT) do
4+
begin
5+
exec "yarnpkg", *ARGV
6+
rescue Errno::ENOENT
7+
$stderr.puts "Yarn executable was not detected in the system."
8+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9+
exit 1
10+
end
11+
end

spec/test_app_5_2/config.ru

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file is used by Rack-based servers to start the application.
2+
3+
require_relative 'config/environment'
4+
5+
run Rails.application
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require_relative 'boot'
2+
3+
# Pick the frameworks you want:
4+
require "rails/all"
5+
Bundler.require(*Rails.groups)
6+
7+
module TestApp52
8+
class Application < Rails::Application
9+
# Initialize configuration defaults for originally generated Rails version.
10+
config.load_defaults 5.2
11+
12+
# Settings in config/environments/* take precedence over those specified here.
13+
# Application configuration can go into files in config/initializers
14+
# -- all .rb files in that directory are automatically loaded after loading
15+
# the framework and any gems in your application.
16+
end
17+
end
18+

spec/test_app_5_2/config/boot.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Set up gems listed in the Gemfile.
2+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
3+
4+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5+
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)

spec/test_app_5_2/config/cable.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
development:
2+
adapter: async
3+
4+
test:
5+
adapter: async
6+
7+
production:
8+
adapter: redis
9+
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10+
channel_prefix: test_app_5_2_production

spec/test_app_5_2/config/database.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SQLite version 3.x
2+
# gem install sqlite3
3+
#
4+
# Ensure the SQLite 3 gem is defined in your Gemfile
5+
# gem 'sqlite3'
6+
#
7+
default: &default
8+
adapter: sqlite3
9+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10+
timeout: 5000
11+
12+
development:
13+
<<: *default
14+
database: db/development.sqlite3
15+
16+
# Warning: The database defined as "test" will be erased and
17+
# re-generated from your development database when you run "rake".
18+
# Do not set this db to the same as development or production.
19+
test:
20+
<<: *default
21+
database: db/test.sqlite3
22+
23+
production:
24+
<<: *default
25+
database: db/production.sqlite3
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Load the Rails application.
2+
require_relative 'application'
3+
4+
# Initialize the Rails application.
5+
Rails.application.initialize!

0 commit comments

Comments
 (0)