Sha256: 87bc2dc89180155c3f8258719b42980fc9fc171ab99c34f359eb9be9624f751b
Contents?: true
Size: 497 Bytes
Versions: 16
Compression:
Stored size: 497 Bytes
Contents
module Qbrick 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
16 entries across 16 versions & 1 rubygems