lib/hx/output/liquidtemplate.rb in hx-0.7.4 vs lib/hx/output/liquidtemplate.rb in hx-0.8.2
- old
+ new
@@ -19,11 +19,10 @@
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-require 'rubygems'
require 'time'
require 'liquid'
require 'redcloth'
require 'cgi'
require 'hx'
@@ -70,24 +69,21 @@
template_dir = Hx.get_pathname(options, :template_dir)
# global, so all LiquidTemplate instances kind of have to agree on the
# same template directory for things to work right
Liquid::Template.file_system = Liquid::LocalFileSystem.new(template_dir)
Liquid::Template.register_filter(TextFilters)
- template_file = template_dir + options[:template]
+ template_file = template_dir + "#{options[:template]}.liquid"
@template = Liquid::Template.parse(template_file.read)
@extension = options[:extension]
@mime_type = options[:mime_type]
@strip_extension_re = nil
@strip_extension_re = /\.#{Regexp.quote(@extension)}$/ if @extension
end
- def each_entry_path
- @input.each_entry_path do |path|
- unless @extension.nil?
- yield "#{path}.#{@extension}"
- else
- yield path
- end
+ def each_entry_path(selector)
+ @input.each_entry_path(Path::ALL) do |path|
+ path = "#{path}.#{@extension}" unless @extension.nil?
+ yield path if selector.accept? path
end
self
end
def get_entry(path)