Class: QaServer::ConfigGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/qa_server/config_generator.rb

Instance Method Summary collapse

Instance Method Details

#append_prependsObject



38
39
40
41
42
43
44
45
46
# File 'lib/generators/qa_server/config_generator.rb', line 38

def append_prepends
  inject_into_file 'config/application.rb', after: /Rails::Application/ do
    "\n      config.to_prepare do"\
    "\n        Qa::Authorities::LinkedData::FindTerm.prepend PrependedLinkedData::FindTerm"\
    "\n        Qa::Authorities::LinkedData::SearchQuery.prepend PrependedLinkedData::SearchQuery"\
    "\n        RDF::Graph.prepend PrependedRdf::RdfGraph"\
    "\n      end\n"
  end
end

#authority_configsObject



19
20
21
22
# File 'lib/generators/qa_server/config_generator.rb', line 19

def authority_configs
  say_status('info', '  -- adding authority configurations', :blue)
  directory "config/authorities/linked_data", recursive: false
end

#authority_scenariosObject



24
25
26
27
# File 'lib/generators/qa_server/config_generator.rb', line 24

def authority_scenarios
  say_status('info', '  -- adding authority validations', :blue)
  directory "config/authorities/linked_data/scenarios", recursive: false
end


15
16
17
# File 'lib/generators/qa_server/config_generator.rb', line 15

def banner
  say_status('info', 'INSTALLING QA_SERVER CONFIGURATIONS', :blue)
end

#create_initializer_config_fileObject



34
35
36
# File 'lib/generators/qa_server/config_generator.rb', line 34

def create_initializer_config_file
  copy_file 'config/initializers/qa_server.rb'
end

#inject_i18nObject



29
30
31
32
# File 'lib/generators/qa_server/config_generator.rb', line 29

def inject_i18n
  say_status('info', '  -- adding i18n translations', :blue)
  copy_file 'config/locales/qa_server.en.yml'
end