Sha256: 125df0a7c24fea48480ce254edc2f89e100af7a364f443368e237eab42b3eda3

Contents?: true

Size: 596 Bytes

Versions: 3

Compression:

Stored size: 596 Bytes

Contents

module Qa::Authorities::LocalSubauthority

  # Path to sub-authority files is either the full path to a directory or
  # the path to a directory relative to the Rails application
  def sub_authorities_path
    if AUTHORITIES_CONFIG[:local_path].starts_with?(File::Separator)
      AUTHORITIES_CONFIG[:local_path]
    else
      File.join(Rails.root, AUTHORITIES_CONFIG[:local_path])
    end
  end

  # Local sub-authorities are any YAML files in the sub_authorities_path
  def names
    Dir.entries(sub_authorities_path).map { |f| File.basename(f, ".yml") if f.match(/yml$/) }.compact
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
qa-0.4.2 lib/qa/authorities/local_subauthority.rb
qa-0.4.1 lib/qa/authorities/local_subauthority.rb
qa-0.4.0 lib/qa/authorities/local_subauthority.rb