mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 21:10:54 +00:00
Bump to Rails 3.2.18
Reduce aggressive topic reply/view count caching Improve shout box spacing Pass broken tests
This commit is contained in:
parent
91f3161eff
commit
20c4f4cfc4
8 changed files with 80 additions and 74 deletions
2
Gemfile
2
Gemfile
|
@ -3,7 +3,7 @@ source 'http://rubygems.org'
|
||||||
ruby '2.1.1'
|
ruby '2.1.1'
|
||||||
|
|
||||||
gem 'dotenv-rails', '~> 0.10.0'
|
gem 'dotenv-rails', '~> 0.10.0'
|
||||||
gem 'rails', '~> 3.2.17'
|
gem 'rails', '~> 3.2.18'
|
||||||
gem 'mysql2', '~> 0.3.15'
|
gem 'mysql2', '~> 0.3.15'
|
||||||
gem 'dalli', '~> 2.7.0'
|
gem 'dalli', '~> 2.7.0'
|
||||||
gem 'puma', '~> 2.8.2'
|
gem 'puma', '~> 2.8.2'
|
||||||
|
|
107
Gemfile.lock
107
Gemfile.lock
|
@ -1,12 +1,12 @@
|
||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (3.2.17)
|
actionmailer (3.2.18)
|
||||||
actionpack (= 3.2.17)
|
actionpack (= 3.2.18)
|
||||||
mail (~> 2.5.4)
|
mail (~> 2.5.4)
|
||||||
actionpack (3.2.17)
|
actionpack (3.2.18)
|
||||||
activemodel (= 3.2.17)
|
activemodel (= 3.2.18)
|
||||||
activesupport (= 3.2.17)
|
activesupport (= 3.2.18)
|
||||||
builder (~> 3.0.0)
|
builder (~> 3.0.0)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
journey (~> 1.0.4)
|
journey (~> 1.0.4)
|
||||||
|
@ -16,21 +16,21 @@ GEM
|
||||||
sprockets (~> 2.2.1)
|
sprockets (~> 2.2.1)
|
||||||
active_link_to (1.0.2)
|
active_link_to (1.0.2)
|
||||||
actionpack
|
actionpack
|
||||||
activemodel (3.2.17)
|
activemodel (3.2.18)
|
||||||
activesupport (= 3.2.17)
|
activesupport (= 3.2.18)
|
||||||
builder (~> 3.0.0)
|
builder (~> 3.0.0)
|
||||||
activerecord (3.2.17)
|
activerecord (3.2.18)
|
||||||
activemodel (= 3.2.17)
|
activemodel (= 3.2.18)
|
||||||
activesupport (= 3.2.17)
|
activesupport (= 3.2.18)
|
||||||
arel (~> 3.0.2)
|
arel (~> 3.0.2)
|
||||||
tzinfo (~> 0.3.29)
|
tzinfo (~> 0.3.29)
|
||||||
activeresource (3.2.17)
|
activeresource (3.2.18)
|
||||||
activemodel (= 3.2.17)
|
activemodel (= 3.2.18)
|
||||||
activesupport (= 3.2.17)
|
activesupport (= 3.2.18)
|
||||||
activesupport (3.2.17)
|
activesupport (3.2.18)
|
||||||
i18n (~> 0.6, >= 0.6.4)
|
i18n (~> 0.6, >= 0.6.4)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
annotate (2.6.2)
|
annotate (2.6.3)
|
||||||
activerecord (>= 2.3.0)
|
activerecord (>= 2.3.0)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
arel (3.0.3)
|
arel (3.0.3)
|
||||||
|
@ -69,7 +69,7 @@ GEM
|
||||||
activesupport (>= 3.2.0)
|
activesupport (>= 3.2.0)
|
||||||
json (>= 1.7)
|
json (>= 1.7)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
childprocess (0.5.2)
|
childprocess (0.5.3)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
cliver (0.3.2)
|
cliver (0.3.2)
|
||||||
codeclimate-test-reporter (0.3.0)
|
codeclimate-test-reporter (0.3.0)
|
||||||
|
@ -81,11 +81,11 @@ GEM
|
||||||
coffee-script (2.2.0)
|
coffee-script (2.2.0)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.3.3)
|
coffee-script-source (1.7.0)
|
||||||
columnize (0.3.6)
|
columnize (0.8.9)
|
||||||
country_code_select (1.0.1)
|
country_code_select (1.0.1)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
dalli (2.7.0)
|
dalli (2.7.1)
|
||||||
database_cleaner (1.2.0)
|
database_cleaner (1.2.0)
|
||||||
debug_inspector (0.0.2)
|
debug_inspector (0.0.2)
|
||||||
debugger (1.6.6)
|
debugger (1.6.6)
|
||||||
|
@ -93,7 +93,7 @@ GEM
|
||||||
debugger-linecache (~> 1.2.0)
|
debugger-linecache (~> 1.2.0)
|
||||||
debugger-ruby_core_source (~> 1.3.2)
|
debugger-ruby_core_source (~> 1.3.2)
|
||||||
debugger-linecache (1.2.0)
|
debugger-linecache (1.2.0)
|
||||||
debugger-ruby_core_source (1.3.2)
|
debugger-ruby_core_source (1.3.4)
|
||||||
diff-lcs (1.2.5)
|
diff-lcs (1.2.5)
|
||||||
dotenv (0.10.0)
|
dotenv (0.10.0)
|
||||||
dotenv-rails (0.10.0)
|
dotenv-rails (0.10.0)
|
||||||
|
@ -102,8 +102,7 @@ GEM
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
exceptional (2.0.33)
|
exceptional (2.0.33)
|
||||||
rack
|
rack
|
||||||
execjs (1.4.0)
|
execjs (2.0.2)
|
||||||
multi_json (~> 1.0)
|
|
||||||
factory_girl (4.4.0)
|
factory_girl (4.4.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
factory_girl_rails (4.4.1)
|
factory_girl_rails (4.4.1)
|
||||||
|
@ -112,15 +111,14 @@ GEM
|
||||||
faraday (0.9.0)
|
faraday (0.9.0)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
ffi (1.9.3)
|
ffi (1.9.3)
|
||||||
ffi (1.9.3-x86-mingw32)
|
|
||||||
font-awesome-sass (4.0.3.1)
|
font-awesome-sass (4.0.3.1)
|
||||||
sass (~> 3.2)
|
sass (~> 3.2)
|
||||||
gruff (0.3.6)
|
gruff (0.3.7)
|
||||||
hike (1.2.3)
|
hike (1.2.3)
|
||||||
i18n (0.6.9)
|
i18n (0.6.9)
|
||||||
journey (1.0.4)
|
journey (1.0.4)
|
||||||
jquery-rails (2.0.2)
|
jquery-rails (2.0.3)
|
||||||
railties (>= 3.2.0, < 5.0)
|
railties (>= 3.1.0, < 5.0)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
json (1.8.1)
|
json (1.8.1)
|
||||||
libv8 (3.16.14.3)
|
libv8 (3.16.14.3)
|
||||||
|
@ -130,20 +128,18 @@ GEM
|
||||||
method_source (0.8.2)
|
method_source (0.8.2)
|
||||||
mime-types (1.25.1)
|
mime-types (1.25.1)
|
||||||
mini_portile (0.5.3)
|
mini_portile (0.5.3)
|
||||||
multi_json (1.8.4)
|
multi_json (1.10.0)
|
||||||
multipart-post (2.0.0)
|
multipart-post (2.0.0)
|
||||||
mysql2 (0.3.15)
|
mysql2 (0.3.15)
|
||||||
neat (1.6.0)
|
neat (1.6.0)
|
||||||
bourbon (>= 3.1)
|
bourbon (>= 3.1)
|
||||||
sass (>= 3.3)
|
sass (>= 3.3)
|
||||||
net-scp (1.1.2)
|
net-scp (1.2.1)
|
||||||
net-ssh (>= 2.6.5)
|
net-ssh (>= 2.6.5)
|
||||||
net-ssh (2.8.0)
|
net-ssh (2.9.0)
|
||||||
newrelic_rpm (3.7.2.195)
|
newrelic_rpm (3.7.2.195)
|
||||||
nokogiri (1.6.1)
|
nokogiri (1.6.1)
|
||||||
mini_portile (~> 0.5.0)
|
mini_portile (~> 0.5.0)
|
||||||
nokogiri (1.6.1-x86-mingw32)
|
|
||||||
mini_portile (~> 0.5.0)
|
|
||||||
oj (2.5.5)
|
oj (2.5.5)
|
||||||
poltergeist (1.5.0)
|
poltergeist (1.5.0)
|
||||||
capybara (~> 2.1)
|
capybara (~> 2.1)
|
||||||
|
@ -155,11 +151,6 @@ GEM
|
||||||
coderay (~> 1.0)
|
coderay (~> 1.0)
|
||||||
method_source (~> 0.8)
|
method_source (~> 0.8)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
pry (0.9.12.6-x86-mingw32)
|
|
||||||
coderay (~> 1.0)
|
|
||||||
method_source (~> 0.8)
|
|
||||||
slop (~> 3.4)
|
|
||||||
win32console (~> 1.3)
|
|
||||||
pry-debugger (0.2.2)
|
pry-debugger (0.2.2)
|
||||||
debugger (~> 1.3)
|
debugger (~> 1.3)
|
||||||
pry (~> 0.9.10)
|
pry (~> 0.9.10)
|
||||||
|
@ -170,26 +161,26 @@ GEM
|
||||||
rack (1.4.5)
|
rack (1.4.5)
|
||||||
rack-cache (1.2)
|
rack-cache (1.2)
|
||||||
rack (>= 0.4)
|
rack (>= 0.4)
|
||||||
rack-ssl (1.3.3)
|
rack-ssl (1.3.4)
|
||||||
rack
|
rack
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.2)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (3.2.17)
|
rails (3.2.18)
|
||||||
actionmailer (= 3.2.17)
|
actionmailer (= 3.2.18)
|
||||||
actionpack (= 3.2.17)
|
actionpack (= 3.2.18)
|
||||||
activerecord (= 3.2.17)
|
activerecord (= 3.2.18)
|
||||||
activeresource (= 3.2.17)
|
activeresource (= 3.2.18)
|
||||||
activesupport (= 3.2.17)
|
activesupport (= 3.2.18)
|
||||||
bundler (~> 1.0)
|
bundler (~> 1.0)
|
||||||
railties (= 3.2.17)
|
railties (= 3.2.18)
|
||||||
railties (3.2.17)
|
railties (3.2.18)
|
||||||
actionpack (= 3.2.17)
|
actionpack (= 3.2.18)
|
||||||
activesupport (= 3.2.17)
|
activesupport (= 3.2.18)
|
||||||
rack-ssl (~> 1.3.2)
|
rack-ssl (~> 1.3.2)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
rdoc (~> 3.4)
|
rdoc (~> 3.4)
|
||||||
thor (>= 0.14.6, < 2.0)
|
thor (>= 0.14.6, < 2.0)
|
||||||
rake (10.1.1)
|
rake (10.3.1)
|
||||||
rdoc (3.12.2)
|
rdoc (3.12.2)
|
||||||
json (~> 1.4)
|
json (~> 1.4)
|
||||||
ref (1.0.5)
|
ref (1.0.5)
|
||||||
|
@ -198,7 +189,7 @@ GEM
|
||||||
rspec-expectations (2.14.5)
|
rspec-expectations (2.14.5)
|
||||||
diff-lcs (>= 1.1.3, < 2.0)
|
diff-lcs (>= 1.1.3, < 2.0)
|
||||||
rspec-mocks (2.14.6)
|
rspec-mocks (2.14.6)
|
||||||
rspec-rails (2.14.1)
|
rspec-rails (2.14.2)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activemodel (>= 3.0)
|
activemodel (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
|
@ -206,10 +197,10 @@ GEM
|
||||||
rspec-core (~> 2.14.0)
|
rspec-core (~> 2.14.0)
|
||||||
rspec-expectations (~> 2.14.0)
|
rspec-expectations (~> 2.14.0)
|
||||||
rspec-mocks (~> 2.14.0)
|
rspec-mocks (~> 2.14.0)
|
||||||
rubyzip (1.1.2)
|
rubyzip (1.1.3)
|
||||||
sanitize (2.1.0)
|
sanitize (2.1.0)
|
||||||
nokogiri (>= 1.4.4)
|
nokogiri (>= 1.4.4)
|
||||||
sass (3.3.4)
|
sass (3.3.7)
|
||||||
sass-rails (3.2.6)
|
sass-rails (3.2.6)
|
||||||
railties (~> 3.2.0)
|
railties (~> 3.2.0)
|
||||||
sass (>= 3.1.10)
|
sass (>= 3.1.10)
|
||||||
|
@ -229,9 +220,9 @@ GEM
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
sshkit (1.3.0)
|
sshkit (1.4.0)
|
||||||
net-scp (>= 1.1.2)
|
net-scp (>= 1.1.2)
|
||||||
net-ssh
|
net-ssh (>= 2.8.0)
|
||||||
term-ansicolor
|
term-ansicolor
|
||||||
term-ansicolor (1.3.0)
|
term-ansicolor (1.3.0)
|
||||||
tins (~> 1.0)
|
tins (~> 1.0)
|
||||||
|
@ -241,26 +232,24 @@ GEM
|
||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
timecop (0.7.1)
|
timecop (0.7.1)
|
||||||
tins (1.0.1)
|
tins (1.1.0)
|
||||||
tinymce-rails (3.5.9)
|
tinymce-rails (3.5.9)
|
||||||
railties (>= 3.1.1)
|
railties (>= 3.1.1)
|
||||||
treetop (1.4.15)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
tzinfo (0.3.38)
|
tzinfo (0.3.39)
|
||||||
uglifier (2.5.0)
|
uglifier (2.5.0)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
websocket (1.0.7)
|
websocket (1.0.7)
|
||||||
websocket-driver (0.3.2)
|
websocket-driver (0.3.3)
|
||||||
will_paginate (3.0.5)
|
will_paginate (3.0.5)
|
||||||
win32console (1.3.2-x86-mingw32)
|
|
||||||
xpath (2.0.0)
|
xpath (2.0.0)
|
||||||
nokogiri (~> 1.3)
|
nokogiri (~> 1.3)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
x86-mingw32
|
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
active_link_to (~> 1.0.2)
|
active_link_to (~> 1.0.2)
|
||||||
|
@ -298,7 +287,7 @@ DEPENDENCIES
|
||||||
pry-debugger (~> 0.2.2)
|
pry-debugger (~> 0.2.2)
|
||||||
puma (~> 2.8.2)
|
puma (~> 2.8.2)
|
||||||
quiet_assets (~> 1.0.2)
|
quiet_assets (~> 1.0.2)
|
||||||
rails (~> 3.2.17)
|
rails (~> 3.2.18)
|
||||||
rmagick (~> 2.13.2)
|
rmagick (~> 2.13.2)
|
||||||
rspec-rails (~> 2.14.1)
|
rspec-rails (~> 2.14.1)
|
||||||
sanitize (~> 2.1.0)
|
sanitize (~> 2.1.0)
|
||||||
|
|
|
@ -2,9 +2,13 @@
|
||||||
Shoutbox Messages
|
Shoutbox Messages
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#shoutbox {
|
||||||
|
display: table;
|
||||||
|
}
|
||||||
|
|
||||||
.shoutmsg {
|
.shoutmsg {
|
||||||
|
display: table-row;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
display: block;
|
|
||||||
clear: both;
|
clear: both;
|
||||||
|
|
||||||
.timestamp {
|
.timestamp {
|
||||||
|
@ -12,12 +16,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.user {
|
.user {
|
||||||
float: left;
|
display: table-cell;
|
||||||
padding: 0 5px 5px 0;
|
min-width: 30%;
|
||||||
|
|
||||||
.delete {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.username {
|
.username {
|
||||||
clear: right;
|
clear: right;
|
||||||
|
@ -30,4 +30,10 @@
|
||||||
color: #5a5a5a;
|
color: #5a5a5a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
max-width: 66%;
|
||||||
|
display: table-cell;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,13 +65,13 @@ class Topic < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def cached_view_count
|
def cached_view_count
|
||||||
Rails.cache.fetch(cache_key('view_count'), expires_in: 24.hours) do
|
Rails.cache.fetch(cache_key('view_count'), expires_in: 1.hours) do
|
||||||
view_count
|
view_count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def cached_posts_count
|
def cached_posts_count
|
||||||
Rails.cache.fetch(cache_key('posts'), expires_in: 12.hours) do
|
Rails.cache.fetch(cache_key('posts'), expires_in: 10.minutes) do
|
||||||
posts.count - 1
|
posts.count - 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
<div class="shoutmsg">
|
<div class="shoutmsg">
|
||||||
<div class="user">
|
<div class="user">
|
||||||
<span class="username">
|
<span class="username">
|
||||||
|
<% if shoutmsg.can_destroy? cuser %>
|
||||||
|
<%= link_to icon('times'), shoutmsg, method: :delete %>
|
||||||
|
<% end %>
|
||||||
<%= namelink shoutmsg.user %>
|
<%= namelink shoutmsg.user %>
|
||||||
</span>
|
</span>
|
||||||
<span class="time">
|
<span class="time">
|
||||||
<%= shoutmsg.created_at ? shoutmsg.created_at.strftime("%H:%M") : Time.now.strftime("%H:%M") %>
|
<%= shoutmsg.created_at ? shoutmsg.created_at.strftime("%H:%M") : Time.now.strftime("%H:%M") %>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="message">
|
||||||
<%= shoutmsg.text %>
|
<%= shoutmsg.text %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,6 +8,9 @@ module Ensl
|
||||||
# Custom error pages
|
# Custom error pages
|
||||||
config.exceptions_app = self.routes
|
config.exceptions_app = self.routes
|
||||||
|
|
||||||
|
# Additional assets
|
||||||
|
config.assets.precompile += %w{errors.css}
|
||||||
|
|
||||||
# Custom directories with classes and modules you want to be autoloadable.
|
# Custom directories with classes and modules you want to be autoloadable.
|
||||||
config.autoload_paths += Dir["#{config.root}/app/services/**/", "#{config.root}/app/models/concerns/"]
|
config.autoload_paths += Dir["#{config.root}/app/services/**/", "#{config.root}/app/models/concerns/"]
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ feature 'Case insensitive login' do
|
||||||
expect(page).to have_content(I18n.t('login_successful'))
|
expect(page).to have_content(I18n.t('login_successful'))
|
||||||
|
|
||||||
within user_status do
|
within user_status do
|
||||||
expect(page).to have_content(username)
|
expect(page).to have_content(account_link)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ feature 'Case insensitive login' do
|
||||||
expect(page).to have_content(I18n.t('login_successful'))
|
expect(page).to have_content(I18n.t('login_successful'))
|
||||||
|
|
||||||
within user_status do
|
within user_status do
|
||||||
expect(page).to have_content(username)
|
expect(page).to have_content(account_link)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -37,4 +37,8 @@ feature 'Case insensitive login' do
|
||||||
fill_in "login_username", with: username
|
fill_in "login_username", with: username
|
||||||
fill_in "login_password", with: password
|
fill_in "login_password", with: password
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def account_link
|
||||||
|
'ACCOUNT'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ feature 'Visitor signs up' do
|
||||||
click_button submit(:user, :create)
|
click_button submit(:user, :create)
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(user_status).to have_content(user[:username])
|
expect(user_status).to have_content('ACCOUNT')
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'with invalid Email' do
|
scenario 'with invalid Email' do
|
||||||
|
|
Loading…
Reference in a new issue