hydra-head 3.0.0pre3 → 3.0.0pre4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +0 -3
- data/.rvmrc +6 -0
- data/BLACKLIGHT_CONFIG.textile +76 -0
- data/CREATE_RAILS_APP.textile +323 -0
- data/DEVELOP_PLUGIN.textile +90 -0
- data/GIT_WORKFLOW.textile +84 -0
- data/Gemfile.lock +82 -66
- data/HISTORY.textile +7 -0
- data/HOW_DO_I.textile +107 -0
- data/HOW_TO_DEFINE_A_HYDRA_CONTROLLER.textile +21 -0
- data/HOW_TO_DEFINE_A_HYDRA_MODEL.textile +64 -0
- data/HOW_TO_GET_STARTED.textile +100 -76
- data/INITIAL_APP_MODS.textile +60 -76
- data/INSTALL_PREREQ.textile +19 -0
- data/LICENSE +14 -0
- data/README.textile +89 -17
- data/README_RAKE_TASKS.textile +107 -0
- data/README_SUBTREE.textile +87 -0
- data/README_TERSE.textile +92 -0
- data/TESTING_PLUGIN.textile +134 -0
- data/app/controllers/assets_controller.rb +34 -4
- data/app/controllers/contributors_controller.rb +49 -1
- data/app/controllers/downloads_controller.rb +36 -0
- data/app/controllers/file_assets_controller.rb +43 -21
- data/app/controllers/generic_content_objects_controller.rb +38 -0
- data/app/controllers/get_controller.rb +39 -0
- data/app/controllers/permissions_controller.rb +33 -4
- data/app/controllers/user_sessions_controller.rb +0 -1
- data/app/helpers/application_helper.rb +183 -0
- data/app/helpers/blacklight_helper.rb +13 -8
- data/app/helpers/hydra_assets_helper.rb +6 -15
- data/app/helpers/hydra_fedora_metadata_helper.rb +51 -67
- data/app/helpers/hydra_helper.rb +35 -11
- data/app/helpers/javascript_includes_helper.rb +2 -4
- data/app/helpers/personalization_helper.rb +44 -0
- data/app/models/generic_content.rb +6 -3
- data/app/models/generic_image.rb +3 -1
- data/app/models/mods_asset.rb +12 -1
- data/app/models/user_attribute.rb +25 -0
- data/app/models/uses_default_partials.rb +14 -0
- data/app/views/_add_assets_links.html.erb +1 -0
- data/app/views/catalog/_edit_partials/_default.html.erb +5 -5
- data/app/views/catalog/_home_text.html.erb +2 -2
- data/app/views/catalog/_index_partials/_default_details.html.erb +10 -7
- data/app/views/catalog/_opensearch_response_metadata.html.erb +2 -0
- data/app/views/catalog/_search_form.html.erb +1 -1
- data/app/views/catalog/_show_partials/_default.html.erb +4 -2
- data/app/views/catalog/_show_partials/_default_details.html.erb +10 -7
- data/app/views/catalog/show.html.erb +20 -28
- data/app/views/contributors/_edit_person.html.erb +26 -29
- data/app/views/contributors/_index.html.erb +6 -7
- data/app/views/contributors/_show_conference.html.erb +5 -15
- data/app/views/contributors/_show_organization.html.erb +8 -16
- data/app/views/file_assets/_file_assets_form.html.erb +11 -0
- data/app/views/file_assets/_index.html.erb +21 -6
- data/app/views/file_assets/_new.html.erb +6 -2
- data/app/views/file_assets/_result.html.erb +2 -2
- data/app/views/fluid_infusion/_uploader.html.erb +4 -5
- data/app/views/generic_content_objects/_contributor_form.html.erb +11 -0
- data/app/views/generic_content_objects/_description_form.html.erb +7 -0
- data/app/views/generic_content_objects/_edit_description.html.erb +14 -41
- data/app/views/generic_content_objects/_show_description.html.erb +38 -63
- data/app/views/generic_contents/_edit.html.erb +1 -45
- data/app/views/generic_contents/_edit.html.erb_ +39 -0
- data/app/views/generic_contents/_index.html.erb +1 -3
- data/app/views/generic_contents/_show.html.erb +4 -14
- data/app/views/generic_contents/_show_content.html.erb +7 -4
- data/app/views/generic_images/_edit.html.erb +26 -32
- data/app/views/generic_images/_show.html.erb +7 -10
- data/app/views/generic_images/_show_all.html.erb +1 -1
- data/app/views/generic_images/_show_content.html.erb +7 -7
- data/app/views/layouts/application.html.erb +33 -41
- data/app/views/layouts/hydra-head.html.erb +52 -7
- data/app/views/mods_assets/_additional_info_form.html.erb +44 -0
- data/app/views/mods_assets/_contributor_form.html.erb +14 -0
- data/app/views/mods_assets/_edit.html.erb +8 -32
- data/app/views/mods_assets/_edit.html.erb_ +63 -0
- data/app/views/mods_assets/_edit_description.html.erb +52 -61
- data/app/views/mods_assets/_edit_journal.html.erb +49 -64
- data/app/views/mods_assets/_publication_form.html.erb +13 -0
- data/app/views/mods_assets/_show.html.erb +18 -23
- data/app/views/mods_assets/_show_additional_info.html.erb +17 -0
- data/app/views/mods_assets/_show_contributors.html.erb +7 -0
- data/app/views/mods_assets/_show_description.html.erb +3 -13
- data/app/views/mods_assets/_show_file_assets.html.erb +22 -0
- data/app/views/mods_assets/_show_journal.html.erb +3 -3
- data/app/views/mods_assets/_show_permissions.html.erb +1 -0
- data/app/views/mods_assets/_show_publication.html.erb +8 -0
- data/app/views/permissions/_edit_person_permissions.html.erb +4 -9
- data/app/views/permissions/_index.html.erb +9 -18
- data/app/views/permissions/_new.html.erb +13 -17
- data/app/views/permissions/_permissions_form.html.erb +24 -0
- data/app/views/user_sessions/_login_form.html.erb +1 -1
- data/assets/images/hydra/powered_by_hydra.png +0 -0
- data/assets/images/hydra/search-button.png +0 -0
- data/assets/javascripts/date-picker/booking/index.html +368 -0
- data/assets/javascripts/date-picker/calendarHTML.txt +84 -0
- data/assets/javascripts/date-picker/css/datepicker.css +511 -0
- data/assets/javascripts/date-picker/css/demo.css +229 -0
- data/assets/javascripts/date-picker/index.html +798 -0
- data/assets/javascripts/date-picker/js/datepicker.js +2898 -0
- data/assets/javascripts/date-picker/js/datepicker.packed.js +1 -0
- data/assets/javascripts/date-picker/js/lang/ar.js +9 -0
- data/assets/javascripts/date-picker/js/lang/cs.js +9 -0
- data/assets/javascripts/date-picker/js/lang/da.js +10 -0
- data/assets/javascripts/date-picker/js/lang/de.js +10 -0
- data/assets/javascripts/date-picker/js/lang/en.js +9 -0
- data/assets/javascripts/date-picker/js/lang/eo.js +13 -0
- data/assets/javascripts/date-picker/js/lang/es.js +9 -0
- data/assets/javascripts/date-picker/js/lang/et.js +23 -0
- data/assets/javascripts/date-picker/js/lang/fi.js +7 -0
- data/assets/javascripts/date-picker/js/lang/fr.js +69 -0
- data/assets/javascripts/date-picker/js/lang/he.js +9 -0
- data/assets/javascripts/date-picker/js/lang/hu.js +9 -0
- data/assets/javascripts/date-picker/js/lang/id.js +9 -0
- data/assets/javascripts/date-picker/js/lang/it.js +11 -0
- data/assets/javascripts/date-picker/js/lang/kr.js +9 -0
- data/assets/javascripts/date-picker/js/lang/lt.js +8 -0
- data/assets/javascripts/date-picker/js/lang/lv.js +9 -0
- data/assets/javascripts/date-picker/js/lang/nl.js +9 -0
- data/assets/javascripts/date-picker/js/lang/no.js +9 -0
- data/assets/javascripts/date-picker/js/lang/pl.js +10 -0
- data/assets/javascripts/date-picker/js/lang/pt-br.js +11 -0
- data/assets/javascripts/date-picker/js/lang/pt.js +9 -0
- data/assets/javascripts/date-picker/js/lang/ru.js +11 -0
- data/assets/javascripts/date-picker/js/lang/se.js +9 -0
- data/assets/javascripts/date-picker/js/lang/si.js +9 -0
- data/assets/javascripts/date-picker/js/lang/tr.js +9 -0
- data/assets/javascripts/date-picker/language/index.html +240 -0
- data/assets/javascripts/date-picker/media/Thumbs.db +0 -0
- data/assets/javascripts/date-picker/media/backstripes.gif +0 -0
- data/assets/javascripts/date-picker/media/bg_header.jpg +0 -0
- data/assets/javascripts/date-picker/media/bullet1.gif +0 -0
- data/assets/javascripts/date-picker/media/bullet2.gif +0 -0
- data/assets/javascripts/date-picker/media/cal-grey.gif +0 -0
- data/assets/javascripts/date-picker/media/cal.gif +0 -0
- data/assets/javascripts/date-picker/media/gradient-e5e5e5-ffffff.gif +0 -0
- data/assets/javascripts/hydra/hydra-head.js +195 -0
- data/assets/javascripts/hydra/mediashelf.datepicker.js +39 -0
- data/assets/javascripts/hydra/mediashelf.placeholder.js +67 -0
- data/assets/javascripts/jquery.form.js +675 -0
- data/assets/javascripts/jquery.ui.datepicker.js +1793 -0
- data/assets/javascripts/spin.min.js +2 -0
- data/assets/stylesheets/hydra/html_refactor.css +115 -0
- data/assets/stylesheets/hydra/hydrangea-split-button.css +18 -0
- data/assets/stylesheets/hydra/hydrangea.css +292 -0
- data/assets/stylesheets/hydra/ie-styles.css +240 -0
- data/assets/stylesheets/hydra/styles.css +2224 -0
- data/assets/stylesheets/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/assets/stylesheets/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_217bc0_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_2e83ff_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_469bdd_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_6da8d5_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_d8e7f3_256x240.png +0 -0
- data/assets/stylesheets/redmond/images/ui-icons_f9bd01_256x240.png +0 -0
- data/assets/stylesheets/redmond/jquery-ui-1.8.5.custom.css +572 -0
- data/config/fedora.yml +17 -0
- data/config/role_map_cucumber.yml +10 -0
- data/config/role_map_development.yml +12 -0
- data/config/role_map_production.yml +2 -0
- data/config/role_map_test.yml +14 -0
- data/config/solr.yml +10 -0
- data/config/solr_mappings.yml +22 -0
- data/db/migrate/20101105214243_add_user_attributes_table.rb +15 -0
- data/db/migrate/20101108192527_create_superusers.rb +12 -0
- data/fedora/conf/fedora.fcfg +1021 -0
- data/hydra-head.gemspec +7 -4
- data/init.rb +4 -0
- data/install.rb +1 -0
- data/lib/blacklight/catalog_helper.rb +44 -0
- data/lib/blacklight.rb +40 -0
- data/lib/block_mapper.rb +52 -0
- data/lib/djatoka.rb +59 -0
- data/lib/ead_mapper.rb +7 -0
- data/lib/field_maps.rb +507 -0
- data/lib/generators/hydra/assets_generator.rb +51 -0
- data/lib/generators/hydra/head_generator.rb +23 -4
- data/lib/generators/hydra/templates/config/initializers/blacklight_config.rb +2 -2
- data/lib/generators/hydra/templates/config/initializers/hydra_config.rb +26 -0
- data/lib/hydra/access_controls_enforcement.rb +3 -2
- data/lib/hydra/assets_controller_helper.rb +6 -0
- data/lib/hydra/catalog.rb +7 -3
- data/lib/hydra/controller.rb +27 -0
- data/lib/hydra/file_assets_helper.rb +25 -8
- data/lib/hydra/generic_user_attributes.rb +34 -0
- data/lib/hydra/model_methods.rb +4 -2
- data/lib/hydra/mods_article.rb +5 -2
- data/lib/hydra/submission_workflow.rb +137 -0
- data/lib/hydra-head/controller.rb +30 -0
- data/lib/hydra-head/engine.rb +22 -1
- data/lib/hydra-head/routes.rb +14 -3
- data/lib/hydra-head/version.rb +1 -1
- data/lib/hydra-head.rb +3 -3
- data/lib/hydra.rb +1 -1
- data/lib/jetty_cleaner.rb +27 -0
- data/lib/marc_mapper.rb +131 -0
- data/lib/marc_record_ext.rb +97 -0
- data/lib/mediashelf/active_fedora_helper.rb +7 -1
- data/lib/prev_next_links.rb +22 -0
- data/lib/railties/hydra-fixtures.rake +6 -1
- data/lib/railties/hyhead_cucumber.rake +1 -2
- data/lib/railties/hyhead_rspec.rake +7 -7
- data/lib/stanford_blacklight_extensions.rb +6 -0
- data/lib/user_attributes_loader.rb +17 -0
- data/solr/conf/schema.xml +116 -0
- data/solr/conf/solrconfig.xml +311 -0
- data/solr/solr.xml +35 -0
- data/spec/controllers/catalog_valid_html_spec.rb +128 -0
- data/spec-rails2/helpers/hydra_fedora_metadata_helper_spec.rb +219 -0
- data/spec-rails2/spec_helper.rb +88 -0
- data/tasks/hydra-head.rake +2 -4
- data/test_support/etc/Gemfile +6 -5
- data/test_support/features/absent_model_edit.feature +27 -0
- data/test_support/features/absent_model_search_result.feature +24 -0
- data/test_support/features/absent_model_show.feature +27 -0
- data/test_support/features/button_add_assets.feature +2 -2
- data/test_support/features/contributor_add.feature +21 -16
- data/test_support/features/default_partials_edit.feature +27 -0
- data/test_support/features/default_partials_search_result.feature +22 -0
- data/test_support/features/default_partials_show.feature +24 -0
- data/test_support/features/file_upload.feature +55 -22
- data/test_support/features/generic_content_create.feature +7 -0
- data/test_support/features/generic_content_edit.feature +21 -0
- data/test_support/features/generic_content_search_result.feature +22 -0
- data/test_support/features/generic_content_show.feature +20 -0
- data/test_support/features/generic_image_create.feature +7 -0
- data/test_support/features/generic_image_edit.feature +21 -0
- data/test_support/features/generic_image_search_result.feature +22 -0
- data/test_support/features/generic_image_show.feature +20 -0
- data/test_support/features/html_validity.feature +43 -0
- data/test_support/features/mods_asset_contributors_edit.feature +27 -19
- data/test_support/features/mods_asset_create.feature +13 -8
- data/test_support/features/mods_asset_edit.feature +48 -16
- data/test_support/features/mods_asset_edit_without_permission.feature +6 -1
- data/test_support/features/mods_asset_search_result.feature +15 -15
- data/test_support/features/mods_asset_show.feature +56 -5
- data/test_support/features/permissions_add.feature +5 -4
- data/test_support/features/permissions_edit.feature +9 -7
- data/test_support/features/step_definitions/html_validity_steps.rb +57 -0
- data/test_support/features/step_definitions/show_document_steps.rb +1 -1
- data/test_support/features/step_definitions/user_steps.rb +4 -4
- data/test_support/features/support/paths.rb +4 -1
- data/test_support/fixtures/hydra_test_default_partials.foxml.xml +80 -0
- data/test_support/fixtures/hydra_test_generic_content.foxml.xml +138 -0
- data/test_support/fixtures/hydra_test_generic_image.foxml.xml +395 -0
- data/test_support/fixtures/hydra_test_no_model.foxml.xml +79 -0
- data/test_support/fixtures/hydrus_admin_class1.foxml.xml +176 -0
- data/test_support/fixtures/libra-oa_7.foxml.xml +1735 -0
- data/test_support/spec/controllers/assets_controller_spec.rb +5 -4
- data/test_support/spec/controllers/catalog_controller_spec.rb +2 -2
- data/test_support/spec/controllers/file_assets_controller_spec.rb +16 -10
- data/test_support/spec/controllers/hydra_controller_spec.rb +2 -0
- data/test_support/spec/controllers/permissions_controller_spec.rb +1 -1
- data/test_support/spec/helpers/access_controls_enforcement_spec.rb +20 -219
- data/test_support/spec/helpers/blacklight_helper_spec.rb +3 -1
- data/test_support/spec/helpers/file_assets_helper_spec.rb +13 -10
- data/test_support/spec/helpers/hydra_assets_helper_spec.rb +5 -1
- data/test_support/spec/helpers/hydra_djatoka_helper_spec.rb +3 -1
- data/test_support/spec/helpers/hydra_fedora_metadata_helper_spec.rb +102 -69
- data/test_support/spec/helpers/hydra_helper_spec.rb +15 -0
- data/test_support/spec/lib/hydra_submission_workflow_spec.rb +141 -0
- data/test_support/spec/models/generic_image_spec.rb +6 -1
- data/uninstall.rb +1 -0
- data/vendor/cache/actionmailer-3.0.10.gem +0 -0
- data/vendor/cache/actionpack-3.0.10.gem +0 -0
- data/vendor/cache/activemodel-3.0.10.gem +0 -0
- data/vendor/cache/activerecord-3.0.10.gem +0 -0
- data/vendor/cache/activeresource-3.0.10.gem +0 -0
- data/vendor/cache/activesupport-3.0.10.gem +0 -0
- data/vendor/cache/capybara-1.1.1.gem +0 -0
- data/vendor/cache/childprocess-0.2.2.gem +0 -0
- data/vendor/cache/crack-0.3.1.gem +0 -0
- data/vendor/cache/cucumber-1.1.0.gem +0 -0
- data/vendor/cache/cucumber-rails-1.1.1.gem +0 -0
- data/vendor/cache/diff-lcs-1.1.3.gem +0 -0
- data/vendor/cache/equivalent-xml-0.2.8.gem +0 -0
- data/vendor/cache/factory_girl-2.1.2.gem +0 -0
- data/vendor/cache/gherkin-2.5.2.gem +0 -0
- data/vendor/cache/haml-3.1.3.gem +0 -0
- data/vendor/cache/httparty-0.8.1.gem +0 -0
- data/vendor/cache/json-1.6.1.gem +0 -0
- data/vendor/cache/json_pure-1.6.1.gem +0 -0
- data/vendor/cache/launchy-2.0.5.gem +0 -0
- data/vendor/cache/mediashelf-loggable-0.4.7.gem +0 -0
- data/vendor/cache/metaclass-0.0.1.gem +0 -0
- data/vendor/cache/mocha-0.10.0.gem +0 -0
- data/vendor/cache/multi_json-1.0.3.gem +0 -0
- data/vendor/cache/multi_xml-0.4.1.gem +0 -0
- data/vendor/cache/om-1.4.2.gem +0 -0
- data/vendor/cache/polyglot-0.3.2.gem +0 -0
- data/vendor/cache/rack-1.2.4.gem +0 -0
- data/vendor/cache/{rails-3.0.9.gem → rails-3.0.10.gem} +0 -0
- data/vendor/cache/railties-3.0.10.gem +0 -0
- data/vendor/cache/rcov-0.9.11.gem +0 -0
- data/vendor/cache/rdoc-3.10.gem +0 -0
- data/vendor/cache/rest-client-1.6.7.gem +0 -0
- data/vendor/cache/selenium-webdriver-2.8.0.gem +0 -0
- data/vendor/cache/solrizer-1.1.2.gem +0 -0
- data/vendor/cache/solrizer-fedora-1.1.2.gem +0 -0
- data/vendor/cache/sqlite3-1.3.4.gem +0 -0
- data/vendor/cache/term-ansicolor-1.0.7.gem +0 -0
- data/vendor/cache/treetop-1.4.10.gem +0 -0
- data/vendor/cache/tzinfo-0.3.30.gem +0 -0
- data/vendor/cache/will_paginate-3.0.2.gem +0 -0
- data/vendor/cache/xml-simple-1.1.1.gem +0 -0
- metadata +351 -121
- data/lib/engine.rb +0 -30
- data/test_support/features/file_assets_list.feature +0 -32
- data/vendor/cache/actionmailer-3.0.9.gem +0 -0
- data/vendor/cache/actionpack-3.0.9.gem +0 -0
- data/vendor/cache/activemodel-3.0.9.gem +0 -0
- data/vendor/cache/activerecord-3.0.9.gem +0 -0
- data/vendor/cache/activeresource-3.0.9.gem +0 -0
- data/vendor/cache/activesupport-3.0.9.gem +0 -0
- data/vendor/cache/capybara-1.0.0.gem +0 -0
- data/vendor/cache/childprocess-0.2.0.gem +0 -0
- data/vendor/cache/crack-0.1.8.gem +0 -0
- data/vendor/cache/cucumber-1.0.2.gem +0 -0
- data/vendor/cache/cucumber-rails-1.0.2.gem +0 -0
- data/vendor/cache/diff-lcs-1.1.2.gem +0 -0
- data/vendor/cache/equivalent-xml-0.2.7.gem +0 -0
- data/vendor/cache/factory_girl-1.3.3.gem +0 -0
- data/vendor/cache/gherkin-2.4.5.gem +0 -0
- data/vendor/cache/haml-3.1.2.gem +0 -0
- data/vendor/cache/httparty-0.7.8.gem +0 -0
- data/vendor/cache/json-1.5.3.gem +0 -0
- data/vendor/cache/json_pure-1.5.3.gem +0 -0
- data/vendor/cache/launchy-2.0.4.gem +0 -0
- data/vendor/cache/mediashelf-loggable-0.4.3.gem +0 -0
- data/vendor/cache/mocha-0.9.12.gem +0 -0
- data/vendor/cache/om-1.2.5.gem +0 -0
- data/vendor/cache/polyglot-0.3.1.gem +0 -0
- data/vendor/cache/rack-1.2.3.gem +0 -0
- data/vendor/cache/railties-3.0.9.gem +0 -0
- data/vendor/cache/rcov-0.9.9.gem +0 -0
- data/vendor/cache/rdoc-3.8.gem +0 -0
- data/vendor/cache/selenium-webdriver-0.2.2.gem +0 -0
- data/vendor/cache/solrizer-1.1.0.gem +0 -0
- data/vendor/cache/solrizer-fedora-1.1.0.gem +0 -0
- data/vendor/cache/term-ansicolor-1.0.5.gem +0 -0
- data/vendor/cache/treetop-1.4.9.gem +0 -0
- data/vendor/cache/tzinfo-0.3.29.gem +0 -0
- data/vendor/cache/will_paginate-2.3.15.gem +0 -0
- data/vendor/cache/xml-simple-1.1.0.gem +0 -0
data/.gitmodules
CHANGED
data/.rvmrc
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# development environment upon cd'ing into the directory
|
5
5
|
|
6
6
|
ruby_string="ree-1.8.7"
|
7
|
+
rubygems_version="1.6.2"
|
7
8
|
gemset_name="hyhead-rails3"
|
8
9
|
|
9
10
|
# Install rubies when used instead of only displaying a warning and exiting
|
@@ -25,6 +26,11 @@ else
|
|
25
26
|
rvm --create "$environment_id"
|
26
27
|
fi
|
27
28
|
|
29
|
+
# Use the specified rubygems_version
|
30
|
+
if [[ -n "${rubygems_version}" && ("$(gem --version)" != ${rubygems_version}) ]] ; then
|
31
|
+
rvm rubygems "${rubygems_version}"
|
32
|
+
fi
|
33
|
+
|
28
34
|
# Ensure that Bundler is installed, install it if it is not.
|
29
35
|
if ! (command -v bundle > /dev/null) ; then
|
30
36
|
printf "The rubygem 'bundler' is not installed, installing it now.\n"
|
@@ -0,0 +1,76 @@
|
|
1
|
+
h2. How to Get Facets to Display on Home Page and in Search Results
|
2
|
+
|
3
|
+
(note - contribute this to blacklight project and then just link to it in HOW_DO_I doc)
|
4
|
+
|
5
|
+
1. Determine which indexed Solr fields you want to as facets.
|
6
|
+
|
7
|
+
If you have declared them with OM terminology in your datastream models, then they will be the fields in Solr named (something)_facet.
|
8
|
+
To see what fields are in Solr, go to:
|
9
|
+
|
10
|
+
<pre>
|
11
|
+
http://localhost:8983/solr/development/admin/schema.jsp
|
12
|
+
</pre>
|
13
|
+
|
14
|
+
where "http://localhost:8983/solr/development" is the base url for your Solr instance. Click on the "fields" link in the left navigation bar. You will see a list of all your Solr fields. Use the "find" function in your web browser to locate all the fields ending with _facet.
|
15
|
+
|
16
|
+
Let's say my Solr index has these facet fields: object_type_facet, set_type_facet, genre_facet
|
17
|
+
"tag_facet"
|
18
|
+
|
19
|
+
|
20
|
+
2. Write a test
|
21
|
+
|
22
|
+
e.g. features/facets.feature
|
23
|
+
|
24
|
+
<pre>
|
25
|
+
Feature: Facets on Home Page and Search Results
|
26
|
+
I want facets to display and work properly
|
27
|
+
|
28
|
+
Scenario: home page facets
|
29
|
+
When I am on the home page
|
30
|
+
Then I should see "Format"
|
31
|
+
And I should see "Book"
|
32
|
+
|
33
|
+
Scenario: search results facets
|
34
|
+
When I am on the home page
|
35
|
+
And I fill in "q" with "dor"
|
36
|
+
And I press "Search"
|
37
|
+
Then I should see "Format"
|
38
|
+
And I should see "Book"
|
39
|
+
</pre>
|
40
|
+
|
41
|
+
3. Ensure test fails
|
42
|
+
|
43
|
+
4. Indicate the facet fields in a Rails initializer.
|
44
|
+
|
45
|
+
Facet fields are initially configured by config/initializers/blacklight_config.rb in your Rails app. You override these configurations by creating a new file in config/initializers that MUST sort later alphabetically than blacklight_config. Your hydra_app_config.rb might look something like this:
|
46
|
+
|
47
|
+
<pre>
|
48
|
+
# overrides of blacklight_config.rb
|
49
|
+
Blacklight.configure(:shared) do |config|
|
50
|
+
|
51
|
+
...
|
52
|
+
|
53
|
+
# solr fields that will be treated as facets by the blacklight application
|
54
|
+
# The ordering of the field names is the order of the display
|
55
|
+
config[:facet] = {
|
56
|
+
:field_names => (facet_fields = [
|
57
|
+
"object_type_facet",
|
58
|
+
"set_type_facet",
|
59
|
+
"genre_facet"
|
60
|
+
]),
|
61
|
+
:labels => {
|
62
|
+
"object_type_facet"=>"Object Type",
|
63
|
+
"set_type_facet"=>"Set Type",
|
64
|
+
"genre_facet"=>"Genre"
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
# Have BL send all facet field names to Solr.
|
69
|
+
config[:default_solr_params] ||= {}
|
70
|
+
config[:default_solr_params][:"facet.field"] = facet_fields
|
71
|
+
|
72
|
+
...
|
73
|
+
</pre>
|
74
|
+
|
75
|
+
5. Ensure test passes.
|
76
|
+
|
@@ -0,0 +1,323 @@
|
|
1
|
+
h1. Creating a Rails Application with the Hydra-Head Plugin.
|
2
|
+
|
3
|
+
This document describes how to create a Hydra rails application.
|
4
|
+
|
5
|
+
It does NOT describe how to get the hydra-head plugin code with the pre-configured rails application for testing: for that, see "DEVELOP_PLUGIN":https://github.com/projecthydra/hydra-head/blob/master/DEVELOP_PLUGIN.textile.
|
6
|
+
|
7
|
+
h3. I. Install Prerequisites
|
8
|
+
|
9
|
+
See "INSTALL_PREREQ":/projecthydra/hydra-head/blob/master/INSTALL_PREREQ.textile
|
10
|
+
|
11
|
+
h2. II. Install a Blacklight Application
|
12
|
+
|
13
|
+
This process begins with the installation of the Blacklight ("http://projectblacklight.org":http://projectblacklight.org) rails application.
|
14
|
+
|
15
|
+
h4. (1) Create the RVM Gemset and Install Pre-Requisite Gems.
|
16
|
+
|
17
|
+
<pre>
|
18
|
+
rvm gemset create hydra-head
|
19
|
+
rvm use ree-1.8.7@hydra-head
|
20
|
+
gem install -v=2.3.11 rails
|
21
|
+
gem install sqlite3
|
22
|
+
</pre>
|
23
|
+
|
24
|
+
h4. (2) Run the Blacklight Installation Script.
|
25
|
+
|
26
|
+
<pre>
|
27
|
+
rails ./my-hydra-app -m http://projectblacklight.org/templates/2-8-0.rb
|
28
|
+
</pre>
|
29
|
+
|
30
|
+
install gems? yes
|
31
|
+
|
32
|
+
run migrations? yes
|
33
|
+
|
34
|
+
install solr? no
|
35
|
+
|
36
|
+
h4. (3) Put Your New Hydra Rails Application into Version Control.
|
37
|
+
|
38
|
+
Set up git repository:
|
39
|
+
|
40
|
+
<pre>
|
41
|
+
cd my-hydra-app
|
42
|
+
git init .
|
43
|
+
</pre>
|
44
|
+
|
45
|
+
Create a .gitignore file. A good model is at "https://github.com/projecthydra/hydra-head/blob/master/.gitignore":https://github.com/projecthydra/hydra-head/blob/master/.gitignore
|
46
|
+
|
47
|
+
Do the initial commit:
|
48
|
+
|
49
|
+
<pre>
|
50
|
+
git add .
|
51
|
+
git commit -m "installed blacklight via its template installer"
|
52
|
+
</pre>
|
53
|
+
|
54
|
+
h4. (4) Add Blacklight Plugin Files into Version Control.
|
55
|
+
|
56
|
+
The blacklight template installer has the blacklight plugin code included as a git submodule. We want it to be added in its entirety into your local git repository.
|
57
|
+
|
58
|
+
<pre>
|
59
|
+
cp -R vendor/plugins/blacklight/ vendor/plugins/blacklight-temp/
|
60
|
+
|
61
|
+
rm -rf vendor/plugins/blacklight
|
62
|
+
git rm vendor/plugins/blacklight
|
63
|
+
|
64
|
+
mv vendor/plugins/blacklight-temp vendor/plugins/blacklight
|
65
|
+
git add vendor/plugins/blacklight
|
66
|
+
git commit -m "blacklight plugin files added to git repository (no longer a submodule)"
|
67
|
+
</pre>
|
68
|
+
|
69
|
+
h2. III. Add the Hydra-Head Configuration Files to Your Application
|
70
|
+
|
71
|
+
Note: these steps will eventually be handled by a generator. For now:
|
72
|
+
|
73
|
+
h4. (1) Clone a copy of the hydra-head repository
|
74
|
+
|
75
|
+
Make sure you don't do this within the rails application you are creating.
|
76
|
+
|
77
|
+
<pre>
|
78
|
+
cd ..
|
79
|
+
git clone git://github.com/projecthydra/hydra-head.git
|
80
|
+
cd my-hydra-app
|
81
|
+
</pre>
|
82
|
+
|
83
|
+
h4. (2) Copy the desired hydra-head config files
|
84
|
+
|
85
|
+
Be careful not to override routes.rb! The following commands avoid this:
|
86
|
+
|
87
|
+
<pre>
|
88
|
+
cp config/routes.rb routes-copy.rb
|
89
|
+
cp ../hydra-head/Gemfile ./
|
90
|
+
cp -R ../hydra-head/config/* config/
|
91
|
+
mv routes-copy.rb config/routes.rb
|
92
|
+
</pre>
|
93
|
+
|
94
|
+
Copy the fedora and solr config files into the application. This is where you will keep your application-specific copies of solr and fedora configuration. When running the app, you need to copy these files into your copies of Fedora and Solr. When you're using the copy of hydra-jetty in the"jetty" directory, running rake hydra:jetty:load will copy them into the jetty directory for you.
|
95
|
+
|
96
|
+
<pre>
|
97
|
+
cp -R ../hydra-head/solr ./
|
98
|
+
cp -R ../hydra-head/fedora ./
|
99
|
+
</pre>
|
100
|
+
|
101
|
+
|
102
|
+
When you run @git status@ you should see something like this:
|
103
|
+
|
104
|
+
<pre>
|
105
|
+
# modified: config/initializers/blacklight_config.rb
|
106
|
+
# modified: config/initializers/mime_types_.rb
|
107
|
+
# modified: config/solr.yml
|
108
|
+
|
109
|
+
# Untracked files:
|
110
|
+
# Gemfile
|
111
|
+
# config/fedora.yml
|
112
|
+
# config/initializers/fedora_config.rb
|
113
|
+
# config/initializers/hydra_config.rb
|
114
|
+
# config/role_map_cucumber.yml
|
115
|
+
# config/role_map_development.yml
|
116
|
+
# config/role_map_production.yml
|
117
|
+
# config/role_map_test.yml
|
118
|
+
# config/solr_mappings.yml
|
119
|
+
</pre>
|
120
|
+
|
121
|
+
h4. (3) Put the hydra-head database migrations into the root app.
|
122
|
+
|
123
|
+
<pre>
|
124
|
+
cp ../hydra-head/db/migrate/* db/migrate
|
125
|
+
</pre>
|
126
|
+
|
127
|
+
h4. (4) Add .rvmrc
|
128
|
+
|
129
|
+
Only do this if you're using RVM. DON'T do this if you're going to use this application for running tests. (Naomi asks "Why?")
|
130
|
+
|
131
|
+
<pre>
|
132
|
+
cp ../hydra-head/.rvmrc .
|
133
|
+
</pre>
|
134
|
+
|
135
|
+
h4. (5) Commit the files to your git repository:
|
136
|
+
|
137
|
+
<pre>
|
138
|
+
git add *
|
139
|
+
git commit -a -m "adding hydra-head configuration files, including db migrations and .rvmrc"
|
140
|
+
</pre>
|
141
|
+
|
142
|
+
h2. IV. Get Required Gems
|
143
|
+
|
144
|
+
Now that you have the hydra-head Gemfile in your application, you can run bundle install to get the required gems:
|
145
|
+
|
146
|
+
<pre>
|
147
|
+
bundle install
|
148
|
+
</pre>
|
149
|
+
|
150
|
+
h2. V. Install Required Plugins
|
151
|
+
|
152
|
+
h3. (1) engines plugin
|
153
|
+
|
154
|
+
Move Blacklight's copy of the engines plugin into the app's vendor/plugins directory. This is mainly so you have access to the rake tasks that the engines plugin provides.
|
155
|
+
|
156
|
+
<pre>
|
157
|
+
mv vendor/plugins/blacklight/vendor/plugins/engines vendor/plugins/
|
158
|
+
</pre>
|
159
|
+
|
160
|
+
h3. (2) hydra-head plugin
|
161
|
+
|
162
|
+
There are many ways to get the hydra-head code into vendor/plugins. One way is to use script/plugin install:
|
163
|
+
|
164
|
+
<pre>
|
165
|
+
script/plugin install git://github.com/projecthydra/hydra-head.git
|
166
|
+
</pre>
|
167
|
+
|
168
|
+
h3. (3) white_list plugin
|
169
|
+
|
170
|
+
This is a legacy dependency. We will be removing it soon, but for now you need to have it installed in order for hydra-head to run properly.
|
171
|
+
|
172
|
+
<pre>
|
173
|
+
script/plugin install git://github.com/projecthydra/white_list.git
|
174
|
+
</pre>
|
175
|
+
|
176
|
+
h3. (4) fluid-infusion plugin
|
177
|
+
|
178
|
+
This is another legacy dependency. Now we mainly rely on it just for the implementation of swfuploader.
|
179
|
+
|
180
|
+
<pre>
|
181
|
+
script/plugin install git://github.com/mediashelf/fluid-infusion.git
|
182
|
+
</pre>
|
183
|
+
|
184
|
+
h3. (5) blacklight plugin: patch CatalogController
|
185
|
+
|
186
|
+
Note: (this may no longer be necessary 2011-06-14)
|
187
|
+
|
188
|
+
(or maybe: the long-term fix to this will be to implement before_render callbacks in CatalogController.show and refactor hydra-head to use those callbacks instead of aliasing the show method itself.)
|
189
|
+
|
190
|
+
Blacklight's CatalogController.show method breaks the hydra-head overrides. To fix this, comment out lines 47-51 in vendor/plugins/blacklight/app/controllers/catalog-controller.rb:
|
191
|
+
|
192
|
+
<pre>
|
193
|
+
# Add all dynamically added (such as by document extensions)
|
194
|
+
# export formats.
|
195
|
+
#@document.export_formats.each_key do | format_name |
|
196
|
+
# # It's important that the argument to send be a symbol;
|
197
|
+
# # if it's a string, it makes Rails unhappy for unclear reasons.
|
198
|
+
# format.send(format_name.to_sym) { render :text => @document.export_as(format_name) }
|
199
|
+
#end
|
200
|
+
</pre>
|
201
|
+
|
202
|
+
h3. (6) Add the plugins to git.
|
203
|
+
|
204
|
+
<pre>
|
205
|
+
git add *
|
206
|
+
git commit -a -m "adding required plugins"
|
207
|
+
</pre>
|
208
|
+
|
209
|
+
h2. VI. Update config/environment.rb to Load Plugins in the Correct Order
|
210
|
+
|
211
|
+
h4. (1) Edit config/environment.rb.
|
212
|
+
|
213
|
+
In config/environment.rb, change line 8 to use '../vendor/plugins/engines/boot' instead of '../vendor/plugins/blacklight/vendor/plugins/engines/boot'
|
214
|
+
|
215
|
+
<pre>
|
216
|
+
require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
|
217
|
+
# require File.join(File.dirname(__FILE__), '../vendor/plugins/blacklight/vendor/plugins/engines/boot')
|
218
|
+
</pre>
|
219
|
+
|
220
|
+
In that same file, add the following lines inside the @Rails::Initializer.run do |config|@ code block. This will set the load order for plugins, ensuring that blacklight is loaded before hydra-head.
|
221
|
+
|
222
|
+
<pre>
|
223
|
+
config.plugins = %W(engines blacklight fluid-infusion hydra-head white_list)
|
224
|
+
</pre>
|
225
|
+
|
226
|
+
h4. (2) Commit the changes to git.
|
227
|
+
|
228
|
+
<pre>
|
229
|
+
git commit config/ -m "Update config/environment.rb to load plugins in the right order"
|
230
|
+
</pre>
|
231
|
+
|
232
|
+
h2. VII. Update Application's application_controller and application_helper to Use Hydra-Head Plugin
|
233
|
+
|
234
|
+
h4. (1) Edit app/controllers/application_controller.rb
|
235
|
+
|
236
|
+
Change the first line to require the hydra-head plugin's controller rather than blacklight's:
|
237
|
+
|
238
|
+
<pre>
|
239
|
+
require_dependency( 'vendor/plugins/blacklight/app/controllers/application_controller.rb')
|
240
|
+
</pre>
|
241
|
+
|
242
|
+
becomes
|
243
|
+
|
244
|
+
<pre>
|
245
|
+
require_dependency( 'vendor/plugins/hydra-head/app/controllers/application_controller.rb')
|
246
|
+
</pre>
|
247
|
+
|
248
|
+
h4. (2) Edit app/helpers/application_helper.rb
|
249
|
+
|
250
|
+
Change the first line to require the hydra-head plugin's helper rather than blacklight's:
|
251
|
+
|
252
|
+
<pre>
|
253
|
+
require 'vendor/plugins/blacklight/app/helpers/application_helper.rb'
|
254
|
+
</pre>
|
255
|
+
|
256
|
+
becomes
|
257
|
+
|
258
|
+
<pre>
|
259
|
+
require 'vendor/plugins/hydra-head/app/helpers/application_helper.rb'
|
260
|
+
</pre>
|
261
|
+
|
262
|
+
h4. (3) Commit the changes to git.
|
263
|
+
|
264
|
+
<pre>
|
265
|
+
git commit app/ -m "Update application_controller and application_helper to require hydra-head plugin, not blacklight"
|
266
|
+
</pre>
|
267
|
+
|
268
|
+
|
269
|
+
h2. VIII. If You Plan to Use This Rails App For Running the Automated Tests
|
270
|
+
|
271
|
+
Stop here and go to "DEVELOP_PLUGIN":https://github.com/projecthydra/hydra-head/blob/master/DEVELOP_PLUGIN.textile.
|
272
|
+
|
273
|
+
h2. IX. Run the Database Migrations
|
274
|
+
|
275
|
+
The following will run the migrations for the app and for its plugins:
|
276
|
+
|
277
|
+
<pre>
|
278
|
+
rake db:migrate:all
|
279
|
+
</pre>
|
280
|
+
|
281
|
+
h2. X. Spin up Solr and Fedora
|
282
|
+
|
283
|
+
The easiest way is to put a copy of hydra-jetty into the jetty directory within your app. This provides copies of solr and fedora that you can use for testing and development purposes.
|
284
|
+
|
285
|
+
h4. (1) Get hydra-jetty (jetty preconfigured with Fedora and Solr)
|
286
|
+
|
287
|
+
<pre>
|
288
|
+
git submodule add git://github.com/projecthydra/hydra-jetty.git jetty
|
289
|
+
</pre>
|
290
|
+
|
291
|
+
h4. (2) Add submodule SHA to git, but not the hydra-jetty files.
|
292
|
+
|
293
|
+
<pre>
|
294
|
+
(add line containing "jetty" to .git/info/excludes file)
|
295
|
+
git add .gitmodules
|
296
|
+
git commit -m "Adding hydra-jetty submodule"
|
297
|
+
</pre>
|
298
|
+
|
299
|
+
h4. (3) Run Jetty
|
300
|
+
|
301
|
+
_Stop any copies of jetty (or anything else using port 8983) before running this command._
|
302
|
+
(Note that java 1.6 must be invoked by the "java" command or Fedora won't work.)
|
303
|
+
|
304
|
+
The following will copy Solr and Fedora configuration files over to jetty in addition to starting it:
|
305
|
+
|
306
|
+
<pre>
|
307
|
+
rake hydra:jetty:load
|
308
|
+
</pre>
|
309
|
+
|
310
|
+
h2. XI. Run Your New Hydra Application
|
311
|
+
|
312
|
+
<pre>
|
313
|
+
script/server
|
314
|
+
</pre>
|
315
|
+
|
316
|
+
You should now be able to go to your application at http://localhost:3000.
|
317
|
+
|
318
|
+
Note that there are no objects pre-installed into Fedora (or Solr).
|
319
|
+
|
320
|
+
h2. XII. Develop your Hydra Application with ActiveFedora and OM
|
321
|
+
|
322
|
+
See "HOW_TO_GET_STARTED":https://github.com/mediashelf/om/blob/master/HOW_TO_GET_STARTED.textile.
|
323
|
+
|
@@ -0,0 +1,90 @@
|
|
1
|
+
h1. Setting Up the Hydra-Head Plugin as a Project Containing a Rails Application for Testing or Demo
|
2
|
+
|
3
|
+
This document describes how to set up a project for the hydra-head plugin code itself - primarily intended for the hydra-head plugin developers. It will contain a pre-configured rails application for testing the hydra-head plugin.
|
4
|
+
|
5
|
+
It does NOT describe how to set up a rails application that uses the hydra-head plugin. For that, see "CREATE_RAILS_APP":https://github.com/projecthydra/hydra-head/blob/master/CREATE_RAILS_APP.textile.
|
6
|
+
|
7
|
+
h2. Install the Hydra-Plugin and its Contained Test Host Application
|
8
|
+
|
9
|
+
h4. (0) Install Prerequisites.
|
10
|
+
|
11
|
+
See "INSTALL_PREREQ":/projecthydra/hydra-head/blob/master/INSTALL_PREREQ.textile
|
12
|
+
|
13
|
+
h4. (1) Get the hydra-head engines plugin from github and include the testing rails application.
|
14
|
+
|
15
|
+
<pre>
|
16
|
+
git clone --recursive git@github.com:projecthydra/hydra-head.git
|
17
|
+
cd hydra-head
|
18
|
+
</pre>
|
19
|
+
|
20
|
+
This will also initialize and update the jetty and hydra-plugin_test_host git submodules. The former is a copy of Jetty pre-configured for Hydra with Fedora and Solr installed. The latter is a preconfigured Rails application to house and test the hydra-head engines plugin.
|
21
|
+
|
22
|
+
This <b>hydra-head directory</b> is the <b><i>root of the plugin</i>.</b>
|
23
|
+
|
24
|
+
h4. (2) Use bundler to install the gem dependencies.
|
25
|
+
|
26
|
+
<pre>
|
27
|
+
bundle install
|
28
|
+
</pre>
|
29
|
+
|
30
|
+
Note that if you have RVM installed, it will create/use a gemset called "hyhead".
|
31
|
+
|
32
|
+
|
33
|
+
h4. (3) Put a copy of the hydra-head plugin into the testing application
|
34
|
+
|
35
|
+
The rails application used for testing MUST have a copy of the hydra-head plugin added to its vendor/plugins directory. We provide a "rake task":http://hudson.projecthydra.org/job/hydra-head-rails2-plugin/Documentation/file.README_RAKE_TASKS.html#hyhead_Test_Host_Setup__setup_test_host for this which copies your current hydra-head plugin code into hydra-plugin_test_host/vendor/plugins as well as the fixtures and cucumber features required for testing.
|
36
|
+
|
37
|
+
<pre>
|
38
|
+
rake hyhead:setup_test_host
|
39
|
+
</pre>
|
40
|
+
|
41
|
+
h4. (5) Migrate the test databases
|
42
|
+
|
43
|
+
See below to reset the test databases when re-running tests.
|
44
|
+
|
45
|
+
You must do this within the <b><i>hydra-plugin_test_host</i> directory</b>, not at the root of the plugin.
|
46
|
+
|
47
|
+
<pre>
|
48
|
+
cd hydra-plugin_test_host
|
49
|
+
</pre>
|
50
|
+
|
51
|
+
To ensure that the tests do not rely on non-test data, do this:
|
52
|
+
|
53
|
+
<pre>
|
54
|
+
rake db:drop:all
|
55
|
+
</pre>
|
56
|
+
|
57
|
+
Migrate the test databases:
|
58
|
+
|
59
|
+
<pre>
|
60
|
+
rake db:migrate RAILS_ENV=test
|
61
|
+
</pre>
|
62
|
+
|
63
|
+
In case you ever run the server in development mode, you will need to migrate the databases without RAILS_ENV set to test:
|
64
|
+
|
65
|
+
<pre>
|
66
|
+
rake db:migrate
|
67
|
+
</pre>
|
68
|
+
|
69
|
+
Now cd back up to the root of the <b><i>hydra-head plugin</i> directory</b>:
|
70
|
+
|
71
|
+
<pre>
|
72
|
+
cd ../
|
73
|
+
</pre>
|
74
|
+
|
75
|
+
h3. Now you're ready to run the tests
|
76
|
+
|
77
|
+
If you want to run the tests, see "TESTING_PLUGIN":/projecthydra/hydra-head/blob/master/TESTING_PLUGIN.textile
|
78
|
+
|
79
|
+
h2. Running the Testing Application
|
80
|
+
|
81
|
+
The test host app is a regular Rails app with Blacklight installed. It's configured with the assumption that the hydra-head plugin is installed into vendor/plugins/hydra-head.
|
82
|
+
|
83
|
+
Hydra expects Fedora and Solr instances to be running (for testing, a jetty instance is provided in the hydra-head plugin directory. See also config/solr.yml and config/fedora.yml).
|
84
|
+
|
85
|
+
Change into the root of the test app and start it like you normally start any rails app.
|
86
|
+
|
87
|
+
<pre>
|
88
|
+
cd hydra-plugin_test_host
|
89
|
+
script/server
|
90
|
+
</pre>
|
@@ -0,0 +1,84 @@
|
|
1
|
+
h1. Git Workflow (with command line examples) for working on Hydra Projects
|
2
|
+
|
3
|
+
h2. Reference Material/Reading:
|
4
|
+
|
5
|
+
Good places to read about git workflows:
|
6
|
+
|
7
|
+
* "Diaspora Git Workflow":https://github.com/diaspora/diaspora/wiki/Git-Workflow
|
8
|
+
* "Thinkup Developer Documentation":http://thinkupapp.com/docs/contribute/developers/devfromsource.html
|
9
|
+
|
10
|
+
You might want to set up your shell prompt to tell you which git branch you're in.
|
11
|
+
|
12
|
+
* "Displaying git branch info in your bash prompt":http://yourmediashelf.com/2011/08/displaying-git-branch-info-in-bash-prompt/
|
13
|
+
|
14
|
+
h2. Creating a Feature Branch then Rebasing, Merging and Cleaning Up
|
15
|
+
|
16
|
+
*Scenario:* You're working on the HYDRA-333 ticket.
|
17
|
+
|
18
|
+
# You already have a working copy of hydra-head cloned to your local machine.
|
19
|
+
# Your work is starting from the contents of hydra-head/master
|
20
|
+
|
21
|
+
The steps:
|
22
|
+
|
23
|
+
# Create a feature branch
|
24
|
+
# If necessary, push a copy of the working branch to github
|
25
|
+
# Rebase the feature branch
|
26
|
+
# Merge the finished work into Master
|
27
|
+
# Clean up after yourself
|
28
|
+
|
29
|
+
Here's how to do the right thing with git on the command line. *Note*: the parts in parentheses indicates which branch you should be on when you run the command. If it doesn't matter which branch you're on, this is indicated with (*).
|
30
|
+
|
31
|
+
h3. Create your feature branch
|
32
|
+
|
33
|
+
<pre>
|
34
|
+
cd hydra-head
|
35
|
+
(master) git checkout -b HYDRA-333
|
36
|
+
</pre>
|
37
|
+
|
38
|
+
Make changes and commit them to your feature branch like normal.
|
39
|
+
|
40
|
+
<pre>
|
41
|
+
(HYDRA-333) git add …
|
42
|
+
(HYDRA-333) git commit …
|
43
|
+
</pre>
|
44
|
+
|
45
|
+
h3. If necessary, push a copy of the feature branch to github
|
46
|
+
|
47
|
+
If you need to share your feature branch, push it to github
|
48
|
+
|
49
|
+
<pre>
|
50
|
+
(HYDRA-333) git push origin HYDRA-333
|
51
|
+
</pre>
|
52
|
+
|
53
|
+
h3. Rebase the feature branch
|
54
|
+
|
55
|
+
Repeat work until the HYDRA-333 ticket is ready to close, then rebase that work & merge it into the master branch ...
|
56
|
+
|
57
|
+
<pre>
|
58
|
+
(*) git checkout master
|
59
|
+
(master) git pull origin master
|
60
|
+
(master) git checkout HYDRA-333
|
61
|
+
(HYDRA-333) git rebase master
|
62
|
+
... walk through the rebase ...
|
63
|
+
</pre>
|
64
|
+
|
65
|
+
At this point, you should *rerun your full test suite* to make sure that the rebase did not break anything.
|
66
|
+
|
67
|
+
h3. Merge the finished work into Master
|
68
|
+
|
69
|
+
If all of the tests pass after the rebase, you're ready to merge your work into master and push it to github.
|
70
|
+
|
71
|
+
<pre>
|
72
|
+
(HYDRA-333) git checkout master
|
73
|
+
(master) git merge HYDRA-333
|
74
|
+
(master) git push origin master
|
75
|
+
</pre>
|
76
|
+
|
77
|
+
h3. Clean up after yourself
|
78
|
+
|
79
|
+
Now delete the local & remote copies of the feature branch
|
80
|
+
|
81
|
+
<pre>
|
82
|
+
(master) git branch -d HYDRA-333
|
83
|
+
(master) git push origin :HYDRA-333
|
84
|
+
</pre>
|