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

Version Path
kuhsaft-2.6.3 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.6.2 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.6.1 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.5.2 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.6.0 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.5.1 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.5.0 lib/kuhsaft/partial_extractor.rb
qbrick-2.5.0.pre lib/kuhsaft/partial_extractor.rb
kuhsaft-2.4.3 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.4.2 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.4.1 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.4.0 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.3.6 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.3.5 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.3.4 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.3.3 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.3.2 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.3.1 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.3.0 lib/kuhsaft/partial_extractor.rb