Commit 4dee48b7 authored by MARGERY David's avatar MARGERY David
Browse files

Migrate to Rails 4.2.x & adapt code so tests pass

Used the rake rails:update task, so copyrights on some file generated by
rails were properly reset.
parent 80c352c2
source 'https://rubygems.org'
gem 'rake'
gem 'rails', '~> 4.1.0'
# jQuery is the default JavaScript library in Rails 3.1
gem 'rails', '~> 4.2.10'
# jQuery is the default JavaScript library as from Rails 3.1
gem 'jquery-rails'
gem 'eventmachine'
......@@ -20,9 +20,8 @@ gem 'haml', '~> 4.0.4'
gem 'rack-jsonp'
gem 'pg', '< 1.0.0'
gem 'em-postgresql-adapter', :git => 'https://github.com/grid5000/em-postgresql-adapter.git'
#gem 'activerecord-em_postgresql-adapter'
#gem 'em-postgresql-adapter', :git => 'git://github.com/cadicallegari/em-postgresql-adapter.git', :ref => '2a0d31b663b7'
gem 'nokogiri', '~> 1.5.6' #oldest version that blather handles
gem 'nokogiri'
#gem 'nokogiri', '~> 1.5.6' #oldest version that blather handles
gem 'blather', '>= 1.2.0'
......
GIT
remote: https://github.com/grid5000/em-postgresql-adapter.git
revision: b3a994f4dce6664d6e948de82a1b702fe184561e
revision: b43aeb20ea3ee31db6414d8829d8f156d18ea1bf
specs:
em-postgresql-adapter (0.3)
activerecord (>= 3.1.0)
......@@ -10,41 +10,49 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.1.16)
actionpack (= 4.1.16)
actionview (= 4.1.16)
actionmailer (4.2.10)
actionpack (= 4.2.10)
actionview (= 4.2.10)
activejob (= 4.2.10)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.16)
actionview (= 4.1.16)
activesupport (= 4.1.16)
rack (~> 1.5.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.10)
actionview (= 4.2.10)
activesupport (= 4.2.10)
rack (~> 1.6)
rack-test (~> 0.6.2)
actionview (4.1.16)
activesupport (= 4.1.16)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.10)
activesupport (= 4.2.10)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.16)
activesupport (= 4.1.16)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.10)
activesupport (= 4.2.10)
globalid (>= 0.3.0)
activemodel (4.2.10)
activesupport (= 4.2.10)
builder (~> 3.1)
activerecord (4.1.16)
activemodel (= 4.1.16)
activesupport (= 4.1.16)
arel (~> 5.0.0)
activesupport (4.1.16)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
activerecord (4.2.10)
activemodel (= 4.2.10)
activesupport (= 4.2.10)
arel (~> 6.0)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
arel (5.0.1.20140414130214)
blather (1.2.0)
arel (6.0.4)
blather (2.0.0)
activesupport (>= 2.3.11)
eventmachine (>= 1.0.0)
girl_friday
eventmachine (~> 1.2, >= 1.2.6)
niceogiri (~> 1.0)
nokogiri (~> 1.5, >= 1.5.6, <= 1.6.1)
nokogiri (~> 1.8, >= 1.8.3)
sucker_punch (~> 2.0)
builder (3.2.3)
charlock_holmes (0.7.6)
coffee-rails (4.2.2)
......@@ -55,10 +63,10 @@ GEM
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
connection_pool (1.2.0)
cookiejar (0.3.3)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.4)
daemons (1.2.6)
diff-lcs (1.3)
docile (1.3.1)
......@@ -81,30 +89,34 @@ GEM
factory_bot (~> 4.11.0)
railties (>= 3.0.0)
ffi (1.9.25)
girl_friday (0.11.2)
connection_pool (~> 1.0)
rubinius-actor
gitlab-grit (2.8.2)
charlock_holmes (~> 0.6)
diff-lcs (~> 1.1)
mime-types (>= 1.16)
posix-spawn (~> 0.3)
globalid (0.4.1)
activesupport (>= 4.2.0)
haml (4.0.7)
tilt
hashdiff (0.3.7)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jquery-rails (3.1.5)
railties (>= 3.0, < 5.0)
jquery-rails (4.3.3)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.6)
json (2.1.0)
loofah (2.2.2)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.0)
mini_mime (>= 0.1.1)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
mysql2 (0.3.21)
net-ssh (4.2.0)
......@@ -115,29 +127,39 @@ GEM
net-ssh-gateway (>= 1.2.0)
niceogiri (1.1.2)
nokogiri (~> 1.5)
nokogiri (1.5.11)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
pg (0.21.0)
posix-spawn (0.3.13)
public_suffix (3.0.3)
rack (1.5.5)
rack (1.6.10)
rack-fiber_pool (0.9.3)
rack-jsonp (1.3.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.1.16)
actionmailer (= 4.1.16)
actionpack (= 4.1.16)
actionview (= 4.1.16)
activemodel (= 4.1.16)
activerecord (= 4.1.16)
activesupport (= 4.1.16)
rails (4.2.10)
actionmailer (= 4.2.10)
actionpack (= 4.2.10)
actionview (= 4.2.10)
activejob (= 4.2.10)
activemodel (= 4.2.10)
activerecord (= 4.2.10)
activesupport (= 4.2.10)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.16)
sprockets-rails (~> 2.0)
railties (4.1.16)
actionpack (= 4.1.16)
activesupport (= 4.1.16)
railties (= 4.2.10)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.9)
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (4.2.10)
actionpack (= 4.2.10)
activesupport (= 4.2.10)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.3.1)
......@@ -167,9 +189,6 @@ GEM
rspec-support (3.8.0)
rspec_junit_formatter (0.3.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubinius-actor (0.0.2)
rubinius-core-api
rubinius-core-api (0.0.1)
ruby-mysql (2.9.14)
safe_yaml (1.0.4)
sass (3.5.7)
......@@ -191,11 +210,13 @@ GEM
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (2.3.3)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
state_machine (1.2.0)
sucker_punch (2.1.0)
concurrent-ruby (~> 1.0.0)
syslogger (1.6.5)
thin (1.5.1)
daemons (>= 1.0.9)
......@@ -231,11 +252,11 @@ DEPENDENCIES
mysql2 (~> 0.3.6)
net-ssh (< 5.0.0)
net-ssh-multi
nokogiri (~> 1.5.6)
nokogiri
pg (< 1.0.0)
rack-fiber_pool (~> 0.9)
rack-jsonp
rails (~> 4.1.0)
rails (~> 4.2.10)
rake
rspec
rspec-rails
......
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
Rake.application.run
#!/usr/bin/env ruby
require 'pathname'
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.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 || bundle install"
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# end
puts "\n== Preparing database =="
system "bin/rake db:setup"
puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
end
# Copyright (c) 2009-2011 Cyril Rohr, INRIA Rennes - Bretagne Atlantique
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'rubygems'
require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'yaml'
YAML::ENGINE.yamler = "psych"
# Attempts to use a vendored Bundler, if any
vendored_gems = File.expand_path(
'../../vendor/bundle/ruby/2.1.5/gems', __FILE__
)
vendored_bundler = Dir["#{vendored_gems}/bundler-*/lib"].sort.last
if !vendored_bundler.nil? && !$LOAD_PATH.include?(vendored_bundler)
$LOAD_PATH.unshift(vendored_bundler)
end
# 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)
......@@ -40,8 +40,5 @@ Api::Application.configure do
# Expands the lines which load the assets
config.assets.debug = true
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
end
......@@ -43,7 +43,7 @@ Api::Application.configure do
# Use a different cache store in production
# config.cache_store = :mem_cache_store
config.serve_static_assets = true
config.serve_static_files = true
# Compress JavaScripts and CSS
config.assets.js_compressor = :uglifier
......
......@@ -48,7 +48,7 @@ Api::Application.configure do
config.active_support.deprecation = :stderr
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
end
# 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
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
# Copyright (c) 2009-2011 Cyril Rohr, INRIA Rennes - Bretagne Atlantique
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 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.
......
# Be sure to restart your server when you modify this file.
Rails.application.config.action_dispatch.cookies_serializer = :marshal
# 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]
# Copyright (c) 2009-2011 Cyril Rohr, INRIA Rennes - Bretagne Atlantique
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# 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
# 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] if respond_to?(:wrap_parameters)
end
# To enable root element in JSON for ActiveRecord objects.
# ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = true
# end
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
# 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.
#
# To learn more, please read the Rails Internationalization guide
# available at http://guides.rubyonrails.org/i18n.html.
en:
hello: "Hello world"
# 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 `rake secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.
development:
secret_key_base: 94fddc5054bc9a69ffee09fd25ff41ecee02a663cda65b2672d71204e7367e5a6f01a277e6530ce7869a952fda5c984d489e9e4d59caf9d9ec9394bf76b5e199
test:
secret_key_base: 3b01c4bb3cb4b2dc7983e329cc53101ea547d3c67e4bad64c065647e82860f7d31d2cb5611662a514fdaeffec6567b6060ae05f0f525fe2bc5a5169d940bfe9b
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment