Class: QaServer::ConfigGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- QaServer::ConfigGenerator
- Defined in:
- lib/generators/qa_server/config_generator.rb
Instance Method Summary collapse
- #append_prepends ⇒ Object
- #authority_configs ⇒ Object
- #authority_scenarios ⇒ Object
- #banner ⇒ Object
- #create_initializer_config_file ⇒ Object
- #inject_i18n ⇒ Object
Instance Method Details
#append_prepends ⇒ Object
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_configs ⇒ Object
19 20 21 22 |
# File 'lib/generators/qa_server/config_generator.rb', line 19 def say_status('info', ' -- adding authority configurations', :blue) directory "config/authorities/linked_data", recursive: false end |
#authority_scenarios ⇒ Object
24 25 26 27 |
# File 'lib/generators/qa_server/config_generator.rb', line 24 def say_status('info', ' -- adding authority validations', :blue) directory "config/authorities/linked_data/scenarios", recursive: false end |
#banner ⇒ Object
15 16 17 |
# File 'lib/generators/qa_server/config_generator.rb', line 15 def say_status('info', 'INSTALLING QA_SERVER CONFIGURATIONS', :blue) end |
#create_initializer_config_file ⇒ Object
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_i18n ⇒ Object
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 |