From b002a9005479366ff5abb93ded90a04c2721d561 Mon Sep 17 00:00:00 2001 From: Matthew Lewinski Date: Wed, 18 Apr 2012 11:02:43 -0500 Subject: [PATCH] Remove use of deprecated ActiveSupport::Memoizable --- lib/api_guides/document.rb | 5 ----- lib/api_guides/generator.rb | 6 +----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/api_guides/document.rb b/lib/api_guides/document.rb index 1654aed..36e5817 100644 --- a/lib/api_guides/document.rb +++ b/lib/api_guides/document.rb @@ -1,7 +1,5 @@ # -*- encoding: utf-8 -*- -require 'active_support/core_ext/object' - module ApiGuides # The document class models the raw information in each guide. # @@ -84,9 +82,6 @@ module ApiGuides # left-aligned so code and other indentation senstive markdown will be # parsed correctly. class Document - # Use ActiveSupport to memoize parsing methods - extend ActiveSupport::Memoizable - attr_accessor :title, :position, :sections def initialize(attributes = {}) diff --git a/lib/api_guides/generator.rb b/lib/api_guides/generator.rb index a6a28d9..98c19d6 100644 --- a/lib/api_guides/generator.rb +++ b/lib/api_guides/generator.rb @@ -52,8 +52,6 @@ module ApiGuides # # generator.generate class Generator - extend ActiveSupport::Memoizable - attr_accessor :source_path, :site_path, :default, :title, :logo # You can instatiate a new generator by passing a hash of attributes @@ -153,9 +151,7 @@ def documents # Loop all the document's sections and examples to see all the different # languages specified by this document. def languages - documents.collect(&:sections).flatten.collect(&:examples).flatten.map(&:language).compact.uniq + @languages ||= documents.collect(&:sections).flatten.collect(&:examples).flatten.map(&:language).compact.uniq end - # Store this calculation for later so we don't have to do this retarded loop again. - memoize :languages end end