Skip to content

Commit

Permalink
first crack at rails 5
Browse files Browse the repository at this point in the history
  • Loading branch information
jtwohiou committed Apr 4, 2017
1 parent a606b13 commit e174bc7
Show file tree
Hide file tree
Showing 57 changed files with 662 additions and 671 deletions.
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ end
group :development do
gem 'rake'
# gem 'debugger'
gem 'quiet_assets'
gem 'better_errors'
gem 'binding_of_caller'
gem 'pry'
end
group :test, :development do
gem 'minitest', '~>5.3.3'
gem 'minitest'
gem "test-unit", "~> 3.0"
gem 'minitest-rails', '~>2.0.0'
gem 'minitest-rails'
gem 'minitest-reporters', '~>1.0.0'
gem 'rails-controller-testing'
end

group :test do
Expand Down
151 changes: 78 additions & 73 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,69 +1,72 @@
PATH
remote: .
specs:
browsercms (4.2.8.rc1)
browsercms (5.0.2.rc1)
actionpack-page_caching (~> 1.0)
ancestry (~> 2.0.0)
bootstrap-sass
ckeditor_rails (~> 4.3.0)
ckeditor_rails
compass-rails (~> 3.0.0)
devise (~> 3.0)
jquery-rails (~> 3.1)
devise (~> 4.2.0)
jquery-rails (~> 4.1.1)
jquery-ui-rails (~> 4.1)
panoramic
paperclip (~> 3.4)
rails (~> 4.2.0)
rails (~> 5.0.2)
sass-rails
simple_form (~> 3.1.0)
simple_form (~> 3.3.0)
term-ansicolor
underscore-rails (~> 1.4)
will_paginate (~> 3.0.0)

GEM
remote: http://rubygems.org/
specs:
actionmailer (4.2.8)
actionpack (= 4.2.8)
actionview (= 4.2.8)
activejob (= 4.2.8)
actioncable (5.0.2)
actionpack (= 5.0.2)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.2)
actionpack (= 5.0.2)
actionview (= 5.0.2)
activejob (= 5.0.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.8)
actionview (= 4.2.8)
activesupport (= 4.2.8)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-dom-testing (~> 2.0)
actionpack (5.0.2)
actionview (= 5.0.2)
activesupport (= 5.0.2)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionpack-page_caching (1.1.0)
actionpack (>= 4.0.0, < 6)
actionview (4.2.8)
activesupport (= 4.2.8)
actionview (5.0.2)
activesupport (= 5.0.2)
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.3)
activejob (4.2.8)
activesupport (= 4.2.8)
globalid (>= 0.3.0)
activemodel (4.2.8)
activesupport (= 4.2.8)
builder (~> 3.1)
activerecord (4.2.8)
activemodel (= 4.2.8)
activesupport (= 4.2.8)
arel (~> 6.0)
activesupport (4.2.8)
activejob (5.0.2)
activesupport (= 5.0.2)
globalid (>= 0.3.6)
activemodel (5.0.2)
activesupport (= 5.0.2)
activerecord (5.0.2)
activemodel (= 5.0.2)
activesupport (= 5.0.2)
arel (~> 7.0)
activesupport (5.0.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
ancestry (2.0.0)
activerecord (>= 3.0.0)
ansi (1.5.0)
arel (6.0.4)
arel (7.1.4)
aruba (0.14.2)
childprocess (~> 0.5.6)
contracts (~> 0.9)
Expand Down Expand Up @@ -95,7 +98,7 @@ GEM
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
chunky_png (1.3.8)
ckeditor_rails (4.3.4)
ckeditor_rails (4.6.2)
railties (>= 3.0)
climate_control (0.1.0)
cliver (0.3.2)
Expand Down Expand Up @@ -140,12 +143,11 @@ GEM
daemons (1.2.4)
database_cleaner (1.5.3)
debug_inspector (0.0.2)
devise (3.5.10)
devise (4.2.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
railties (>= 4.1.0, < 5.1)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.3)
erubis (2.7.0)
Expand All @@ -161,8 +163,9 @@ GEM
globalid (0.3.7)
activesupport (>= 4.1.0)
i18n (0.8.1)
jquery-rails (3.1.4)
railties (>= 3.0, < 5.0)
jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.2.1)
railties (>= 3.2.16)
Expand All @@ -181,10 +184,10 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.3.5)
minitest-rails (2.0.3)
minitest (>= 5.3.3, < 6.0)
railties (~> 4.1)
minitest (5.10.1)
minitest-rails (3.0.0)
minitest (~> 5.8)
railties (~> 5.0)
minitest-reporters (1.0.20)
ansi
builder
Expand All @@ -195,7 +198,8 @@ GEM
multi_json (1.12.1)
multi_test (0.1.2)
mysql2 (0.4.5)
nokogiri (1.6.8.1)
nio4r (2.0.0)
nokogiri (1.7.1)
mini_portile2 (~> 2.1.0)
orm_adapter (0.5.0)
panoramic (0.0.6)
Expand All @@ -215,33 +219,34 @@ GEM
method_source (~> 0.8.1)
slop (~> 3.4)
public_suffix (2.0.5)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.5)
rack (2.0.1)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.8)
actionmailer (= 4.2.8)
actionpack (= 4.2.8)
actionview (= 4.2.8)
activejob (= 4.2.8)
activemodel (= 4.2.8)
activerecord (= 4.2.8)
activesupport (= 4.2.8)
rails (5.0.2)
actioncable (= 5.0.2)
actionmailer (= 5.0.2)
actionpack (= 5.0.2)
actionview (= 5.0.2)
activejob (= 5.0.2)
activemodel (= 5.0.2)
activerecord (= 5.0.2)
activesupport (= 5.0.2)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.8)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.8)
activesupport (>= 4.2.0.beta, < 5.0)
railties (= 5.0.2)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.1)
actionpack (~> 5.x)
actionview (~> 5.x)
activesupport (~> 5.x)
rails-dom-testing (2.0.2)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (4.2.8)
actionpack (= 4.2.8)
activesupport (= 4.2.8)
railties (5.0.2)
actionpack (= 5.0.2)
activesupport (= 5.0.2)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.0.0)
Expand All @@ -263,9 +268,9 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
simple_form (3.1.1)
actionpack (~> 4.0)
activemodel (~> 4.0)
simple_form (3.3.1)
actionpack (> 4, < 5.1)
activemodel (> 4, < 5.1)
single_test (0.6.0)
rake
slop (3.6.0)
Expand All @@ -279,7 +284,7 @@ GEM
sqlite3 (1.3.13)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
term-ansicolor (1.4.1)
term-ansicolor (1.5.0)
tins (~> 1.0)
test-unit (3.2.3)
power_assert
Expand All @@ -291,7 +296,7 @@ GEM
thread_safe (0.3.6)
tilt (2.0.7)
tins (1.13.2)
tzinfo (1.2.2)
tzinfo (1.2.3)
thread_safe (~> 0.1)
uglifier (3.1.9)
execjs (>= 0.3.0, < 3)
Expand Down Expand Up @@ -322,14 +327,14 @@ DEPENDENCIES
factory_girl_rails (= 3.3.0)
launchy
m (~> 1.2)
minitest (~> 5.3.3)
minitest-rails (~> 2.0.0)
minitest
minitest-rails
minitest-reporters (~> 1.0.0)
mocha
mysql2
poltergeist
pry
quiet_assets
rails-controller-testing
rake
ruby-prof
sass-rails (~> 5.0.0)
Expand Down
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env rake
begin
$arel_silence_type_casting_deprecation=true
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
Expand Down Expand Up @@ -104,7 +105,7 @@ def run_tests(tests_to_run)
end

