Sha256: 5b2beac1c9809088d3e6c73f75b76c2cb01a9521758845ee06afda99c3351241

Contents?: true

Size: 758 Bytes

Versions: 5

Compression:

Stored size: 758 Bytes

Contents

module YARD
  module Server
    # The YARD::Server::Router needs the following modification,
    # so that it will provide routing for the features and tags commands
    # to their appropriate definitions
    Router.class_eval do
      alias_method :core_route_list, :route_list

      # Provide the full list of features and tags
      def route_list(library, paths)
        if paths && !paths.empty? && paths.first =~ /^(?:features|tags)$/
          case paths.shift
          when "features"; cmd = Commands::ListFeaturesCommand
          when "tags"; cmd = Commands::ListTagsCommand
          end
          cmd.new(final_options(library, paths)).call(request)
        else
          core_route_list(library,paths)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yard-lucid-0.5.0 lib/yard/server/router.rb
yard-lucid-0.4.0 lib/yard/server/router.rb
yard-lucid-0.3.0 lib/yard/server/router.rb
yard-lucid-0.2.0 lib/yard/server/router.rb
yard-lucid-0.1.0 lib/yard/server/router.rb