lib/templates/default/fulldoc/html/setup.rb in yard-cucumber-2.0.3 vs lib/templates/default/fulldoc/html/setup.rb in yard-cucumber-2.1.0

- old
+ new

@@ -13,11 +13,11 @@ @features = Registry.all(:feature) if @features @features.each {|feature| serialize(feature) } - generate_full_list @features.sort {|x,y| x.value.to_s <=> y.value.to_s }, :feature + #generate_full_list @features.sort {|x,y| x.value.to_s <=> y.value.to_s }, :feature end # # Generate pages for each tag, with the 'tag' template and then generate the # page which is the full list of tags. Tags are ordered in descending order @@ -26,11 +26,11 @@ @tags = Registry.all(:tag) if @tags @tags.each {|tag| serialize(tag) } - generate_full_list @tags.sort {|x,y| y.all_scenarios.size <=> x.all_scenarios.size }, :tag + #generate_full_list @tags.sort {|x,y| y.all_scenarios.size <=> x.all_scenarios.size }, :tag end # Generates the requirements splash page with the 'requirements' template serialize(YARD::CodeObjects::Cucumber::CUCUMBER_NAMESPACE) @@ -44,18 +44,46 @@ feature_directories = YARD::CodeObjects::Cucumber::CUCUMBER_NAMESPACE.children.find_all {|child| child.is_a?(YARD::CodeObjects::Cucumber::FeatureDirectory) } serialize_feature_directories(feature_directories) end -# -# Generate a full_list page of the specified objects with the specified type. -# + +# Generate feature list +# @note this method is called automically by YARD based on the menus defined in the layout +def generate_feature_list + @features = Registry.all(:feature) + generate_full_list @features.sort {|x,y| x.value.to_s <=> y.value.to_s }, :feature +end + +# Generate tag list +# @note this method is called automically by YARD based on the menus defined in the layout +def generate_tag_list + @tags = Registry.all(:tag) + generate_full_list @tags.sort {|x,y| y.all_scenarios.size <=> x.all_scenarios.size }, :tag +end + +# Generate a step definition list +# @note this menu is not automatically added until yard configuration has this menu added +# See the layout template method that loads the menus +def generate_stepdefinition_list + generate_full_list YARD::Registry.all(:stepdefinition), :stepdefinition +end + +# Generate a step list +# @note this menu is not automatically added until yard configuration has this menu added +# See the layout template method that loads the menus +def generate_step_list + generate_full_list YARD::Registry.all(:step), :step +end + +# Helpler method to generate a full_list page of the specified objects with the +# specified type. def generate_full_list(objects,list_type,friendly_name=nil) - @items = objects - @list_type = "#{list_type}s" - @list_title = "#{friendly_name || list_type.to_s.capitalize} List" - @list_class = "class" - asset("#{list_type}_list.html",erb(:full_list)) + @items = objects + @list_type = "#{list_type}s" + @list_title = "#{friendly_name || list_type.to_s.capitalize} List" + @list_class = "class" + asset("#{list_type}_list.html",erb(:full_list)) end # # The existing 'Class List' search field would normally contain the Cucumber # Namespace object that has been added. Here we call the class_list method \ No newline at end of file