Sha256: 5315e0d0cb82446e2ef63880b3103954257c283bff0c4818d921fe277651e8d8

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

module YARD
  module Server
    module Commands
      # Displays an object wrapped in frames
      class FramesCommand < DisplayObjectCommand
        include DocServerHelper
        
        def run
          main_url = request.path.gsub(/^(.+)?\/frames(?:\/(#{path}))?$/, '\1/\2')
          if path =~ %r{^file/}
            page_title = "File: #{$'}"
          elsif !path.empty?
            page_title = "Object: #{object_path}"
          elsif options[:files] && options[:files].size > 0
            page_title = "File: #{options[:files].first.sub(/^#{library.source_path}\/?/, '')}"
            main_url = url_for_file(options[:files].first)
          elsif !path || path.empty?
            page_title = "Documentation for #{library.name} #{library.version ? '(' + library.version + ')' : ''}"
          end

          options.update(
            :page_title => page_title,
            :main_url => main_url,
            :template => :doc_server,
            :type => :frames
          )
          render
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yard-0.6.8 lib/yard/server/commands/frames_command.rb
yard-0.6.7 lib/yard/server/commands/frames_command.rb
yard-0.6.6 lib/yard/server/commands/frames_command.rb
yard-0.6.5 lib/yard/server/commands/frames_command.rb
yard-0.6.4 lib/yard/server/commands/frames_command.rb