class Crawling::Store
Attributes
store_dir[R]
Public Class Methods
new(store_dir, sys_dir)
click to toggle source
# File lib/crawling.rb, line 37 def initialize store_dir, sys_dir @store_dir = File.absolute_path store_dir @store_pathname = Pathname.new(store_dir).expand_path @sys_dir = File.absolute_path sys_dir @sys_pathname = Pathname.new(sys_dir).expand_path end
Public Instance Methods
get_store_path(path)
click to toggle source
if path is within system then return store path otherwise return nil
# File lib/crawling.rb, line 52 def get_store_path path if path.start_with? @sys_dir File.join @store_dir, Crawling.relative_path_to(path, @sys_pathname) end end
get_sys_path(path)
click to toggle source
if path is within store then return system path otherwise return nil
# File lib/crawling.rb, line 45 def get_sys_path path if path.start_with? @store_dir File.join @sys_dir, Crawling.relative_path_to(path, @store_pathname) end end