Skip to content

Commit

Permalink
Merge pull request #32076 from utilum/use_dot
Browse files Browse the repository at this point in the history
Call methods with .method_name not ::method_name
  • Loading branch information
pixeltrix committed Feb 22, 2018
2 parents 651c249 + 6f6fe69 commit a5e8134
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions actionpack/test/controller/http_digest_authentication_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class DummyDigestController < ActionController::Base
before_action :authenticate_with_request, only: :display

USERS = { "lifo" => "world", "pretty" => "please",
"dhh" => ::Digest::MD5::hexdigest(["dhh", "SuperSecret", "secret"].join(":")) }
"dhh" => ::Digest::MD5.hexdigest(["dhh", "SuperSecret", "secret"].join(":")) }

def index
render plain: "Hello Secret"
Expand Down Expand Up @@ -181,9 +181,10 @@ def authenticate_with_request
end

test "authentication request with password stored as ha1 digest hash" do
@request.env["HTTP_AUTHORIZATION"] = encode_credentials(username: "dhh",
password: ::Digest::MD5::hexdigest(["dhh", "SuperSecret", "secret"].join(":")),
password_is_ha1: true)
@request.env["HTTP_AUTHORIZATION"] = encode_credentials(
username: "dhh",
password: ::Digest::MD5.hexdigest(["dhh", "SuperSecret", "secret"].join(":")),
password_is_ha1: true)
get :display

assert_response :success
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/routing_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def test_route_with_text_default

token = "\321\202\320\265\320\272\321\201\321\202".dup # 'text' in Russian
token.force_encoding(Encoding::BINARY)
escaped_token = CGI::escape(token)
escaped_token = CGI.escape(token)

assert_equal "/page/" + escaped_token, url_for(rs, controller: "content", action: "show_page", id: token)
assert_equal({ controller: "content", action: "show_page", id: token }, rs.recognize_path("/page/#{escaped_token}"))
Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/helpers/debug_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module DebugHelper
# created_at:
# </pre>
def debug(object)
Marshal::dump(object)
Marshal.dump(object)
object = ERB::Util.html_escape(object.to_yaml)
content_tag(:pre, object, class: "debug_dump")
rescue # errors from Marshal or YAML
Expand Down
4 changes: 2 additions & 2 deletions guides/rails_guides/kindle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def generate_front_matter(html_pages)
end

def generate_sections(html_pages)
FileUtils::rm_rf("sections/")
FileUtils.rm_rf("sections/")
html_pages.each_with_index do |page, section_idx|
FileUtils::mkdir_p("sections/%03d" % section_idx)
FileUtils.mkdir_p("sections/%03d" % section_idx)
doc = Nokogiri::HTML(File.open(page))
title = doc.at("title").inner_text.gsub("Ruby on Rails Guides: ", "")
title = page.capitalize.gsub(".html", "") if title.strip == ""
Expand Down

0 comments on commit a5e8134

Please sign in to comment.