Skip to content

Commit e174bc7

Browse files
committed
first crack at rails 5
1 parent a606b13 commit e174bc7

Some content is hidden

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

57 files changed

+662
-671
lines changed

Gemfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ end
2525
group :development do
2626
gem 'rake'
2727
# gem 'debugger'
28-
gem 'quiet_assets'
2928
gem 'better_errors'
3029
gem 'binding_of_caller'
3130
gem 'pry'
3231
end
3332
group :test, :development do
34-
gem 'minitest', '~>5.3.3'
33+
gem 'minitest'
3534
gem "test-unit", "~> 3.0"
36-
gem 'minitest-rails', '~>2.0.0'
35+
gem 'minitest-rails'
3736
gem 'minitest-reporters', '~>1.0.0'
37+
gem 'rails-controller-testing'
3838
end
3939

4040
group :test do

Gemfile.lock

+78-73
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,72 @@
11
PATH
22
remote: .
33
specs:
4-
browsercms (4.2.8.rc1)
4+
browsercms (5.0.2.rc1)
55
actionpack-page_caching (~> 1.0)
66
ancestry (~> 2.0.0)
77
bootstrap-sass
8-
ckeditor_rails (~> 4.3.0)
8+
ckeditor_rails
99
compass-rails (~> 3.0.0)
10-
devise (~> 3.0)
11-
jquery-rails (~> 3.1)
10+
devise (~> 4.2.0)
11+
jquery-rails (~> 4.1.1)
1212
jquery-ui-rails (~> 4.1)
1313
panoramic
1414
paperclip (~> 3.4)
15-
rails (~> 4.2.0)
15+
rails (~> 5.0.2)
1616
sass-rails
17-
simple_form (~> 3.1.0)
17+
simple_form (~> 3.3.0)
1818
term-ansicolor
1919
underscore-rails (~> 1.4)
2020
will_paginate (~> 3.0.0)
2121

