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