diff --git a/Gemfile b/Gemfile index 6569797e..baa3aa27 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ source 'https://rubygems.org' # RAILS # ------------------------------------- -gem 'rails', '~> 4.2.4' +gem 'rails', '~> 5.0.0' gem 'rack-cors', '~> 0.4.0', require: 'rack/cors' gem 'responders', '~> 2.2.0' @@ -24,7 +24,7 @@ gem 'responders', '~> 2.2.0' # gem 'actionpack-page_caching' # gem 'actionpack-action_caching' # gem 'activerecord-deprecated_finders' -gem 'activesupport-json_encoder', git: 'https://github.com/rails/activesupport-json_encoder.git', branch: :master, ref: 'd874fd9dbf' +#gem 'activesupport-json_encoder', git: 'https://github.com/rails/activesupport-json_encoder.git', branch: :master, ref: 'd874fd9dbf' # UI HELPERS # ------------------------------------- @@ -32,8 +32,6 @@ gem 'activesupport-json_encoder', git: 'https://github.com/rails/activesupport-j gem 'sass-rails', '~> 5.0.3' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' -# Use CoffeeScript for .js.coffee assets and views -gem 'coffee-rails', '~> 4.2.0' # See https://github.com/sstephenson/execjs#readme for more supported runtimes gem 'therubyracer', '~> 0.12.1', platforms: :ruby, require: 'v8' @@ -42,7 +40,7 @@ gem 'jquery-rails', '~> 4.1.0' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks #gem 'turbolinks' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem 'jbuilder', '~> 2.5.0' +gem 'jbuilder', '~> 2.6.0' gem 'haml', '~> 4.0.6' gem 'haml-rails', '~> 0.9.0' @@ -86,7 +84,7 @@ gem 'pg', '~> 0.18.1' # MODELS # ------------------------------------- -gem 'jc-validates_timeliness', '~> 3.1.1' +gem 'validates_timeliness', '~> 4.0.0' # https://github.com/delynn/userstamp # no changes in a long time, and we are very dependant on how this works @@ -96,7 +94,7 @@ gem 'jc-validates_timeliness', '~> 3.1.1' gem 'enumerize', '~> 1.0' gem 'uuidtools', '~> 2.1.5' -gem 'acts_as_paranoid', git: 'https://github.com/ActsAsParanoid/acts_as_paranoid.git', branch: :master, ref: 'ab31723bc1' +gem 'acts_as_paranoid', '~> 0.5.0.rc1' # SETTINGS # ------------------------------------- @@ -112,12 +110,13 @@ gem 'newrelic_rpm', '~> 3.15' # ------------------------------------- # these gems are required here to serve /doc url gem 'rspec_api_documentation', '~> 4.8.0' -gem 'raddocs', '~> 1.0.0' +#gem 'raddocs', '~> 1.0.0' +gem 'apitome' # MEDIA # ------------------------------------- # set to a specific commit when releasing to master branch -gem 'baw-audio-tools', git: 'https://github.com/QutBioacoustics/baw-audio-tools.git', branch: :master, ref: '354d375d6a' +gem 'baw-audio-tools', git: 'https://github.com/QutBioacoustics/baw-audio-tools.git', branch: :master, ref: 'e9ad21a' gem 'rack-rewrite', '~> 1.5.1' # ASYNC JOBS @@ -126,7 +125,7 @@ gem 'resque', '~> 1.25.2' gem 'resque-job-stats', git: 'https://github.com/echannel/resque-job-stats.git', branch: :master, ref: '8932c036ae' gem 'resque-status', '~> 0.5.0' # set to a specific commit when releasing to master branch -gem 'baw-workers', git: 'https://github.com/QutBioacoustics/baw-workers.git', branch: :master, ref: '18943af4b' +gem 'baw-workers', git: 'https://github.com/QutBioacoustics/baw-workers.git', branch: :master, ref: '584ab5a' # Gems restricted by environment and/or platform @@ -140,11 +139,11 @@ group :development, :test do #gem 'debase' #gem 'traceroute' - gem 'quiet_assets' + #gem 'quiet_assets' gem 'rack-mini-profiler', '~> 0.10.0' gem 'i18n-tasks', '~> 0.9.0' - gem 'bullet', '~> 5.1.0' + gem 'bullet', '~> 5.2.0' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring #gem 'spring', '~> 1.4.0' @@ -161,7 +160,7 @@ group :development, :test do gem 'guard', '~> 2.14.0' gem 'guard-rspec', '~> 4.7.0' gem 'guard-yard', '~> 2.1.4', require: false - gem 'rubocop', '~> 0.41.0', require: false + gem 'rubocop', '~> 0.42.0', require: false gem 'haml_lint', require: false gem 'fakeredis', '~> 0.5.0', require: 'fakeredis/rspec' @@ -203,5 +202,6 @@ end group :test do gem 'webmock', '~> 2.1.0' + # This needs to be less than 3, due to huge changes and a critical bug in v3 gem 'shoulda-matchers', '< 3.0.0', require: false end \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index f0957419..0fcaaccd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,17 +1,7 @@ -GIT - remote: https://github.com/ActsAsParanoid/acts_as_paranoid.git - revision: ab31723bc11c82bac144cfabd4631b26307bfde1 - ref: ab31723bc1 - branch: master - specs: - acts_as_paranoid (0.5.0.beta2) - activerecord (~> 4.0) - activesupport (~> 4.0) - GIT remote: https://github.com/QutBioacoustics/baw-audio-tools.git - revision: 354d375d6af990299b6f45d182de3067b39539a5 - ref: 354d375d6a + revision: e9ad21a26d406679ff13fb00f309ae666b769cb5 + ref: e9ad21a branch: master specs: baw-audio-tools (0.4.0) @@ -19,13 +9,13 @@ GIT GIT remote: https://github.com/QutBioacoustics/baw-workers.git - revision: 18943af4b977749b9ec58bb566a8a30861f5fabc - ref: 18943af4b + revision: 584ab5a910142f5245b36e5fdf4e07b53b23e81c + ref: 584ab5a branch: master specs: baw-workers (0.5.0) - actionmailer (~> 4.2) - activesupport (~> 4.2) + actionmailer (>= 4.2) + activesupport (>= 4.2) resque (~> 1.25) resque-status (~> 0.5) resque_solo (~> 0.1) @@ -40,64 +30,64 @@ GIT resque-job-stats (0.3.0) resque (>= 1.17) -GIT - remote: https://github.com/rails/activesupport-json_encoder.git - revision: d874fd9dbf2d558eac87893578e8e7970f1581a5 - ref: d874fd9dbf - branch: master - specs: - activesupport-json_encoder (1.1.0) - activesupport (>= 4.1.0, < 5.0) - GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.7) - actionpack (= 4.2.7) - actionview (= 4.2.7) - activejob (= 4.2.7) + actioncable (5.0.0) + actionpack (= 5.0.0) + nio4r (~> 1.2) + websocket-driver (~> 0.6.1) + actionmailer (5.0.0) + actionpack (= 5.0.0) + actionview (= 5.0.0) + activejob (= 5.0.0) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.7) - actionview (= 4.2.7) - activesupport (= 4.2.7) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) + actionpack (5.0.0) + actionview (= 5.0.0) + activesupport (= 5.0.0) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.7) - activesupport (= 4.2.7) + actionview (5.0.0) + activesupport (= 5.0.0) builder (~> 3.1) erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (4.2.7) - activesupport (= 4.2.7) - globalid (>= 0.3.0) - activemodel (4.2.7) - activesupport (= 4.2.7) - builder (~> 3.1) - activerecord (4.2.7) - activemodel (= 4.2.7) - activesupport (= 4.2.7) - arel (~> 6.0) - activesupport (4.2.7) + activejob (5.0.0) + activesupport (= 5.0.0) + globalid (>= 0.3.6) + activemodel (5.0.0) + activesupport (= 5.0.0) + activerecord (5.0.0) + activemodel (= 5.0.0) + activesupport (= 5.0.0) + arel (~> 7.0) + activesupport (5.0.0) + concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + acts_as_paranoid (0.5.0.rc1) + activerecord (>= 4.0, < 5.1) + activesupport (>= 4.0, < 5.1) addressable (2.4.0) - arel (6.0.3) + apitome (0.1.0) + kramdown + railties + rspec_api_documentation + arel (7.1.1) ast (2.3.0) autoprefixer-rails (6.3.7) execjs bcrypt (3.1.11) - bootstrap-sass (3.3.6) + bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) builder (3.2.2) - bullet (5.1.1) + bullet (5.2.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.10.0) cancancan (1.15.0) @@ -115,20 +105,13 @@ GEM codeclimate-test-reporter (0.6.0) simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.1) - coffee-rails (4.2.1) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.2.x) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.10.0) concurrent-ruby (1.0.2) - coveralls (0.8.14) + coveralls (0.8.15) json (>= 1.8, < 3) simplecov (~> 0.12.0) term-ansicolor (~> 1.3) thor (~> 0.19.1) - tins (~> 1.6.0) + tins (>= 1.6.0, < 2) crack (0.4.3) safe_yaml (~> 1.0.0) daemons (1.2.3) @@ -153,7 +136,7 @@ GEM activesupport (>= 3.2) erubis (2.7.0) eventmachine (1.2.0.1) - exception_notification (4.2.0) + exception_notification (4.2.1) actionmailer (>= 4.0, < 6) activesupport (>= 4.0, < 6) execjs (2.7.0) @@ -168,7 +151,7 @@ GEM font-awesome-sass (4.6.2) sass (>= 3.2) formatador (0.2.5) - globalid (0.3.6) + globalid (0.3.7) activesupport (>= 4.1.0) guard (2.14.0) formatador (>= 0.2.4) @@ -180,7 +163,7 @@ GEM shellany (~> 0.0) thor (>= 0.18.1) guard-compat (1.2.1) - guard-rspec (4.7.2) + guard-rspec (4.7.3) guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) @@ -195,7 +178,7 @@ GEM haml (>= 4.0.6, < 5.0) html2haml (>= 1.0.1) railties (>= 4.0.1) - haml_lint (0.17.1) + haml_lint (0.18.1) haml (~> 4.0) rake (>= 10, < 12) rubocop (>= 0.36.0) @@ -218,11 +201,9 @@ GEM parser (>= 2.2.3.0) term-ansicolor (>= 1.3.2) terminal-table (>= 1.5.1) - jbuilder (2.5.0) + jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) - jc-validates_timeliness (3.1.1) - timeliness (~> 0.3.7) jquery-rails (4.1.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -259,10 +240,11 @@ GEM mustache (1.0.3) nenv (0.3.0) newrelic_rpm (3.16.0.318) + nio4r (1.2.1) nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) - notiffany (0.1.0) + notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) orm_adapter (0.5.0) @@ -281,43 +263,34 @@ GEM coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - quiet_assets (1.1.0) - railties (>= 3.1, < 5.0) - rack (1.6.4) + rack (2.0.1) rack-cors (0.4.0) rack-mini-profiler (0.10.1) rack (>= 1.2.0) - rack-protection (1.5.3) - rack rack-rewrite (1.5.1) rack-test (0.6.3) rack (>= 1.0) - raddocs (1.0.1) - haml (~> 4.0) - json (~> 1.8) - sinatra (~> 1.3) - rails (4.2.7) - actionmailer (= 4.2.7) - actionpack (= 4.2.7) - actionview (= 4.2.7) - activejob (= 4.2.7) - activemodel (= 4.2.7) - activerecord (= 4.2.7) - activesupport (= 4.2.7) + rails (5.0.0) + actioncable (= 5.0.0) + actionmailer (= 5.0.0) + actionpack (= 5.0.0) + actionview (= 5.0.0) + activejob (= 5.0.0) + activemodel (= 5.0.0) + activerecord (= 5.0.0) + activesupport (= 5.0.0) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.7) - sprockets-rails - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) - activesupport (>= 4.2.0.beta, < 5.0) + railties (= 5.0.0) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.1) + activesupport (>= 4.2.0, < 6.0) nokogiri (~> 1.6.0) - rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - railties (4.2.7) - actionpack (= 4.2.7) - activesupport (= 4.2.7) + railties (5.0.0) + actionpack (= 5.0.0) + activesupport (= 5.0.0) + method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.1.0) @@ -329,7 +302,7 @@ GEM json (~> 1.4) recaptcha (3.3.0) json - redis (3.3.0) + redis (3.3.1) redis-namespace (1.5.2) redis (~> 3.0, >= 3.0.4) ref (2.0.0) @@ -350,7 +323,7 @@ GEM rspec-core (~> 3.5.0) rspec-expectations (~> 3.5.0) rspec-mocks (~> 3.5.0) - rspec-core (3.5.1) + rspec-core (3.5.2) rspec-support (~> 3.5.0) rspec-expectations (3.5.0) diff-lcs (>= 1.2.0, < 2.0) @@ -371,7 +344,7 @@ GEM activesupport (>= 3.0.0) mustache (~> 1.0, >= 0.99.4) rspec (~> 3.0, >= 3.0.0) - rubocop (0.41.2) + rubocop (0.42.0) parser (>= 2.3.1.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) @@ -383,7 +356,7 @@ GEM sexp_processor (~> 4.1) safe_yaml (1.0.4) sass (3.4.22) - sass-rails (5.0.5) + sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) @@ -405,12 +378,10 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) - sinatra (1.4.7) - rack (~> 1.5) - rack-protection (~> 1.4) - tilt (>= 1.3, < 3) + sinatra (1.0) + rack (>= 1.0) slop (3.6.0) - sprockets (3.6.3) + sprockets (3.7.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.1.1) @@ -433,16 +404,18 @@ GEM thread_safe (0.3.5) tilt (2.0.5) timeliness (0.3.8) - tins (1.6.0) + tins (1.11.0) tzinfo (1.2.2) thread_safe (~> 0.1) tzinfo-data (1.2016.6) tzinfo (>= 1.0.0) - uglifier (3.0.0) + uglifier (3.0.1) execjs (>= 0.3.0, < 3) unicode-display_width (1.1.0) uniform_notifier (1.10.0) uuidtools (2.1.5) + validates_timeliness (4.0.2) + timeliness (~> 0.3.7) vegas (0.1.11) rack (>= 1.0.0) warden (1.2.6) @@ -451,26 +424,28 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff + websocket-driver (0.6.4) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) xpath (2.0.0) nokogiri (~> 1.3) - yard (0.9.0) + yard (0.9.5) zonebie (0.6.1) PLATFORMS ruby DEPENDENCIES - activesupport-json_encoder! - acts_as_paranoid! + acts_as_paranoid (~> 0.5.0.rc1) + apitome baw-audio-tools! baw-workers! bcrypt (~> 3.1.9) bootstrap-sass (~> 3.3.4) - bullet (~> 5.1.0) + bullet (~> 5.2.0) cancancan (~> 1.15) capybara (~> 2.7.0) codeclimate-test-reporter (~> 0.6.0) - coffee-rails (~> 4.2.0) coveralls (~> 0.8.14) database_cleaner (~> 1.5.0) devise (~> 4.2.0) @@ -488,8 +463,7 @@ DEPENDENCIES haml-rails (~> 0.9.0) haml_lint i18n-tasks (~> 0.9.0) - jbuilder (~> 2.5.0) - jc-validates_timeliness (~> 3.1.1) + jbuilder (~> 2.6.0) jquery-rails (~> 4.1.0) json_spec (~> 1.1.4) kaminari @@ -499,12 +473,10 @@ DEPENDENCIES notiffany (~> 0.1.0) paperclip (~> 5.0.0) pg (~> 0.18.1) - quiet_assets rack-cors (~> 0.4.0) rack-mini-profiler (~> 0.10.0) rack-rewrite (~> 1.5.1) - raddocs (~> 1.0.0) - rails (~> 4.2.4) + rails (~> 5.0.0) recaptcha (~> 3.3.0) responders (~> 2.2.0) resque (~> 1.25.2) @@ -514,7 +486,7 @@ DEPENDENCIES rspec (~> 3.5.0) rspec-rails (~> 3.5.0) rspec_api_documentation (~> 4.8.0) - rubocop (~> 0.41.0) + rubocop (~> 0.42.0) sass-rails (~> 5.0.3) sdoc (~> 0.4.0) settingslogic (~> 2.0.9) @@ -527,6 +499,7 @@ DEPENDENCIES tzinfo-data (~> 1.2016) uglifier (>= 1.3.0) uuidtools (~> 2.1.5) + validates_timeliness (~> 4.0.0) webmock (~> 2.1.0) zonebie diff --git a/config/application.rb b/config/application.rb index c2b445dc..e4d7eba6 100644 --- a/config/application.rb +++ b/config/application.rb @@ -109,9 +109,6 @@ class Application < Rails::Application # check that locales are valid - new default in rails 3.2.14 config.i18n.enforce_available_locales = true - # this is only respected by the activesupport-json_encoder gem. - ActiveSupport.encode_big_decimal_as_string = false - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' @@ -138,7 +135,7 @@ class Application < Rails::Application Paperclip::Attachment.default_options[:url] = '/system/:class/:attachment/:id_partition/:style/:filename' # for generating documentation from tests - Raddocs.configuration.docs_dir = "doc/api" + #Raddocs.configuration.docs_dir = "doc/api" # middleware to rewrite angular urls # insert at the start of the Rack stack. diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb index 010ba127..7e83f530 100644 --- a/config/initializers/cookies_serializer.rb +++ b/config/initializers/cookies_serializer.rb @@ -3,8 +3,4 @@ # @see http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#cookies-serializer # this should be changed to :json at some point when most people have visited the site # and their cookies have been updated. -Rails.application.config.action_dispatch.cookies_serializer = :hybrid - -# ensure json does not serialise BigDecimal to a string in json -# this was added in Rails 4.1, removed Rails 4.2 -#Rails.application.config.active_support.encode_big_decimal_as_string = false \ No newline at end of file +Rails.application.config.action_dispatch.cookies_serializer = :hybrid \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index e1bb4e33..1675055b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -336,7 +336,7 @@ end # provide access to API documentation - mount Raddocs::App => '/doc' + #mount Raddocs::App => '/doc' # enable CORS preflight requests match '*requested_route', to: 'public#cors_preflight', via: :options diff --git a/lib/patches/big_decimal.rb b/lib/patches/big_decimal.rb deleted file mode 100644 index af6540a5..00000000 --- a/lib/patches/big_decimal.rb +++ /dev/null @@ -1,19 +0,0 @@ -# http://stackoverflow.com/questions/6128794/rails-json-serialization-of-decimal-adds-quotes -# patch BigDecimal so json is output without quotes. -# this was introduced in Rails 4.0 as `Rails.application.config.active_support.encode_big_decimal_as_string` -# it was removed in Rails 4.2 when the JSON encoder was rewritten -# https://github.com/rails/rails/commit/4d02296cfbd69b4d2757dfd20f23d778bb23b81b -# http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#changes-in-json-handling -# https://github.com/rails/rails/pull/13060 - -# require 'bigdecimal' -# -# class BigDecimal -# def as_json(options = nil) #:nodoc: -# if finite? -# self -# else -# NilClass::AS_JSON -# end -# end -# end