app/models/scrapbook/scrapbook.rb in scrapbook-0.2.2 vs app/models/scrapbook/scrapbook.rb in scrapbook-0.3.0

- old
+ new

@@ -41,9 +41,18 @@ end relative_path end + def relative_page_pathname_for(pathname) + relative_path = pathname.relative_path_from(pages_pathname) + if relative_path.to_s.start_with?('..') + raise ArgumentError, "Pathname isn't inside the scrapbook pages: #{relative_path}" + end + + relative_path + end + def ==(other) other.class == self.class && other.root == root end alias eql? == end