From 873bdbb591bcd23a5596e5212e9c1939d08bdc2f Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 4 Jan 2012 12:34:09 -0200 Subject: [PATCH] Remove timed_cached_fragment plugin --- app/helpers/application_helper.rb | 4 ++++ app/helpers/sweeper_helper.rb | 4 +--- app/views/friends/index.rhtml | 2 +- app/views/profile/_common.rhtml | 2 +- app/views/profile/_person_profile.rhtml | 2 +- app/views/profile/communities.rhtml | 2 +- app/views/profile/content_tagged.rhtml | 2 +- app/views/profile/friends.rhtml | 2 +- app/views/profile/members.rhtml | 2 +- app/views/profile/tags.rhtml | 2 +- app/views/search/tag.rhtml | 2 +- app/views/search/tags.rhtml | 2 +- app/views/shared/block.rhtml | 2 +- vendor/plugins/timed_cached_fragment/README | 29 ----------------------------- vendor/plugins/timed_cached_fragment/Rakefile | 22 ---------------------- vendor/plugins/timed_cached_fragment/init.rb | 2 -- vendor/plugins/timed_cached_fragment/install.rb | 1 - vendor/plugins/timed_cached_fragment/lib/timed_cache_fragment.rb | 75 --------------------------------------------------------------------------- vendor/plugins/timed_cached_fragment/tasks/timed_cache_fragment_tasks.rake | 4 ---- vendor/plugins/timed_cached_fragment/test/timed_cache_fragment_test.rb | 8 -------- vendor/plugins/timed_cached_fragment/uninstall.rb | 1 - 21 files changed, 16 insertions(+), 156 deletions(-) delete mode 100644 vendor/plugins/timed_cached_fragment/README delete mode 100644 vendor/plugins/timed_cached_fragment/Rakefile delete mode 100644 vendor/plugins/timed_cached_fragment/init.rb delete mode 100644 vendor/plugins/timed_cached_fragment/install.rb delete mode 100644 vendor/plugins/timed_cached_fragment/lib/timed_cache_fragment.rb delete mode 100644 vendor/plugins/timed_cached_fragment/tasks/timed_cache_fragment_tasks.rake delete mode 100644 vendor/plugins/timed_cached_fragment/test/timed_cache_fragment_test.rb delete mode 100644 vendor/plugins/timed_cached_fragment/uninstall.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d89a3b6..cf0a233 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1310,4 +1310,8 @@ module ApplicationHelper ) + content_tag('span', ' | ', :class => 'comment-footer comment-footer-hide') end end + + def cache_timeout(key, timeout, &block) + cache(key, { :expires_in => timeout }, &block) + end end diff --git a/app/helpers/sweeper_helper.rb b/app/helpers/sweeper_helper.rb index 48a6f9e..8540c66 100644 --- a/app/helpers/sweeper_helper.rb +++ b/app/helpers/sweeper_helper.rb @@ -4,9 +4,7 @@ module SweeperHelper ActionController::Base.new().expire_fragment(*args) end - def expire_timeout_fragment(*args) - ActionController::Base.new().expire_timeout_fragment(*args) - end + alias :expire_timeout_fragment :expire_fragment def expire_friends(profile) # public friends page diff --git a/app/views/friends/index.rhtml b/app/views/friends/index.rhtml index d2f3e3c..9a97bcb 100644 --- a/app/views/friends/index.rhtml +++ b/app/views/friends/index.rhtml @@ -2,7 +2,7 @@

<%= __("%s's friends") % profile.name %>

-<% cache_timeout(profile.manage_friends_cache_key(params), 4.hours.from_now) do %> +<% cache_timeout(profile.manage_friends_cache_key(params), 4.hours) do %> <% if @friends.empty? %>

diff --git a/app/views/profile/_common.rhtml b/app/views/profile/_common.rhtml index 69b4099..f543901 100644 --- a/app/views/profile/_common.rhtml +++ b/app/views/profile/_common.rhtml @@ -9,7 +9,7 @@ <% unless @action %> - <% cache_timeout(profile.cache_key + '-profile-general-info', 4.hours.from_now) do %> + <% cache_timeout(profile.cache_key + '-profile-general-info', 4.hours) do %> <%= _('Content') %> diff --git a/app/views/profile/_person_profile.rhtml b/app/views/profile/_person_profile.rhtml index e6bffab..bfd19e3 100644 --- a/app/views/profile/_person_profile.rhtml +++ b/app/views/profile/_person_profile.rhtml @@ -23,7 +23,7 @@ <%= display_field(_('e-Mail:'), profile, :email, true) { |email| link_to_email(email) } %> <% end %> - <% cache_timeout(profile.relationships_cache_key, 4.hours.from_now) do %> + <% cache_timeout(profile.relationships_cache_key, 4.hours) do %> <% if !(profile.organization.blank? && profile.organization_website.blank?) && (profile.active_fields.include?('organization') || profile.active_fields.include?('organization_website')) %> <%= _('Work')%> diff --git a/app/views/profile/communities.rhtml b/app/views/profile/communities.rhtml index 22e0252..8ecb9eb 100644 --- a/app/views/profile/communities.rhtml +++ b/app/views/profile/communities.rhtml @@ -2,7 +2,7 @@

<%= _("%s's communities") % profile.name %>

-<% cache_timeout(profile.communities_cache_key(params), 4.hour.from_now) do %> +<% cache_timeout(profile.communities_cache_key(params), 4.hour) do %>