Sha256: 62720f3c66dcb5752876b763531d9aa26a19c0d113301434058802d0c032911d

Contents?: true

Size: 1.28 KB

Versions: 30

Compression:

Stored size: 1.28 KB

Contents

module YARD
  module Server
    module Commands
      # Returns a list of objects of a specific type
      class ListCommand < LibraryCommand
        include Templates::Helpers::BaseHelper

        def items; raise NotImplementedError end
        def type; raise NotImplementedError end

        def run
          options.update(:items => items, :template => :doc_server,
                         :list_type => request.path.split('/').last, :type => :full_list)
          render
        end
      end

      # Returns the list of classes / modules in a library
      class ListClassesCommand < ListCommand
        def type; :class end

        def items
          Registry.load_all
          run_verifier(Registry.all(:class, :module))
        end
      end

      # Returns the list of methods in a library
      class ListMethodsCommand < ListCommand
        include Templates::Helpers::ModuleHelper

        def type; :methods end

        def items
          Registry.load_all
          items = Registry.all(:method).sort_by {|m| m.name.to_s }
          prune_method_listing(items)
        end
      end

      # Returns the list of README/extra files in a library
      class ListFilesCommand < ListCommand
        def type; :files end
        def items; options[:files] end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 4 rubygems

Version Path
challah-0.6.2 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.6.1 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.6.0 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.5.4 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.5.3 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.5.2 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.5.1 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.5.0 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.4.1 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.4.0 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.3.5 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.3.4 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.3.3 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.3.2 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.3.1 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.3.0 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.2.1 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
challah-0.2.0 vendor/bundle/gems/yard-0.7.5/lib/yard/server/commands/list_command.rb
yard-0.7.5 lib/yard/server/commands/list_command.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/yard-0.7.4/lib/yard/server/commands/list_command.rb