Sha256: 30c1b3bb8fd8ef330c8cd1a35d0d7e4ed23fb7e671536d05c677224b645ff340
Contents?: true
Size: 500 Bytes
Versions: 50
Compression:
Stored size: 500 Bytes
Contents
module Kuhsaft class PartialExtractor def extract_filenames(partial_paths) partials = [] partial_paths.each do |partial| filename = File.basename(partial).split('.', 0).first filename.slice!(0) partials << filename end partials.collect {|d| [I18n.t(d), d]} end def collect_partials(path) extract_filenames(Dir.glob("#{Rails.root}#{path}")) end def partials(path) @partials = collect_partials(path) end end end
Version data entries
50 entries across 50 versions & 1 rubygems