# Build and run against MySQL.
task 'ci:test' => ['project:setup:mysql', 'db:drop', 'db:create:all', 'db:install', 'test']
task 'ci:test' => [ 'project:setup:mysql', 'db:drop', 'db:create:all', 'db:install', 'test']
task :default => 'ci:test'

require 'yard'
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/cms/base_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Cms
class BaseController < Cms::ApplicationController

before_filter :redirect_to_cms_site
before_action :redirect_to_cms_site
before_action :authenticate_cms_user!
before_filter :cms_access_required
before_action :cms_access_required

layout 'cms/application'

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/cms/connectors_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Cms
class ConnectorsController < Cms::BaseController
before_filter :load_page, :only => [:new, :create]

before_action :load_page, :only => [:new, :create]

def new
@block_type = ContentType.find_by_key(params[:block_type] || session[:last_block_type] || 'html_block')
Expand Down
18 changes: 9 additions & 9 deletions app/controllers/cms/content_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ class ContentController < Cms::ApplicationController
include Cms::MobileAware
helper MobileHelper

skip_before_filter :redirect_to_cms_site
before_filter :redirect_non_cms_users_to_public_site, :only => [:show, :show_page_route]
before_filter :construct_path, :only => [:show]
before_filter :construct_path_from_route, :only => [:show_page_route]
before_filter :try_to_redirect, :only => [:show]
before_filter :try_to_stream_file, :only => [:show]
before_filter :load_page, :only => [:show, :show_page_route]
before_filter :check_access_to_page, :except => [:edit, :preview]
before_filter :select_cache_directory
#skip_before_filter :redirect_to_cms_site
before_action :redirect_non_cms_users_to_public_site, :only => [:show, :show_page_route]
before_action :construct_path, :only => [:show]
before_action :construct_path_from_route, :only => [:show_page_route]
before_action :try_to_redirect, :only => [:show]
before_action :try_to_stream_file, :only => [:show]
before_action :load_page, :only => [:show, :show_page_route]
before_action :check_access_to_page, :except => [:edit, :preview]
before_action :select_cache_directory

self.responder = Cms::ContentResponder

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/cms/dynamic_views_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class DynamicViewsController < Cms::BaseController
include Cms::AdminTab
check_permissions :administrate

before_filter :load_view, :only => [:show, :edit, :update, :destroy]
before_action :load_view, :only => [:show, :edit, :update, :destroy]

helper_method :dynamic_view_type

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/cms/forms_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Cms::FormsController < Cms::ContentBlockController

before_filter :associate_form_fields, only: [:create, :update]
before_filter :strip_new_entry_params, only: [:create, :update]
before_action :associate_form_fields, only: [:create, :update]
before_action :strip_new_entry_params, only: [:create, :update]

helper do
# For new forms, if the user doesn't complete and save them, we need to delete them from the database.
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/cms/links_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Cms
class LinksController < Cms::BaseController

before_filter :load_section, :only => [:new, :create, :move_to]
before_filter :load_link, :only => [:destroy, :update]
before_filter :load_draft_link, :only => [:edit]
before_action :load_section, :only => [:new, :create, :move_to]
before_action :load_link, :only => [:destroy, :update]
before_action :load_draft_link, :only => [:edit]

include Cms::PublishWorkflow

Expand Down
1 change: 0 additions & 1 deletion app/controllers/cms/page_components_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module Cms
class PageComponentsController < Cms::ApplicationController
layout false
respond_to :json

def new
@default_type = Cms::ContentType.default
@content_types = Cms::ContentType.other_connectables
Expand Down
Loading

0 comments on commit e174bc7

Please sign in to comment.