[Haml] Convert Haml::Helpers::ActionViewExtensions docs to YARD.

This commit is contained in:
Nathan Weizenbaum 2009-05-02 02:35:30 -07:00
parent 83b0fc8209
commit f60d0f691e
3 changed files with 173 additions and 179 deletions

View File

@ -1,5 +1,7 @@
if defined?(ActionView)
require 'haml/helpers/action_view_mods' require 'haml/helpers/action_view_mods'
require 'haml/helpers/action_view_extensions' require 'haml/helpers/action_view_extensions'
end
module Haml module Haml
# This module contains various helpful methods to make it easier to do various tasks. # This module contains various helpful methods to make it easier to do various tasks.

View File

@ -1,6 +1,5 @@
require 'haml/helpers/action_view_mods' require 'haml/helpers/action_view_mods'
if defined?(ActionView)
module Haml module Haml
module Helpers module Helpers
# This module contains various useful helper methods # This module contains various useful helper methods
@ -12,7 +11,7 @@ if defined?(ActionView)
# Returns a value for the "class" attribute # Returns a value for the "class" attribute
# unique to this controller/action pair. # unique to this controller/action pair.
# This can be used to target styles specifically at this action or controller. # This can be used to target styles specifically at this action or controller.
# For example, if the current action were EntryController#show, # For example, if the current action were `EntryController#show`,
# #
# %div{:class => page_class} My Div # %div{:class => page_class} My Div
# #
@ -20,8 +19,7 @@ if defined?(ActionView)
# #
# <div class="entry show">My Div</div> # <div class="entry show">My Div</div>
# #
# Then, in a stylesheet # Then, in a stylesheet (shown here as {Sass}),
# (shown here as Sass),
# you could refer to this specific action: # you could refer to this specific action:
# #
# .entry.show # .entry.show
@ -32,14 +30,11 @@ if defined?(ActionView)
# .entry # .entry
# :color #00f # :color #00f
# #
# @return [String] The class name for the current page
def page_class def page_class
controller.controller_name + " " + controller.action_name controller.controller_name + " " + controller.action_name
end end
# :stopdoc:
alias_method :generate_content_class_names, :page_class alias_method :generate_content_class_names, :page_class
# :startdoc:
end
end end
end end
end end

View File

@ -1,4 +1,3 @@
if defined?(ActionView) and not defined?(Merb::Plugins)
module ActionView module ActionView
class Base class Base
def render_with_haml(*args, &block) def render_with_haml(*args, &block)
@ -173,5 +172,3 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
end end
end end
end end
end