2222
GEM
2323
remote: http://rubygems.org/
2424
specs:
25-
actionmailer (4.2.8)
26-
actionpack (= 4.2.8)
27-
actionview (= 4.2.8)
28-
activejob (= 4.2.8)
25+
actioncable (5.0.2)
26+
actionpack (= 5.0.2)
27+
nio4r (>= 1.2, < 3.0)
28+
websocket-driver (~> 0.6.1)
29+
actionmailer (5.0.2)
30+
actionpack (= 5.0.2)
31+
actionview (= 5.0.2)
32+
activejob (= 5.0.2)
2933
mail (~> 2.5, >= 2.5.4)
30-
rails-dom-testing (~> 1.0, >= 1.0.5)
31-
actionpack (4.2.8)
32-
actionview (= 4.2.8)
33-
activesupport (= 4.2.8)
34-
rack (~> 1.6)
35-
rack-test (~> 0.6.2)
36-
rails-dom-testing (~> 1.0, >= 1.0.5)
34+
rails-dom-testing (~> 2.0)
35+
actionpack (5.0.2)
36+
actionview (= 5.0.2)
37+
activesupport (= 5.0.2)
38+
rack (~> 2.0)
39+
rack-test (~> 0.6.3)
40+
rails-dom-testing (~> 2.0)
3741
rails-html-sanitizer (~> 1.0, >= 1.0.2)
3842
actionpack-page_caching (1.1.0)
3943
actionpack (>= 4.0.0, < 6)
40-
actionview (4.2.8)
41-
activesupport (= 4.2.8)
44+
actionview (5.0.2)
45+
activesupport (= 5.0.2)
4246
builder (~> 3.1)
4347
erubis (~> 2.7.0)
44-
rails-dom-testing (~> 1.0, >= 1.0.5)
48+
rails-dom-testing (~> 2.0)
4549
rails-html-sanitizer (~> 1.0, >= 1.0.3)
46-
activejob (4.2.8)
47-
activesupport (= 4.2.8)
48-
globalid (>= 0.3.0)
49-
activemodel (4.2.8)
50-
activesupport (= 4.2.8)
51-
builder (~> 3.1)
52-
activerecord (4.2.8)
53-
activemodel (= 4.2.8)
54-
activesupport (= 4.2.8)
55-
arel (~> 6.0)
56-
activesupport (4.2.8)
50+
activejob (5.0.2)
51+
activesupport (= 5.0.2)
52+
globalid (>= 0.3.6)
53+
activemodel (5.0.2)
54+
activesupport (= 5.0.2)
55+
activerecord (5.0.2)
56+
activemodel (= 5.0.2)
57+
activesupport (= 5.0.2)
58+
arel (~> 7.0)
59+
activesupport (5.0.2)
60+
concurrent-ruby (~> 1.0, >= 1.0.2)
5761
i18n (~> 0.7)
5862
minitest (~> 5.1)
59-
thread_safe (~> 0.3, >= 0.3.4)
6063
tzinfo (~> 1.1)
6164
addressable (2.5.0)
6265
public_suffix (~> 2.0, >= 2.0.2)
6366
ancestry (2.0.0)
6467
activerecord (>= 3.0.0)
6568
ansi (1.5.0)
66-
arel (6.0.4)
69+
arel (7.1.4)
6770
aruba (0.14.2)
6871
childprocess (~> 0.5.6)
6972
contracts (~> 0.9)
@@ -95,7 +98,7 @@ GEM
9598
childprocess (0.5.9)
9699
ffi (~> 1.0, >= 1.0.11)
97100
chunky_png (1.3.8)
98-
ckeditor_rails (4.3.4)
101+
ckeditor_rails (4.6.2)
99102
railties (>= 3.0)
100103
climate_control (0.1.0)
101104
cliver (0.3.2)
@@ -140,12 +143,11 @@ GEM
140143
daemons (1.2.4)
141144
database_cleaner (1.5.3)
142145
debug_inspector (0.0.2)
143-
devise (3.5.10)
146+
devise (4.2.1)
144147
bcrypt (~> 3.0)
145148
orm_adapter (~> 0.1)
146-
railties (>= 3.2.6, < 5)
149+
railties (>= 4.1.0, < 5.1)
147150
responders
148-
thread_safe (~> 0.1)
149151
warden (~> 1.2.3)
150152
diff-lcs (1.3)
151153
erubis (2.7.0)
@@ -161,8 +163,9 @@ GEM
161163
globalid (0.3.7)
162164
activesupport (>= 4.1.0)
163165
i18n (0.8.1)
164-
jquery-rails (3.1.4)
165-
railties (>= 3.0, < 5.0)
166+
jquery-rails (4.1.1)
167+
rails-dom-testing (>= 1, < 3)
168+
railties (>= 4.2.0)
166169
thor (>= 0.14, < 2.0)
167170
jquery-ui-rails (4.2.1)
168171
railties (>= 3.2.16)
@@ -181,10 +184,10 @@ GEM
181184
mime-types-data (~> 3.2015)
182185
mime-types-data (3.2016.0521)
183186
mini_portile2 (2.1.0)
184-
minitest (5.3.5)
185-
minitest-rails (2.0.3)
186-
minitest (>= 5.3.3, < 6.0)
187-
railties (~> 4.1)
187+
minitest (5.10.1)
188+
minitest-rails (3.0.0)
189+
minitest (~> 5.8)
190+
railties (~> 5.0)
188191
minitest-reporters (1.0.20)
189192
ansi
190193
builder
@@ -195,7 +198,8 @@ GEM
195198
multi_json (1.12.1)
196199
multi_test (0.1.2)
197200
mysql2 (0.4.5)
198-
nokogiri (1.6.8.1)
201+
nio4r (2.0.0)
202+
nokogiri (1.7.1)
199203
mini_portile2 (~> 2.1.0)
200204
orm_adapter (0.5.0)
201205
panoramic (0.0.6)
@@ -215,33 +219,34 @@ GEM
215219
method_source (~> 0.8.1)
216220
slop (~> 3.4)
217221
public_suffix (2.0.5)
218-
quiet_assets (1.1.0)
219-
railties (>= 3.1, < 5.0)
220-
rack (1.6.5)
222+
rack (2.0.1)
221223
rack-test (0.6.3)
222224
rack (>= 1.0)
223-
rails (4.2.8)
224-
actionmailer (= 4.2.8)
225-
actionpack (= 4.2.8)
226-
actionview (= 4.2.8)
227-
activejob (= 4.2.8)
228-
activemodel (= 4.2.8)
229-
activerecord (= 4.2.8)
230-
activesupport (= 4.2.8)
225+
rails (5.0.2)
226+
actioncable (= 5.0.2)
227+
actionmailer (= 5.0.2)
228+
actionpack (= 5.0.2)
229+
actionview (= 5.0.2)
230+
activejob (= 5.0.2)
231+
activemodel (= 5.0.2)
232+
activerecord (= 5.0.2)
233+
activesupport (= 5.0.2)
231234
bundler (>= 1.3.0, < 2.0)
232-
railties (= 4.2.8)
233-
sprockets-rails
234-
rails-deprecated_sanitizer (1.0.3)
235-
activesupport (>= 4.2.0.alpha)
236-
rails-dom-testing (1.0.8)
237-
activesupport (>= 4.2.0.beta, < 5.0)
235+
railties (= 5.0.2)
236+
sprockets-rails (>= 2.0.0)
237+
rails-controller-testing (1.0.1)
238+
actionpack (~> 5.x)
239+
actionview (~> 5.x)
240+
activesupport (~> 5.x)
241+
rails-dom-testing (2.0.2)
242+
activesupport (>= 4.2.0, < 6.0)
238243
nokogiri (~> 1.6)
239-
rails-deprecated_sanitizer (>= 1.0.1)
240244
rails-html-sanitizer (1.0.3)
241245
loofah (~> 2.0)
242-
railties (4.2.8)
243-
actionpack (= 4.2.8)
244-
activesupport (= 4.2.8)
246+
railties (5.0.2)
247+
actionpack (= 5.0.2)
248+
activesupport (= 5.0.2)
249+
method_source
245250
rake (>= 0.8.7)
246251
thor (>= 0.18.1, < 2.0)
247252
rake (12.0.0)
@@ -263,9 +268,9 @@ GEM
263268
sprockets (>= 2.8, < 4.0)
264269
sprockets-rails (>= 2.0, < 4.0)
265270
tilt (>= 1.1, < 3)
266-
simple_form (3.1.1)
267-
actionpack (~> 4.0)
268-
activemodel (~> 4.0)
271+
simple_form (3.3.1)
272+
actionpack (> 4, < 5.1)
273+
activemodel (> 4, < 5.1)
269274
single_test (0.6.0)
270275
rake
271276
slop (3.6.0)
@@ -279,7 +284,7 @@ GEM
279284
sqlite3 (1.3.13)
280285
sqlite3-ruby (1.3.3)
281286
sqlite3 (>= 1.3.3)
282-
term-ansicolor (1.4.1)
287+
term-ansicolor (1.5.0)
283288
tins (~> 1.0)
284289
test-unit (3.2.3)
285290
power_assert
@@ -291,7 +296,7 @@ GEM
291296
thread_safe (0.3.6)
292297
tilt (2.0.7)
293298
tins (1.13.2)
294-
tzinfo (1.2.2)
299+
tzinfo (1.2.3)
295300
thread_safe (~> 0.1)
296301
uglifier (3.1.9)
297302
execjs (>= 0.3.0, < 3)
@@ -322,14 +327,14 @@ DEPENDENCIES
322327
factory_girl_rails (= 3.3.0)
323328
launchy
324329
m (~> 1.2)
325-
minitest (~> 5.3.3)
326-
minitest-rails (~> 2.0.0)
330+
minitest
331+
minitest-rails
327332
minitest-reporters (~> 1.0.0)
328333
mocha
329334
mysql2
330335
poltergeist
331336
pry
332-
quiet_assets
337+
rails-controller-testing
333338
rake
334339
ruby-prof
335340
sass-rails (~> 5.0.0)

Rakefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env rake
22
begin
3+
$arel_silence_type_casting_deprecation=true
34
require 'bundler/setup'
45
rescue LoadError
56
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
@@ -104,7 +105,7 @@ def run_tests(tests_to_run)
104105
end
105106

106107
# Build and run against MySQL.
107-
task 'ci:test' => ['project:setup:mysql', 'db:drop', 'db:create:all', 'db:install', 'test']
108+
task 'ci:test' => [ 'project:setup:mysql', 'db:drop', 'db:create:all', 'db:install', 'test']
108109
task :default => 'ci:test'
109110

110111
require 'yard'

app/controllers/cms/base_controller.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module Cms
22
class BaseController < Cms::ApplicationController
33

4-
before_filter :redirect_to_cms_site
4+
before_action :redirect_to_cms_site
55
before_action :authenticate_cms_user!
6-
before_filter :cms_access_required
6+
before_action :cms_access_required
77

88
layout 'cms/application'
99

app/controllers/cms/connectors_controller.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Cms
22
class ConnectorsController < Cms::BaseController
3-
4-
before_filter :load_page, :only => [:new, :create]
3+
4+
before_action :load_page, :only => [:new, :create]
55

66
def new
77
@block_type = ContentType.find_by_key(params[:block_type] || session[:last_block_type] || 'html_block')

