Skip to content

Commit

Permalink
Merge pull request #2135 from zz9pzza/move_master_to_ruby2
Browse files Browse the repository at this point in the history
Move master to ruby2
  • Loading branch information
elzj committed Jun 19, 2015
2 parents 1e37dbd + 7d720b2 commit 4f9ef84
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
1 change: 1 addition & 0 deletions .ruby_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-2.0.0-p598
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
- TEST_GROUP="cucumber -f progress -r features features/users"
- TEST_GROUP="cucumber -f progress -r features features/works"
rvm:
- "1.9.3"
- "2.0.0"
services:
- elasticsearch
- redis-server
Expand Down
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'http://rubygems.org'

ruby '1.9.3'
ruby '2.0.0'

gem 'bundler'

Expand Down Expand Up @@ -30,12 +30,11 @@ gem "lograge" # https://github.com/roidrage/lograge
gem 'will_paginate', '>=3.0.2'
gem 'acts_as_list'
gem 'akismetor'
gem 'psych' , '1.3.4'

gem 'httparty'
gem 'htmlentities'
gem 'whenever', '~>0.6.2', :require => false
gem 'nokogiri', '>=1.4.2'
gem 'nokogiri', '>=1.6.6.2'
gem 'mechanize'
gem 'sanitize'
gem 'rest-client', :require => 'rest_client'
Expand Down
4 changes: 1 addition & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ GEM
method_source (~> 0.8)
slop (~> 3.4)
win32console (~> 1.3)
psych (1.3.4)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
Expand Down Expand Up @@ -408,13 +407,12 @@ DEPENDENCIES
mysql2
newrelic-redis
newrelic_rpm (= 3.9.3.241)
nokogiri (>= 1.4.2)
nokogiri (>= 1.6.6.2)
paperclip
permit_yo
phrase
pickle
pry
psych (= 1.3.4)
rack-dev-mark
rails (= 3.2.21)
redis (>= 3.0)
Expand Down
11 changes: 4 additions & 7 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def set_flash_cookie(key=nil, msg=nil)
# def setflash (this is here in case someone is grepping for the definition of the method)
alias :setflash :set_flash_cookie

def current_user
@current_user ||= current_user_session && current_user_session.record
end

protected

def record_not_found (exception)
Expand All @@ -64,13 +68,6 @@ def current_user_session
@current_user_session = UserSession.find
end

def current_user
@current_user = current_user_session && current_user_session.record
# if Rails.env.development? && params[:force_current_user].present?
# @current_user = User.find_by_login(params[:force_current_user])
# end
end

def current_admin_session
return @current_admin_session if defined?(@current_admin_session)
@current_admin_session = AdminSession.find
Expand Down
8 changes: 6 additions & 2 deletions spec/lib/html_cleaner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,9 @@
result = add_paragraphs_to_text("some\n\n\ntext")
doc = Nokogiri::HTML.fragment(result)
expect(doc.xpath("./p[1]").children.to_s.strip).to eq("some")
expect(doc.xpath("./p[2]").children.to_s.strip).to eq(" ")
# http://en.wikipedia.org/wiki/Non-breaking_space
# ISO/IEC 8859   is character 160
expect(doc.xpath("./p[2]").children.to_s.strip.ord).to eq(160)
expect(doc.xpath("./p[3]").children.to_s.strip).to eq("text")
end

Expand All @@ -660,7 +662,9 @@
result = add_paragraphs_to_text("some<br/><br/><br/>text")
doc = Nokogiri::HTML.fragment(result)
expect(doc.xpath("./p[1]").children.to_s.strip).to eq("some")
expect(doc.xpath("./p[2]").children.to_s.strip).to eq("&#160;")
# http://en.wikipedia.org/wiki/Non-breaking_space
# ISO/IEC 8859 &nbsp; is character 160
expect(doc.xpath("./p[2]").children.to_s.strip.ord).to eq(160)
expect(doc.xpath("./p[3]").children.to_s.strip).to eq("text")
end

Expand Down

0 comments on commit 4f9ef84

Please sign in to comment.