Class: ScmRouter
- Inherits:
-
YARD::Server::Router
- Object
- YARD::Server::Router
- ScmRouter
- Defined in:
- lib/scm_router.rb
Instance Method Summary collapse
- #docs_prefix ⇒ Object
- #list_prefix ⇒ Object
- #parse_library_from_path(paths) ⇒ Object
- #search_prefix ⇒ Object
- #static_prefix ⇒ Object
Instance Method Details
#docs_prefix ⇒ Object
2 |
# File 'lib/scm_router.rb', line 2 def docs_prefix; 'github' end |
#list_prefix ⇒ Object
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_prefix ⇒ Object
4 |
# File 'lib/scm_router.rb', line 4 def search_prefix; 'search/github' end |
#static_prefix ⇒ Object
5 |
# File 'lib/scm_router.rb', line 5 def static_prefix; 'static/github' end |