app/controllers/cms/content_controller.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ class ContentController < Cms::ApplicationController
88
include Cms::MobileAware
99
helper MobileHelper
1010

11-
skip_before_filter :redirect_to_cms_site
12-
before_filter :redirect_non_cms_users_to_public_site, :only => [:show, :show_page_route]
13-
before_filter :construct_path, :only => [:show]
14-
before_filter :construct_path_from_route, :only => [:show_page_route]
15-
before_filter :try_to_redirect, :only => [:show]
16-
before_filter :try_to_stream_file, :only => [:show]
17-
before_filter :load_page, :only => [:show, :show_page_route]
18-
before_filter :check_access_to_page, :except => [:edit, :preview]
19-
before_filter :select_cache_directory
11+
#skip_before_filter :redirect_to_cms_site
12+
before_action :redirect_non_cms_users_to_public_site, :only => [:show, :show_page_route]
13+
before_action :construct_path, :only => [:show]
14+
before_action :construct_path_from_route, :only => [:show_page_route]
15+
before_action :try_to_redirect, :only => [:show]
16+
before_action :try_to_stream_file, :only => [:show]
17+
before_action :load_page, :only => [:show, :show_page_route]
18+
before_action :check_access_to_page, :except => [:edit, :preview]
19+
before_action :select_cache_directory
2020

2121
self.responder = Cms::ContentResponder
2222

app/controllers/cms/dynamic_views_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class DynamicViewsController < Cms::BaseController
44
include Cms::AdminTab
55
check_permissions :administrate
66

7-
before_filter :load_view, :only => [:show, :edit, :update, :destroy]
7+
before_action :load_view, :only => [:show, :edit, :update, :destroy]
88

99
helper_method :dynamic_view_type
1010

app/controllers/cms/forms_controller.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class Cms::FormsController < Cms::ContentBlockController
22

3-
before_filter :associate_form_fields, only: [:create, :update]
4-
before_filter :strip_new_entry_params, only: [:create, :update]
3+
before_action :associate_form_fields, only: [:create, :update]
4+
before_action :strip_new_entry_params, only: [:create, :update]
55

66
helper do
77
# For new forms, if the user doesn't complete and save them, we need to delete them from the database.

app/controllers/cms/links_controller.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module Cms
22
class LinksController < Cms::BaseController
33

4-
before_filter :load_section, :only => [:new, :create, :move_to]
5-
before_filter :load_link, :only => [:destroy, :update]
6-
before_filter :load_draft_link, :only => [:edit]
4+
before_action :load_section, :only => [:new, :create, :move_to]
5+
before_action :load_link, :only => [:destroy, :update]
6+
before_action :load_draft_link, :only => [:edit]
77

88
include Cms::PublishWorkflow
99

app/controllers/cms/page_components_controller.rb

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module Cms
22
class PageComponentsController < Cms::ApplicationController
33
layout false
44
respond_to :json
5-
65
def new
76
@default_type = Cms::ContentType.default
87
@content_types = Cms::ContentType.other_connectables

0 commit comments

Comments
 (0)