Sha256: 52900ec921dc2d87e38f36e3fe5c9b28d89fa772df34724fb8df3b3b78fd308c
Contents?: true
Size: 498 Bytes
Versions: 19
Compression:
Stored size: 498 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.map { |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
19 entries across 19 versions & 2 rubygems