This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ResponseBodyHtmlWriter | |
| def create_directory_for_html_files | |
| @time ||= Time.now.to_s(:number) | |
| unless @screenshots_directory | |
| @screenshots_directory = File.expand_path(File.join(RAILS_ROOT, | |
| 'public', | |
| 'screenshots', | |
| @time)) | |
| FileUtils.mkdir_p(@screenshots_directory) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ResponseBodyHtmlWriter | |
| def create_directory_for_html_files | |
| @time ||= Time.now.to_s(:number) | |
| unless @screenshots_directory | |
| @screenshots_directory = File.expand_path(File.join(RAILS_ROOT, | |
| 'public', | |
| 'screenshots', | |
| @time)) | |
| FileUtils.mkdir_p(@screenshots_directory) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ResponseBodyHtmlWriter | |
| def create_directory_for_html_files | |
| @time ||= Time.now.to_s(:number) | |
| unless @screenshots_directory | |
| @screenshots_directory = File.expand_path(File.join(RAILS_ROOT, | |
| 'public', | |
| 'screenshots', | |
| @time)) | |
| FileUtils.mkdir_p(@screenshots_directory) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module NavigationHelpers | |
| def path_to(page_name) | |
| case page_name | |
| when /^the home page$/i | |
| root_path | |
| when /^(.*)'s profile page$/i | |
| user_profile_path(User.find_by_login($1) | |
| else | |
| raise "Can't find mapping from \"#{page_name}\" to a path." | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module NavigationHelpers | |
| def path_to(page_name) | |
| case page_name | |
| when /^the home page$/i | |
| root_path | |
| when /^(.*)'s profile page$/i | |
| user_profile_path(User.find_by_login($1)) | |
| else | |
| raise "Can't find mapping from \"#{page_name}\" to a path." | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Foo | |
| class Bar | |
| include ActionController::UrlWriter | |
| def self.some_path | |
| puts root_path | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Foo | |
| class Bar | |
| include ActionController::UrlWriter | |
| def self.some_path | |
| puts root_path | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >: ./script/console | |
| Loading development environment (Rails 2.3.2) | |
| >> module Foo | |
| >> class Bar | |
| >> include ActionController::UrlWriter | |
| >> | |
| ?> def self.some_path | |
| >> puts root_path | |
| >> end | |
| >> end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TheRoutes < ApplicationController | |
| def foo | |
| render :nothing => true | |
| end | |
| end | |
| module Foo | |
| class Bar | |
| include ActionController::UrlWriter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Loading development environment (Rails 2.3.2) | |
| >> include ActionController::UrlWriter | |
| => Object | |
| >> root_path | |
| => "/" | |
| >> |