Class: ScmRouter

Inherits:
YARD::Server::Router
  • Object
show all
Defined in:
lib/scm_router.rb

Instance Method Summary collapse

Instance Method Details

#docs_prefixObject



2
# File 'lib/scm_router.rb', line 2

def docs_prefix; 'github' end

#list_prefixObject



3
# File 'lib/scm_router.rb', line 3

def list_prefix; 'list/github' end

#parse_library_from_path(paths) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/scm_router.rb', line 7

def parse_library_from_path(paths)
  library, paths = nil, paths.dup
  github_proj = paths[0, 2].join('/')
  if libs = adapter.libraries[github_proj]
    paths.shift; paths.shift
    if library = libs.find {|l| l.version == paths.first }
      request.version_supplied = true if request
      paths.shift
    else # use the last lib in the list
      request.version_supplied = false if request
      library = libs.last
    end
  end
  [library, paths]
end

#search_prefixObject



4
# File 'lib/scm_router.rb', line 4

def search_prefix; 'search/github' end

#static_prefixObject



5
# File 'lib/scm_router.rb', line 5

def static_prefix; 'static/github' end