lib/yard/templates/helpers/markup_helper.rb in yard-0.7.5 vs lib/yard/templates/helpers/markup_helper.rb in yard-0.8.0

- old
+ new

@@ -71,23 +71,23 @@ # # On failure this method will inform the user that no provider could be # found and exit the program. # # @return [Boolean] whether the markup provider was successfully loaded. - def load_markup_provider(type = options[:markup]) + def load_markup_provider(type = options.markup) return true if MarkupHelper.markup_cache[type] MarkupHelper.markup_cache[type] ||= {} providers = MARKUP_PROVIDERS[type.to_sym] return true if providers && providers.empty? - if providers && options[:markup_provider] - providers = providers.select {|p| p[:lib] == options[:markup_provider] } + if providers && options.markup_provider + providers = providers.select {|p| p[:lib] == options.markup_provider } end if providers == nil || providers.empty? log.error "Invalid markup type '#{type}' or markup provider " + - "(#{options[:markup_provider]}) is not registered." + "(#{options.markup_provider}) is not registered." return false end # Search for provider, return the library class name as const if found providers.each do |provider| @@ -126,11 +126,11 @@ ext = (File.extname(filename)[1..-1] || '').downcase MARKUP_EXTENSIONS.each do |type, exts| return type if exts.include?(ext) end - options[:markup] + options.markup end # Strips any shebang lines on the file contents that pertain to # markup or preprocessing data. # @@ -142,22 +142,22 @@ end # Gets the markup provider class/module constant for a markup type # Call {#load_markup_provider} before using this method. # - # @param [Symbol] the markup type (:rdoc, :markdown, etc.) + # @param [Symbol] type the markup type (:rdoc, :markdown, etc.) # @return [Class] the markup class - def markup_class(type = options[:markup]) + def markup_class(type = options.markup) load_markup_provider(type) MarkupHelper.markup_cache[type][:class] end # Gets the markup provider name for a markup type # Call {#load_markup_provider} before using this method. # - # @param [Symbol] the markup type (:rdoc, :markdown, etc.) + # @param [Symbol] type the markup type (:rdoc, :markdown, etc.) # @return [Symbol] the markup provider name (usually the gem name of the library) - def markup_provider(type = options[:markup]) + def markup_provider(type = options.markup) MarkupHelper.markup_cache[type][:provider] end end end end