Skip to content

Commit

Permalink
Remove superfluous begin/end in caching.rb methods #836
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@908 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Mar 14, 2005
1 parent 823a918 commit 066988d
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions actionpack/lib/action_controller/caching.rb
Expand Up @@ -292,11 +292,7 @@ def initialize
end

def read(name, options = {}) #:nodoc:
begin
@mutex.synchronize { @data[name] }
rescue
nil
end
@mutex.synchronize { @data[name] } rescue nil
end

def write(name, value, options = {}) #:nodoc:
Expand Down Expand Up @@ -326,20 +322,14 @@ def initialize(cache_path)
end

def write(name, value, options = {}) #:nodoc:
begin
ensure_cache_path(File.dirname(real_file_path(name)))
File.open(real_file_path(name), "w+") { |f| f.write(value) }
rescue => e
Base.logger.info "Couldn't create cache directory: #{name} (#{e.message})" unless Base.logger.nil?
end
ensure_cache_path(File.dirname(real_file_path(name)))
File.open(real_file_path(name), "w+") { |f| f.write(value) }
rescue => e
Base.logger.info "Couldn't create cache directory: #{name} (#{e.message})" unless Base.logger.nil?
end

def read(name, options = {}) #:nodoc:
begin
IO.read(real_file_path(name))
rescue
nil
end
IO.read(real_file_path(name)) rescue nil
end

def delete(name, options) #:nodoc:
Expand Down

0 comments on commit 066988d

Please sign in to comment.