Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of deprecated ActiveSupport::Memoizable #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/api_guides/document.rb
Original file line number Diff line number Diff line change
@@ -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.
#
Expand Down Expand Up @@ -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 = {})
Expand Down
6 changes: 1 addition & 5 deletions lib/api_guides/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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