class MDView::Sinatra
Public Instance Methods
link_to(f)
click to toggle source
# File lib/mdview/sinatra.rb, line 23 def link_to(f) File.directory?(f) ? "/dir=#{f}" : "/file=#{f}" end
subpath_of_pwd?(f)
click to toggle source
# 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