Skip to content

Commit

Permalink
Fix typo in page_dump_helper.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
nnc committed Apr 19, 2024
1 parent 1083a9c commit 8ba3144
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -7,12 +7,12 @@ class InvalidResponse < StandardError; end

# Saves the content of response body to a file and tries to open it in your browser.
# Launchy must be present in your Gemfile for the page to open automatically.
def save_and_open_page(path = html_dump_defaul_path)
def save_and_open_page(path = html_dump_default_path)
save_page(path).tap { |s_path| open_file(s_path) }
end

private
def save_page(path = html_dump_defaul_path)
def save_page(path = html_dump_default_path)
raise InvalidResponse.new("Response is a redirection!") if response.redirection?
path = Pathname.new(path)
path.dirname.mkpath
Expand All @@ -27,7 +27,7 @@ def open_file(path)
warn "File saved to #{path}.\nPlease install the launchy gem to open the file automatically."
end

def html_dump_defaul_path
def html_dump_default_path
Rails.root.join("tmp/html_dump", "#{method_name}_#{DateTime.current.to_i}.html").to_s
end
end
Expand Down

0 comments on commit 8ba3144

Please sign in to comment.