Skip to content

Commit

Permalink
Upgrade to Rails 5.2 (#685)
Browse files Browse the repository at this point in the history
* Upgrade Gemfile to Rails 5.0

* require rake'

* Change config files

* Add application record

* Bump mysql

* Locking newer Rails v

* Running update task

* Adding missing bootsnap gem

* Fixing missing database

* Adding missing listen gem

* Fixing schema example version

* Fixing migration versions

* Updating dependencies for Rails 5

* Adding ApplicationMailer abstraction

* Adding required initializers

* Prefer require_relative instead of full path

* Making associations not required by default

* Regenerating schema file

* Hotfixing MassAssigment

* Upgrade web-console, remove mysql adapter override

* Remove attr_accessible

* Add rails-controller-testing gem

* Follow new syntax for tests

* Remove extra web-console from gemfile

* Regenerating lock file

* Fixing rubocop offenses and bundler version

* Using correct Paperclip class as in rails/rails#26404 (comment)

* Fix images functional tests

* images controller test typecast to string

* Fix rails logger

* Fix map tests

* Bumping rubocop version

* Autofixing rubocop offenses

* Including performance cop to rubocop

* Refactoring deprecated routing and secret_token

* Fixing routes for feed controller

* Using correct routes for RSS builder

* Fixing missing routes

* Fixing travis bundler and yarn cache

* Fixing bundle path

* Splitting bundle and yarn verifications

* Fixing prod host for travis, private class usage and rubocop offenses
  • Loading branch information
kaustubh-nair authored and alaxalves committed Jul 3, 2019
1 parent d5ed24a commit 18436ae
Show file tree
Hide file tree
Showing 124 changed files with 1,109 additions and 659 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require: rubocop-performance

# Start with Spotifys style guide as a base then customize from there
inherit_from:
- .rubocop_shopify_styleguide.yml
Expand Down
28 changes: 18 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: ruby

rvm:
- 2.4.6

Expand All @@ -7,20 +8,24 @@ services:
- docker

cache:
bundler: true
directories:
- public/lib/
- $PWD/public/lib/
- $PWD/vendor/.bundle/

install:
- cp config/database.yml.example config/database.yml
- cp config/config.yml.example config/config.yml
- cp db/schema.rb.example db/schema.rb
- ./lib/exporter-deps.sh > /dev/null 2>&1
- bundle install && yarn install
- bundle check --path vendor/.bundle/ || bundle install --path vendor/.bundle/
- yarn check || yarn install
- if [ $RAILS_ENV == 'production' ]; then
bundle exec rake db:create;
mysql -e "CREATE DATABASE mapknitter;";
mysql -e "CREATE USER 'mapknitter'@'%' IDENTIFIED BY 'mapknitter';";
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'mapknitter'@'%';";
bundle exec rails db:schema:load;
else
bundle exec rake db:setup || bundle exec rake db:migrate;
bundle exec rails db:setup || bundle exec rails db:migrate;
fi

env:
Expand All @@ -29,26 +34,29 @@ env:
- CI=true
- TRAVIS=true

# FIXME - Later change 'test/unit' and 'test/funcional' folders
# to 'test/unit' and 'test/funcional', respectively

jobs:
include:
- name: "Unit Tests"
script: bundle exec rake test:unit
script: bundle exec rails test:unit
- name: "Integration Tests"
script: bundle exec rake test:integration
script: bundle exec rails test:integration
- name: "Functional Tests"
script: bundle exec rake test:functional
script: bundle exec rails test:functional
- name: "Rubocop Linter"
script: bundle exec rubocop
- name: "Docker Builds"
script: docker build -t mapknitter .
- name: "Asset Precompilation"
env:
- RAILS_ENV=production
script: bundle exec rake assets:precompile
script:
- bundle exec rails assets:precompile

branches:
only:
- main
- unstable
- development

64 changes: 36 additions & 28 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,80 +1,88 @@
source "https://rubygems.org"
source 'https://rubygems.org'

ruby '2.4.6'
gem 'rails', '4.2.11.1'
gem 'rails', '~> 5.2.3'
gem 'rake', '~> 12.3.2'
gem 'tzinfo-data'
gem 'skylight'

gem "will_paginate", "3.1.7"
gem 'will_paginate-bootstrap4'
gem "friendly_id"
gem 'will_paginate', '3.1.7'
gem 'will_paginate-bootstrap4', '~> 0.2.2'
gem 'friendly_id'
gem 'popper_js', '~> 1.11', '>= 1.11.1'
gem 'protected_attributes'

# dependencies
group :dependencies do
gem 'mysql2', '< 0.4'
gem "geokit-rails", "1.1.4"
gem 'mysql2', '< 0.6'
gem 'geokit-rails', '1.1.4'
gem 'image_science', '1.3.0'
gem "recaptcha", :require => "recaptcha/rails"
gem "oa-openid", "0.3.2"
gem "ruby-openid", "~>2.5"
gem "open_id_authentication"
gem "RubyInline"
gem "paperclip", "~>4.3.7"
gem 'recaptcha', '~> 4.14.0', require: 'recaptcha/rails'
gem 'oa-openid', '0.3.2'
gem 'ruby-openid', '~>2.5'
gem 'open_id_authentication'
gem 'RubyInline', '~> 3.12.4'
gem 'paperclip', '~> 6.1.0'
gem 'bootsnap', '~> 1.4.4'
gem 'turbolinks', '~> 5'
gem 'mini_magick', '~> 4.8'

# if you use amazon s3 for warpable image storage
gem 'aws-sdk', '~> 1.5.7'

# for rake image migration tasks
# gem 'right_aws'
gem 'right_aws_api'
gem 'right_aws_api', '~> 0.3.5'

# compiling markdown to html
gem "rdiscount", "2.2.0.1"
gem 'rdiscount', '2.2.0.1'

# asset pipelining
gem 'bootstrap-sass'
gem 'sassc-rails'
gem 'jquery-rails'
gem "sprockets"
gem 'sprockets', '3.7.2'
gem "sprockets-rails"
gem "sass", :require => 'sass'
gem "autoprefixer-rails"
gem "uglifier"
gem 'sass', require: 'sass'
gem 'autoprefixer-rails', '~> 9.5.1.1'
gem 'uglifier', '~> 4.1.20'

end

group :test do
gem 'rubocop', '~> 0.52.0'
gem 'rubocop', '~> 0.70.0'
gem 'rubocop-performance'
gem 'ruby-prof'
gem 'rails-perftest'
gem 'rails-controller-testing'
gem 'simplecov', require: false
gem 'codecov', require: false
gem 'minitest'
gem 'minitest-reporters'
end

group :development, :test do
gem "byebug"
gem 'faker'
gem 'pry-rails'
gem 'byebug', '~> 11.0.1', platforms: [:mri, :mingw, :x64_mingw]
gem 'faker', '~> 1.9.3'
gem 'pry-rails', '~> 0.3.9'
end

group :development do
gem "jshintrb"
gem "therubyracer"
gem 'jshintrb', '~> 0.3.0'
gem 'mini_racer', platforms: :ruby
gem 'listen', '~> 3.1.5'
gem 'web-console', '~> 3.3'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

group :sqlite do
# if you decide to use sqlite3 as the database
gem "sqlite3"
gem 'sqlite3'
end

group :passenger do
# passenger server
gem "passenger"
gem 'passenger'
end

gem 'httparty'
Loading

0 comments on commit 18436ae

Please sign in to comment.