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

Version Path
kuhsaft-1.7.0 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.6.0 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.5.0 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.4.3 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.4.2 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.4.1 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.4.0 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.3.1 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.15 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.14 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.13 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.12 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.11 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.10 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.9 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.8 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.7 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.6 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.5 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.2.4 lib/kuhsaft/partial_extractor.rb