diff --git a/README.md b/README.md index c627575..ab96954 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DogBiscuits -[![Build Status](https://travis-ci.org/samvera-labs/dog_biscuits.svg?branch=cleanup)](https://travis-ci.org/samvera-labs/dog_biscuits) +Code: [![Build Status](https://travis-ci.org/samvera-labs/dog_biscuits.svg?branch=cleanup)](https://travis-ci.org/samvera-labs/dog_biscuits) [![Coverage Status](https://coveralls.io/repos/github/samvera-labs/dog_biscuits/badge.svg?branch=master)](https://coveralls.io/github/samvera-labs/dog_biscuits?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/10912dcb2451a6c4490c/maintainability)](https://codeclimate.com/github/samvera-labs/dog_biscuits/maintainability) [![Inline docs](http://inch-ci.org/github/samvera-labs/dog_biscuits.svg?branch=master)](http://inch-ci.org/github/samvera-labs/dog_biscuits) diff --git a/lib/generators/dog_biscuits/authority_generator.rb b/lib/generators/dog_biscuits/authority_generator.rb index fc4dccc..6c03b13 100644 --- a/lib/generators/dog_biscuits/authority_generator.rb +++ b/lib/generators/dog_biscuits/authority_generator.rb @@ -48,7 +48,7 @@ def inject_into_dog_biscuits def inject_into_authority_service file_path = 'app/services/authority_service.rb' - copy_file 'authority_service.rb', file_path + copy_file 'app/services/authority_service.rb', file_path ::DogBiscuits::Terms.constants.each do |term| t = term.to_s @@ -67,11 +67,7 @@ def inject_into_authority_service end end - def copy_local_authority_concern - copy_file 'local_authority_concern.rb', 'app/services/concerns/local_authority_concern.rb' - end - - def copy_file_authority_concern - copy_file 'file_authority_concern.rb', 'app/services/concerns/file_authority_concern.rb' + def copy_concerns + directory 'app/services/concerns', 'app/services/concerns' end end diff --git a/lib/generators/dog_biscuits/install_generator.rb b/lib/generators/dog_biscuits/install_generator.rb index 6b9964e..16d0661 100755 --- a/lib/generators/dog_biscuits/install_generator.rb +++ b/lib/generators/dog_biscuits/install_generator.rb @@ -26,6 +26,10 @@ def create_dog_biscuits copy_file 'config/initializers/dog_biscuits.rb', init_path unless File.exist?(init_path) end + def create_app + directory 'app', 'app' + end + def update_initializer gsub_file 'config/initializers/dog_biscuits.rb', /# Available models are:/, "# Available models are: #{DogBiscuits.config.available_models.join(', ')}" end @@ -43,10 +47,6 @@ def create_authorities generate 'dog_biscuits:authority' end - def create_local_form_metadata_service - copy_file 'app/services/local_form_metadata_service.rb', 'app/services/local_form_metadata_service.rb' - end - def create_helpers db_injection = ' include ::DogBiscuitsHelper' unless File.read('app/helpers/hyrax_helper.rb').include? db_injection @@ -54,25 +54,12 @@ def create_helpers "#{db_injection}\n" end end - directory 'app/helpers/', 'app/helpers/' - end - - def create_renderers - directory 'app/renderers/', 'app/renderers/' end def create_schema_org generate 'dog_biscuits:schema_org' end - def create_edit_fields_and_inputs - directory 'app/views/records', 'app/views/records' - end - - def add_custom_form - copy_file 'app/views/hyrax/base/_form_metadata.html.erb', 'app/views/hyrax/base/_form_metadata.html.erb' - end - # TODO: remove when fixed def create_views copy_file 'app/views/hyrax/base/_work_description.erb', 'app/views/hyrax/base/_work_description.erb' diff --git a/lib/generators/dog_biscuits/templates/catalog_controller.rb b/lib/generators/dog_biscuits/templates/app/controllers/catalog_controller.rb similarity index 100% rename from lib/generators/dog_biscuits/templates/catalog_controller.rb rename to lib/generators/dog_biscuits/templates/app/controllers/catalog_controller.rb diff --git a/lib/generators/dog_biscuits/templates/authority_service.rb b/lib/generators/dog_biscuits/templates/app/services/authority_service.rb similarity index 100% rename from lib/generators/dog_biscuits/templates/authority_service.rb rename to lib/generators/dog_biscuits/templates/app/services/authority_service.rb diff --git a/lib/generators/dog_biscuits/templates/file_authority_concern.rb b/lib/generators/dog_biscuits/templates/app/services/concerns/file_authority_concern.rb similarity index 100% rename from lib/generators/dog_biscuits/templates/file_authority_concern.rb rename to lib/generators/dog_biscuits/templates/app/services/concerns/file_authority_concern.rb diff --git a/lib/generators/dog_biscuits/templates/local_authority_concern.rb b/lib/generators/dog_biscuits/templates/app/services/concerns/local_authority_concern.rb similarity index 100% rename from lib/generators/dog_biscuits/templates/local_authority_concern.rb rename to lib/generators/dog_biscuits/templates/app/services/concerns/local_authority_concern.rb