Class: MDView::Sinatra
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- MDView::Sinatra
- Defined in:
- lib/mdview/sinatra.rb
Instance Method Summary collapse
Instance Method Details
#link_to(f) ⇒ Object
23 24 25 |
# File 'lib/mdview/sinatra.rb', line 23 def link_to(f) File.directory?(f) ? "/dir=#{f}" : "/file=#{f}" end |
#subpath_of_pwd?(f) ⇒ Boolean
27 28 29 30 31 |
# File 'lib/mdview/sinatra.rb', line 27 def subpath_of_pwd?(f) c = Pathname.pwd.realpath.to_s x = Pathname.new(f).realpath.to_s "#{x}/".start_with? "#{c}/" end |