From 7b8457d963bb7e0320b87deb92cc45d085678156 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Wed, 2 May 2012 11:18:16 -0700 Subject: [PATCH] Yard doc cleanup 2 --- .../lib/middleman-core/application.rb | 8 ++++---- .../middleman-core/core_extensions/request.rb | 19 ++++++++++--------- middleman-core/lib/middleman-core/util.rb | 18 ++++++++++-------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/middleman-core/lib/middleman-core/application.rb b/middleman-core/lib/middleman-core/application.rb index cd9749c4..ad2459a7 100644 --- a/middleman-core/lib/middleman-core/application.rb +++ b/middleman-core/lib/middleman-core/application.rb @@ -40,8 +40,8 @@ module Middleman # Set class-wide defaults # - # @param [Symbol] Unique key name - # @param Default value + # @param [Symbol] key Unique key name + # @param value Default value # @return [void] def set(key, value=nil, &block) @defaults ||= {} @@ -55,8 +55,8 @@ module Middleman # Set attributes (global variables) # - # @param [Symbol] Name of the attribue - # @param Attribute value + # @param [Symbol] key Name of the attribue + # @param value Attribute value # @return [void] def set(key, value=nil, &block) setter = "#{key}=".to_sym diff --git a/middleman-core/lib/middleman-core/core_extensions/request.rb b/middleman-core/lib/middleman-core/core_extensions/request.rb index 228c0377..cfa9d18c 100644 --- a/middleman-core/lib/middleman-core/core_extensions/request.rb +++ b/middleman-core/lib/middleman-core/core_extensions/request.rb @@ -100,7 +100,7 @@ module Middleman # Use Rack middleware # - # @param [Class] Middleware + # @param [Class] middleware Middleware module # @return [void] def use(middleware, *args, &block) @middleware ||= [] @@ -109,7 +109,7 @@ module Middleman # Add Rack App mapped to specific path # - # @param [String] Path to map + # @param [String] map Path to map # @return [void] def map(map, &block) @mappings ||= [] @@ -229,8 +229,7 @@ module Middleman # Rack Interface # - # @private - # @param Rack environment + # @param env Rack environment def call!(env) self.env = env # Store environment, request and response for later @@ -250,16 +249,18 @@ module Middleman # Halt the current request and return a response # - # @private - # @param [String] Response value + # @param [String] response Response value def halt(response) throw :halt, response end - # Core response method. We process the request, check with the sitemap, - # and return the correct file, response or status message. + # Core response method. We process the request, check with + # the sitemap, and return the correct file, response or status + # message. # - # @private + # @param env + # @param [Rack::Request] req + # @param [Rack::Response] res def process_request(env, req, res) start_time = Time.now diff --git a/middleman-core/lib/middleman-core/util.rb b/middleman-core/lib/middleman-core/util.rb index 09167e29..732e689f 100644 --- a/middleman-core/lib/middleman-core/util.rb +++ b/middleman-core/lib/middleman-core/util.rb @@ -61,15 +61,14 @@ module Middleman # Either get the cached key or save the contents of the block # - # @param Anything Hash can use as a key - # @return Cached value + # @param key Anything Hash can use as a key def fetch(*key) @cache[key] ||= yield end # Whether the key is in the cache # - # @param Anything Hash can use as a key + # @param key Anything Hash can use as a key # @return [Boolean] def has_key?(key) @cache.has_key?(key) @@ -77,31 +76,34 @@ module Middleman # Get a specific key # - # @param Anything Hash can use as a key - # @return Cached value + # @param key Anything Hash can use as a key def get(key) @cache[key] end + # Array of keys + # @return [Array] def keys @cache.keys end # Clear the entire cache + # @return [void] def clear @cache = {} end # Set a specific key # - # @param Anything Hash can use as a key - # @param Cached value + # @param key Anything Hash can use as a key + # @param value Cached value + # @return [void] def set(key, value) @cache[key] = value end # Remove a specific key - # @param Anything Hash can use as a key + # @param key Anything Hash can use as a key def remove(*key) @cache.delete(key) end