lib/lookbook/page.rb in lookbook-1.0.1 vs lib/lookbook/page.rb in lookbook-1.0.2
- old
+ new
@@ -11,30 +11,30 @@
:header,
:footer,
:data
]
- attr_reader :errors
+ attr_reader :errors, :rel_path
attr_accessor :sections
def initialize(path, base_path)
@pathname = Pathname.new path
@base_path = Pathname.new base_path
@options = nil
@errors = []
@sections = []
@page_name = remove_position_prefix(path_name)
- rel_path = @pathname.relative_path_from(@base_path)
- page_path = rel_path.dirname.to_s == "." ? @page_name : "#{rel_path.dirname}/#{@page_name}"
+ @rel_path = @pathname.relative_path_from(@base_path)
+ page_path = @rel_path.dirname.to_s == "." ? @page_name : "#{@rel_path.dirname}/#{@page_name}"
super(page_path)
end
def url_path
lookbook_page_path lookup_path
end
def full_path
- Rails.root.join(@pathname.to_s)
+ Pathname.new Rails.root.join(@pathname.to_s)
end
def name
@page_name
end