Module: Qa::Authorities::LocalSubauthority

Included in:
Local
Defined in:
lib/qa/authorities/local_subauthority.rb

Instance Method Summary collapse

Instance Method Details

#namesObject

Local sub-authorities are any YAML files in the sub_authorities_path



14
15
16
# File 'lib/qa/authorities/local_subauthority.rb', line 14

def names
  Dir.entries(sub_authorities_path).map { |f| File.basename(f, ".yml") if f.match(/yml$/) }.compact
end

#sub_authorities_pathObject

Path to sub-authority files is either the full path to a directory or the path to a directory relative to the Rails application



5
6
7
8
9
10
11
# File 'lib/qa/authorities/local_subauthority.rb', line 5

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