Permalink
Browse files

Documenting cache_file.

  • Loading branch information...
1 parent e754fc5 commit affb151d19e57448823d2688be36ad642878529b @jqr committed Apr 5, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 runkeeper.rb
View
@@ -67,6 +67,8 @@ def self.open_url_and_cache_activities_page(user_name)
Nokogiri::HTML(raw_html)
end
+ # Stores contents at path, completely overwriting the previous
+ # file. Automatically creates any directories needed.
def self.cache_file(path, contents)
FileUtils.mkdir_p(File.dirname(path))
File.open(path, 'w') do |file|

0 comments on commit affb151

Please sign in to comment.