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-2.2.6 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.2.5 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.2.4 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.2.3 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.2.2 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.2.1 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.2.0 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.1.2 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.1.1 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.1.0 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.8.6 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.8.5 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.0.3 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.0.2 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.8.4 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.8.1 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.0.1 lib/kuhsaft/partial_extractor.rb
kuhsaft-2.0.0 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.8.0 lib/kuhsaft/partial_extractor.rb
kuhsaft-1.7.1 lib/kuhsaft/partial_extractor.rb