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

Version Path
qbrick-2.7.1 lib/qbrick/partial_extractor.rb
qbrick-2.7 lib/qbrick/partial_extractor.rb
qbrick-2.6.10 lib/qbrick/partial_extractor.rb
qbrick-2.6.9 lib/qbrick/partial_extractor.rb
qbrick-2.6.8 lib/qbrick/partial_extractor.rb
qbrick-2.6.7 lib/qbrick/partial_extractor.rb
qbrick-2.6.6 lib/qbrick/partial_extractor.rb
qbrick-2.6.5 lib/qbrick/partial_extractor.rb
qbrick-2.6.4 lib/qbrick/partial_extractor.rb
qbrick-2.6.3 lib/qbrick/partial_extractor.rb
qbrick-2.6.2 lib/qbrick/partial_extractor.rb
qbrick-2.6.1 lib/qbrick/partial_extractor.rb
qbrick-2.6.0 lib/qbrick/partial_extractor.rb
qbrick-2.5.2 lib/qbrick/partial_extractor.rb
qbrick-2.5.1 lib/qbrick/partial_extractor.rb
qbrick-2.5.0 lib/qbrick/partial_extractor.rb