Module: Qa::Authorities::LocalSubauthority
- Included in:
- Local
- Defined in:
- lib/qa/authorities/local_subauthority.rb
Instance Method Summary collapse
-
#names ⇒ Object
Local sub-authorities are any YAML files in the subauthorities_path.
-
#subauthorities_path ⇒ Object
Path to sub-authority files is either the full path to a directory or the path to a directory relative to the Rails application.
Instance Method Details
#names ⇒ Object
Local sub-authorities are any YAML files in the subauthorities_path
14 15 16 17 18 19 |
# File 'lib/qa/authorities/local_subauthority.rb', line 14 def names unless Dir.exists? raise Qa::ConfigDirectoryNotFound, "There's no directory at #{}. You must create it in order to use local authorities" end Dir.entries().map { |f| File.basename(f, ".yml") if f.match(/yml$/) }.compact end |
#subauthorities_path ⇒ Object
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 if AUTHORITIES_CONFIG[:local_path].starts_with?(File::Separator) AUTHORITIES_CONFIG[:local_path] else File.join(Rails.root, AUTHORITIES_CONFIG[:local_path]) end end |