enju_loc 0.1.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +38 -0
- data/app/assets/javascripts/loc_search.js +2 -0
- data/app/assets/stylesheets/loc_search.css +4 -0
- data/app/controllers/loc_search_controller.rb +49 -0
- data/app/helpers/loc_search_helper.rb +18 -0
- data/app/models/loc_search.rb +97 -0
- data/app/views/loc_search/index.html.erb +49 -0
- data/config/locales/en.yml +13 -0
- data/config/locales/ja.yml +11 -0
- data/config/routes.rb +3 -0
- data/lib/enju_loc.rb +21 -0
- data/lib/enju_loc/engine.rb +7 -0
- data/lib/enju_loc/loc_search.rb +537 -0
- data/lib/enju_loc/version.rb +3 -0
- data/lib/tasks/enju_loc_tasks.rake +4 -0
- data/spec/cassette_library/LocSearch/_ModsRecord/should_parse_MODS_metadata.yml +111 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_create_a_valid_manifestation.yml +113 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_create_lcsh_subjects_only.yml +66 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_create_multiple_series_statements.yml +69 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_distinguish_title_information_with_subject.yml +67 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_import_a_manifestation_that_has_invalid_classification.yml +81 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_import_another_serial.yml +85 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_import_audio_book.yml +91 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_import_e-resource.yml +73 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_import_note_fields.yml +72 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_import_publication_year.yml +78 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_import_serial.yml +70 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_import_video_publication.yml +204 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_parse_title_information_properly.yml +80 -0
- data/spec/cassette_library/LocSearch/_import_from_sru_response/should_support_name_and_title_subjects.yml +77 -0
- data/spec/cassette_library/LocSearch/_search/should_return_a_search_result.yml +353 -0
- data/spec/cassette_library/LocSearchController/GET_index/should_get_index.yml +353 -0
- data/spec/cassette_library/LocSearchController/GET_index/should_get_index_with_page_parameter.yml +415 -0
- data/spec/cassette_library/LocSearchController/POST_create/should_create_a_bibliographic_record_if_lccn_is_set.yml +140 -0
- data/spec/cassette_library/LocSearchController/POST_create/should_not_create_a_bibliographic_record_if_lccn_is_not_set.yml +38 -0
- data/spec/controllers/loc_search_controller_spec.rb +44 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/setting.rb +4 -0
- data/spec/dummy/app/models/user.rb +8 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +47 -0
- data/spec/dummy/config/application.yml +38 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +30 -0
- data/spec/dummy/config/environments/production.rb +60 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/devise.rb +207 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +58 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/001_create_agents.rb +50 -0
- data/spec/dummy/db/migrate/002_devise_create_users.rb +46 -0
- data/spec/dummy/db/migrate/005_create_manifestations.rb +44 -0
- data/spec/dummy/db/migrate/006_create_items.rb +21 -0
- data/spec/dummy/db/migrate/012_create_owns.rb +12 -0
- data/spec/dummy/db/migrate/015_create_creates.rb +12 -0
- data/spec/dummy/db/migrate/029_create_subjects.rb +27 -0
- data/spec/dummy/db/migrate/041_create_roles.rb +13 -0
- data/spec/dummy/db/migrate/047_create_produces.rb +12 -0
- data/spec/dummy/db/migrate/059_create_libraries.rb +28 -0
- data/spec/dummy/db/migrate/069_create_shelves.rb +15 -0
- data/spec/dummy/db/migrate/073_create_carrier_types.rb +11 -0
- data/spec/dummy/db/migrate/077_create_user_groups.rb +12 -0
- data/spec/dummy/db/migrate/080_create_library_groups.rb +17 -0
- data/spec/dummy/db/migrate/112_create_frequencies.rb +12 -0
- data/spec/dummy/db/migrate/117_create_form_of_works.rb +12 -0
- data/spec/dummy/db/migrate/120_create_baskets.rb +12 -0
- data/spec/dummy/db/migrate/124_create_bookstores.rb +17 -0
- data/spec/dummy/db/migrate/125_create_donates.rb +12 -0
- data/spec/dummy/db/migrate/130_create_request_status_types.rb +12 -0
- data/spec/dummy/db/migrate/131_create_request_types.rb +12 -0
- data/spec/dummy/db/migrate/142_create_classifications.rb +19 -0
- data/spec/dummy/db/migrate/144_create_classification_types.rb +16 -0
- data/spec/dummy/db/migrate/145_create_subject_heading_types.rb +16 -0
- data/spec/dummy/db/migrate/146_create_subject_types.rb +16 -0
- data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +13 -0
- data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +13 -0
- data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +12 -0
- data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +17 -0
- data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +14 -0
- data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +17 -0
- data/spec/dummy/db/migrate/20081025083323_create_countries.rb +28 -0
- data/spec/dummy/db/migrate/20081025083905_create_languages.rb +23 -0
- data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +15 -0
- data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +20 -0
- data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +20 -0
- data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +15 -0
- data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
- data/spec/dummy/db/migrate/20090719201843_create_extents.rb +12 -0
- data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +12 -0
- data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +12 -0
- data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +27 -0
- data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +12 -0
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +18 -0
- data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +13 -0
- data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +14 -0
- data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +13 -0
- data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +9 -0
- data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +10 -0
- data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +12 -0
- data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
- data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +15 -0
- data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +11 -0
- data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
- data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +11 -0
- data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +9 -0
- data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +11 -0
- data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
- data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
- data/spec/dummy/db/migrate/20110913120629_add_lft_and_rgt_to_classification.rb +11 -0
- data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +13 -0
- data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +10 -0
- data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +9 -0
- data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
- data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
- data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +6 -0
- data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +12 -0
- data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +6 -0
- data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +6 -0
- data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +14 -0
- data/spec/dummy/db/migrate/20120406020752_add_url_to_subject.rb +5 -0
- data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
- data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
- data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +6 -0
- data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +16 -0
- data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +6 -0
- data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
- data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
- data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +6 -0
- data/spec/dummy/db/migrate/20130504133816_add_manifestation_id_to_subject.rb +6 -0
- data/spec/dummy/db/migrate/20130504143515_add_manifestation_id_to_classification.rb +6 -0
- data/spec/dummy/db/migrate/20130504195916_add_subject_heading_type_id_to_subject.rb +5 -0
- data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +12 -0
- data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +15 -0
- data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +18 -0
- data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +11 -0
- data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +20 -0
- data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +11 -0
- data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +11 -0
- data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +11 -0
- data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +8 -0
- data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +6 -0
- data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +5 -0
- data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +5 -0
- data/spec/dummy/db/schema.rb +1008 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +2139 -0
- data/spec/dummy/log/test.log +21513 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/fixtures/agent_types.yml +35 -0
- data/spec/fixtures/carrier_types.yml +51 -0
- data/spec/fixtures/classification_types.yml +13 -0
- data/spec/fixtures/content_types.yml +19 -0
- data/spec/fixtures/countries.yml +2059 -0
- data/spec/fixtures/frequencies.yml +76 -0
- data/spec/fixtures/identifier_types.yml +36 -0
- data/spec/fixtures/languages.yml +1901 -0
- data/spec/fixtures/roles.yml +35 -0
- data/spec/fixtures/subject_heading_types.yml +39 -0
- data/spec/fixtures/subject_types.yml +42 -0
- data/spec/fixtures/user_has_roles.yml +41 -0
- data/spec/fixtures/users.yml +51 -0
- data/spec/models/loc_search_spec.rb +195 -0
- data/spec/rails_helper.rb +43 -0
- data/spec/spec_helper.rb +47 -0
- data/spec/support/controller_macros.rb +25 -0
- data/spec/support/devise.rb +4 -0
- metadata +615 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
---
|
2
|
+
role_00001:
|
3
|
+
name: Guest
|
4
|
+
display_name: Guest
|
5
|
+
id: 1
|
6
|
+
note:
|
7
|
+
role_00002:
|
8
|
+
name: User
|
9
|
+
display_name: User
|
10
|
+
id: 2
|
11
|
+
note:
|
12
|
+
role_00003:
|
13
|
+
name: Librarian
|
14
|
+
display_name: Librarian
|
15
|
+
id: 3
|
16
|
+
note:
|
17
|
+
role_00004:
|
18
|
+
name: Administrator
|
19
|
+
display_name: Administrator
|
20
|
+
id: 4
|
21
|
+
note:
|
22
|
+
|
23
|
+
# == Schema Information
|
24
|
+
#
|
25
|
+
# Table name: roles
|
26
|
+
#
|
27
|
+
# id :integer not null, primary key
|
28
|
+
# name :string(255) not null
|
29
|
+
# display_name :string(255)
|
30
|
+
# note :text
|
31
|
+
# created_at :datetime
|
32
|
+
# updated_at :datetime
|
33
|
+
# position :integer
|
34
|
+
#
|
35
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
subject_heading_type_00001:
|
3
|
+
name: unknown
|
4
|
+
display_name: unknown
|
5
|
+
updated_at: 2008-03-03 00:44:49.850140 +09:00
|
6
|
+
id: 1
|
7
|
+
note: ""
|
8
|
+
created_at: 2008-03-03 00:44:34.260739 +09:00
|
9
|
+
position: 1
|
10
|
+
subject_heading_type_00002:
|
11
|
+
name: ndlsh
|
12
|
+
display_name: NDLSH
|
13
|
+
updated_at: 2008-03-03 00:44:49.850140 +09:00
|
14
|
+
id: 2
|
15
|
+
note: ""
|
16
|
+
created_at: 2008-03-03 00:44:34.260739 +09:00
|
17
|
+
position: 2
|
18
|
+
subject_heading_type_00003:
|
19
|
+
name: bsh
|
20
|
+
display_name: BSH
|
21
|
+
updated_at: 2008-03-03 00:44:58.685360 +09:00
|
22
|
+
id: 3
|
23
|
+
note: ""
|
24
|
+
created_at: 2008-03-03 00:44:58.685360 +09:00
|
25
|
+
position: 3
|
26
|
+
|
27
|
+
# == Schema Information
|
28
|
+
#
|
29
|
+
# Table name: subject_heading_types
|
30
|
+
#
|
31
|
+
# id :integer not null, primary key
|
32
|
+
# name :string(255) not null
|
33
|
+
# display_name :text
|
34
|
+
# note :text
|
35
|
+
# position :integer
|
36
|
+
# created_at :datetime not null
|
37
|
+
# updated_at :datetime not null
|
38
|
+
#
|
39
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
subject_type_00001:
|
3
|
+
id: 1
|
4
|
+
name: concept
|
5
|
+
display_name: Concept
|
6
|
+
note:
|
7
|
+
position: 1
|
8
|
+
|
9
|
+
subject_type_00002:
|
10
|
+
id: 2
|
11
|
+
name: event
|
12
|
+
display_name: Event
|
13
|
+
note:
|
14
|
+
position: 2
|
15
|
+
|
16
|
+
subject_type_00003:
|
17
|
+
id: 3
|
18
|
+
name: object
|
19
|
+
display_name: Object
|
20
|
+
note:
|
21
|
+
position: 3
|
22
|
+
|
23
|
+
subject_type_00004:
|
24
|
+
id: 4
|
25
|
+
name: place
|
26
|
+
display_name: Place
|
27
|
+
note:
|
28
|
+
position: 4
|
29
|
+
|
30
|
+
# == Schema Information
|
31
|
+
#
|
32
|
+
# Table name: subject_types
|
33
|
+
#
|
34
|
+
# id :integer not null, primary key
|
35
|
+
# name :string(255) not null
|
36
|
+
# display_name :text
|
37
|
+
# note :text
|
38
|
+
# position :integer
|
39
|
+
# created_at :datetime not null
|
40
|
+
# updated_at :datetime not null
|
41
|
+
#
|
42
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
+
|
3
|
+
admin:
|
4
|
+
user_id: 1
|
5
|
+
role_id: 4
|
6
|
+
|
7
|
+
librarian1:
|
8
|
+
user_id: 2
|
9
|
+
role_id: 3
|
10
|
+
|
11
|
+
user1:
|
12
|
+
user_id: 3
|
13
|
+
role_id: 2
|
14
|
+
|
15
|
+
librarian2:
|
16
|
+
user_id: 4
|
17
|
+
role_id: 3
|
18
|
+
|
19
|
+
user2:
|
20
|
+
user_id: 5
|
21
|
+
role_id: 2
|
22
|
+
|
23
|
+
user3:
|
24
|
+
user_id: 6
|
25
|
+
role_id: 2
|
26
|
+
|
27
|
+
user4:
|
28
|
+
user_id: 7
|
29
|
+
role_id: 2
|
30
|
+
|
31
|
+
# == Schema Information
|
32
|
+
#
|
33
|
+
# Table name: user_has_roles
|
34
|
+
#
|
35
|
+
# id :integer not null, primary key
|
36
|
+
# user_id :integer
|
37
|
+
# role_id :integer
|
38
|
+
# created_at :datetime
|
39
|
+
# updated_at :datetime
|
40
|
+
#
|
41
|
+
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
admin:
|
3
|
+
updated_at: 2008-05-31 13:16:30.163731 +09:00
|
4
|
+
encrypted_password: $2a$10$vHohD1WflnTIqAa8zMkF9evwAgIZRw3XuR4d3bi29M.jph/MB/AJi
|
5
|
+
id: 1
|
6
|
+
username: admin
|
7
|
+
email: tanabe@kamata.lib.teu.ac.jp
|
8
|
+
created_at: 2007-11-19 16:58:32.111941 +09:00
|
9
|
+
librarian1:
|
10
|
+
updated_at: 2008-05-31 12:41:16.337474 +09:00
|
11
|
+
encrypted_password: $2a$10$9O2VuTccN4gHq36ARg0QReSrb1D7WrBBhZZ759RM9moHbB0W5zCzS
|
12
|
+
id: 2
|
13
|
+
username: librarian1
|
14
|
+
email: librarian1@kamata.lib.teu.ac.jp
|
15
|
+
created_at: 2007-11-19 16:58:33.172441 +09:00
|
16
|
+
user1:
|
17
|
+
updated_at: 2008-05-31 13:02:25.101261 +09:00
|
18
|
+
encrypted_password: $2a$10$JthS59A0BNkDOoFpCXM0V.GhhffKaoWKbzpPahYp/vTFrOyM7h/uW
|
19
|
+
id: 3
|
20
|
+
username: user1
|
21
|
+
email: user1@kamata.lib.teu.ac.jp
|
22
|
+
created_at: 2007-11-19 16:58:34.637413 +09:00
|
23
|
+
librarian2:
|
24
|
+
updated_at: 2008-05-31 12:42:23.340575 +09:00
|
25
|
+
encrypted_password: $2a$10$YmmTGrYQ1Ir6oc7wXnp.GuNeO1eYLoP3sv8wMSIrTdaGw2BPwRrpS
|
26
|
+
id: 4
|
27
|
+
username: librarian2
|
28
|
+
email: librarian2@library.example.jp
|
29
|
+
created_at: 2008-01-18 12:24:04.222344 +09:00
|
30
|
+
user2:
|
31
|
+
updated_at: 2008-05-31 12:42:44.711117 +09:00
|
32
|
+
encrypted_password: $2a$10$i7UjJhLVrJM/J7qaTwW39OXw1NiwowUEbtNHVDV0sqMLjX9.UO9ca
|
33
|
+
id: 5
|
34
|
+
username: user2
|
35
|
+
email: user2@library.example.jp
|
36
|
+
created_at: 2008-01-18 13:29:06.922728 +09:00
|
37
|
+
user3:
|
38
|
+
updated_at: 2008-05-31 13:02:25.101261 +09:00
|
39
|
+
encrypted_password: cc53de0c2d9a1a228daa9a673ec824473747e17507a6c3c4f7e5eff8821f531d4b9e23616b3ddc66fe17006b2298a556fbd567ac080e87f00f37eef8cee6c417
|
40
|
+
id: 6
|
41
|
+
username: user3
|
42
|
+
email: user3@kamata.lib.teu.ac.jp
|
43
|
+
created_at: 2007-11-19 16:58:34.637413 +09:00
|
44
|
+
user4:
|
45
|
+
updated_at: 2008-05-31 13:02:25.101261 +09:00
|
46
|
+
encrypted_password: cc53de0c2d9a1a228daa9a673ec824473747e17507a6c3c4f7e5eff8821f531d4b9e23616b3ddc66fe17006b2298a556fbd567ac080e87f00f37eef8cee6c417
|
47
|
+
id: 7
|
48
|
+
username: user4
|
49
|
+
email: user4@kamata.lib.teu.ac.jp
|
50
|
+
created_at: 2007-11-19 16:58:34.637413 +09:00
|
51
|
+
locked_at: <%= 1.day.ago %>
|
@@ -0,0 +1,195 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe LocSearch do
|
4
|
+
fixtures :all
|
5
|
+
|
6
|
+
context ".import_from_sru_response" do
|
7
|
+
it "should create a valid manifestation", :vcr => true do
|
8
|
+
manifestation = LocSearch.import_from_sru_response( "2007012024" )
|
9
|
+
expect( manifestation.manifestation_identifier ).to eq "14780655"
|
10
|
+
expect( manifestation.original_title ).to eq "Everything is miscellaneous : the power of the new digital disorder"
|
11
|
+
expect( manifestation.manifestation_content_type.name ).to eq "text"
|
12
|
+
expect( manifestation.carrier_type.name ).to eq "print"
|
13
|
+
expect( manifestation.publishers.size ).to eq 1
|
14
|
+
expect( manifestation.publishers.first.full_name ).to eq "Times Books"
|
15
|
+
expect( manifestation.publication_place ).to eq "New York"
|
16
|
+
expect( manifestation.creators.size ).to eq 1
|
17
|
+
expect( manifestation.creators.first.agent_type.name ).to eq "Person"
|
18
|
+
expect( manifestation.creators.first.full_name ).to eq "Weinberger, David, 1950-"
|
19
|
+
expect( manifestation.edition_string ).to eq "1st ed."
|
20
|
+
expect( manifestation.language.iso_639_2 ).to eq "eng"
|
21
|
+
expect( manifestation.date_of_publication.year ).to eq 2007
|
22
|
+
expect( manifestation.start_page ).to eq 1
|
23
|
+
expect( manifestation.end_page ).to eq 277
|
24
|
+
expect( manifestation.height ).to eq 25
|
25
|
+
expect( manifestation.note ).to eq "Includes bibliographical references (p. [235]-257) and index."
|
26
|
+
expect( manifestation.description ).to eq "Philosopher Weinberger shows how the digital revolution is radically changing the way we make sense of our lives. Human beings constantly collect, label, and organize data--but today, the shift from the physical to the digital is mixing, burning, and ripping our lives apart. In the past, everything had its one place--the physical world demanded it--but now everything has its places: multiple categories, multiple shelves. Everything is suddenly miscellaneous. Weinberger charts the new principles of digital order that are remaking business, education, politics, science, and culture. He examines how Rand McNally decides what information not to include in a physical map (and why Google Earth is winning that battle), how Staples stores emulate online shopping to increase sales, why your children's teachers will stop having them memorize facts, and how the shift to digital music stands as the model for the future.--From publisher description.\nFrom A to Z, Everything Is Miscellaneous will completely reshape the way you think - and what you know - about the world. Includes information on alphabetical order, Amaxon.com, animals, Aristotle, authority, Bettmann Archive, blogs (weblogs), books, broadcasting, British Broadcasting Corporation (BBC), business, card catalog, categories and categorization, clusters, companies, Colon Classification, conversation, Melvil Dewey, Dewey Decimal Classification system, Encyclopaedia Britannica, encyclopedia, essentialism, experts, faceted classification system, first order of order, Flickr.com, Google, Great Books of the Western World, ancient Greeks, health and medical information, identifiers, index, inventory tracking, knowledge, labels, leaf and leaves, libraries, Library of Congress, links, Carolus Linnaeus, lumping and splitting, maps and mapping, marketing, meaning, metadata, multiple listing services (MLS), names of people, neutrality or neutral point of view, New York Public Library, Online Computer Library Center (OCLC), order and organization, people, physical space, everything having place, Plato, race, S.R. Ranganathan, Eleanor Rosch, Joshua Schacter, science, second order of order, simplicity, social constructivism, social knowledge, social networks, sorting, species, standardization, tags, taxonomies, third order of roder, topical categorization, tree, Uniform Product Code (UPC), users, Jimmy Wales, web, Wikipedia, etc."
|
27
|
+
expect( manifestation.statement_of_responsibility ).to eq "David Weinberger."
|
28
|
+
expect( manifestation.subjects.size ).to eq 6
|
29
|
+
expect( manifestation.subjects.first.subject_heading_type.name ).to eq "lcsh"
|
30
|
+
expect( manifestation.subjects.first.subject_type.name ).to eq "concept"
|
31
|
+
RSpec.describe manifestation.subjects.collect( &:term ) do
|
32
|
+
it { is_expected.to include( "Knowledge management" ) }
|
33
|
+
it { is_expected.to include( "Information technology--Management" ) }
|
34
|
+
it { is_expected.to include( "Information technology--Social aspects" ) }
|
35
|
+
it { is_expected.to include( "Personal information management" ) }
|
36
|
+
it { is_expected.to include( "Information resources management" ) }
|
37
|
+
it { is_expected.to include( "Order" ) }
|
38
|
+
end
|
39
|
+
expect( manifestation.classifications.size ).to eq 1
|
40
|
+
classification = manifestation.classifications.first
|
41
|
+
expect( classification.classification_type.name ).to eq "ddc"
|
42
|
+
expect( classification.category ).to eq "303.48"
|
43
|
+
expect( manifestation.identifier_contents("isbn").first ).to eq "9780805080438"
|
44
|
+
expect( manifestation.identifier_contents("lccn").first ).to eq "2007012024"
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should parse title information properly", :vcr => true do
|
48
|
+
manifestation = LocSearch.import_from_sru_response( "2012532441" )
|
49
|
+
expect( manifestation.original_title ).to eq "The data journalism handbook"
|
50
|
+
expect( manifestation.title_alternative ).to eq "How journalists can use data to improve the news"
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should distinguish title information with subject", :vcr => true do
|
54
|
+
m = LocSearch.import_from_sru_response( "2008273186" )
|
55
|
+
expect( m.original_title ).to eq "Flexible Rails : Flex 3 on Rails 2"
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should create multiple series_statements", :vcr => true do
|
59
|
+
m = LocSearch.import_from_sru_response( "2012471967" )
|
60
|
+
expect( m.series_statements.size ).to eq 2
|
61
|
+
RSpec.describe m.series_statements.collect( &:original_title ) do
|
62
|
+
it { is_expected.to include( "Pragmatic programmers" ) }
|
63
|
+
it { is_expected.to include( "Facets of Ruby series" ) }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should create lcsh subjects only", :vcr => true do
|
68
|
+
m = LocSearch.import_from_sru_response( "2011281911" )
|
69
|
+
expect( m.subjects.size ).to eq 2
|
70
|
+
RSpec.describe m.subjects.collect( &:term ) do
|
71
|
+
it { is_expected.to include( "Computer software--Development" ) }
|
72
|
+
it { is_expected.to include( "Ruby (Computer program language)" ) }
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should support name and title subjects", :vcr => true do
|
77
|
+
m = LocSearch.import_from_sru_response( "2013433146" )
|
78
|
+
expect( m.subjects.size ).to eq 3
|
79
|
+
RSpec.describe m.subjects.collect( &:term ) do
|
80
|
+
it { is_expected.to include( "Montgomery, L. M. (Lucy Maud), 1874-1942. Anne of Green Gables" ) }
|
81
|
+
it { is_expected.to include( "Montgomery, L. M. (Lucy Maud), 1874-1942--Criticism and interpretation" ) }
|
82
|
+
it { is_expected.to include( "Montgomery, L. M. (Lucy Maud), 1874-1942--Influence" ) }
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should import note fields", :vcr => true do
|
87
|
+
m = LocSearch.import_from_sru_response( "2010526151" )
|
88
|
+
expect( m.note ).not_to be_nil
|
89
|
+
expect( m.note ).not_to be_empty
|
90
|
+
expect( m.note ).to eq %Q["This is a book about the design of user interfaces for search and discovery"--Pref.;\n"January 2010"--T.p. verso.;\nIncludes bibliographical references and index.]
|
91
|
+
end
|
92
|
+
|
93
|
+
it "should import publication year", :vcr => true do
|
94
|
+
m = LocSearch.import_from_sru_response( "2001315134" )
|
95
|
+
expect( m.date_of_publication.year ).to eq 2000
|
96
|
+
end
|
97
|
+
|
98
|
+
it "should import e-resource", :vcr => true do
|
99
|
+
m = LocSearch.import_from_sru_response( "2005568297" )
|
100
|
+
expect( m.carrier_type ).to eq CarrierType.where( :name => "file" ).first
|
101
|
+
expect( m.access_address ).to eq "http://portal.acm.org/dl.cfm"
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should import audio book", :vcr => true do
|
105
|
+
m = LocSearch.import_from_sru_response( "2007576782" ) # RDA metadata
|
106
|
+
expect( m.manifestation_content_type ).to eq ContentType.where( :name => "audio" ).first
|
107
|
+
pending "carrier type should be changed. cf. next-l/enju_leaf#300"
|
108
|
+
expect( m.carrier_type ).to eq CarrierType.where( :name => "CD" ).first
|
109
|
+
end
|
110
|
+
|
111
|
+
it "should import video publication", :vcr => true do
|
112
|
+
m = LocSearch.import_from_sru_response( "2013602064" )
|
113
|
+
expect( m.manifestation_content_type ).to eq ContentType.where( :name => "video" ).first
|
114
|
+
pending "carrier type should be changed. cf. next-l/enju_leaf#300"
|
115
|
+
expect( m.carrier_type ).to eq CarrierType.where( :name => "DVD" ).first
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should import serial", :vcr => true do
|
119
|
+
m = LocSearch.import_from_sru_response( "00200486" )
|
120
|
+
expect( m.original_title ).to eq "Science and technology of advanced materials"
|
121
|
+
expect( m.periodical ).to be_truthy
|
122
|
+
expect( m.identifier_contents( :issn ).first ).to eq "14686996"
|
123
|
+
expect( m.identifier_contents( :issn_l ).first ).to eq "14686996"
|
124
|
+
expect( m.frequency.name ).to eq "bimonthly"
|
125
|
+
series_statement = m.series_statements.first
|
126
|
+
expect( series_statement.original_title ).to eq "Science and technology of advanced materials"
|
127
|
+
expect( series_statement.series_master ).to be_truthy
|
128
|
+
end
|
129
|
+
it "should import another serial", :vcr => true do
|
130
|
+
m = LocSearch.import_from_sru_response( "88651712" )
|
131
|
+
expect( m.original_title ).to eq "Superconductor science & technology"
|
132
|
+
expect( m.title_alternative ).to eq "Supercond. sci. technol ; Superconductor science and technology"
|
133
|
+
expect( m.periodical ).to be_truthy
|
134
|
+
expect( m.identifier_contents( :issn ).first ).to eq "09532048"
|
135
|
+
expect( m.identifier_contents( :issn_l ).first ).to eq "09532048"
|
136
|
+
expect( m.frequency.name ).to eq "monthly"
|
137
|
+
series_statement = m.series_statements.first
|
138
|
+
expect( series_statement.original_title ).to eq m.original_title
|
139
|
+
expect( series_statement.title_alternative ).to eq m.title_alternative
|
140
|
+
expect( series_statement.series_master ).to be_truthy
|
141
|
+
end
|
142
|
+
|
143
|
+
it "should import a manifestation that has invalid classification", :vcr => true do
|
144
|
+
m = LocSearch.import_from_sru_response( "2014381788" )
|
145
|
+
expect( m ).to be_valid
|
146
|
+
expect( m.classifications ).to be_empty
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
context ".search", :vcr => true do
|
151
|
+
it "should return a search result", :vcr => true do
|
152
|
+
result = LocSearch.search( 'library' )
|
153
|
+
expect( result[:total_entries] ).to eq 10000
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
context "::ModsRecord" do
|
158
|
+
it "should parse MODS metadata", :vcr => true do
|
159
|
+
results = LocSearch.search( "bath.lccn=2007012024" )
|
160
|
+
metadata = results[ :items ].first
|
161
|
+
expect( metadata.lccn ).to eq "2007012024"
|
162
|
+
expect( metadata.title ).to eq "Everything is miscellaneous : the power of the new digital disorder"
|
163
|
+
expect( metadata.creator ).to eq "David Weinberger."
|
164
|
+
expect( metadata.pubyear ).to eq "2007"
|
165
|
+
expect( metadata.publisher ).to eq "Times Books"
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
context ".make_sru_request_uri" do
|
170
|
+
it "should construct a valid uri" do
|
171
|
+
url = LocSearch.make_sru_request_uri( "test" )
|
172
|
+
uri = URI.parse( url )
|
173
|
+
expect( Hash[uri.query.split(/\&/).collect{|e| e.split(/=/) }] ).to eq( {
|
174
|
+
"query" => "test",
|
175
|
+
"version" => "1.1",
|
176
|
+
"operation" => "searchRetrieve",
|
177
|
+
"maximumRecords" => "10",
|
178
|
+
"recordSchema" => "mods"
|
179
|
+
} )
|
180
|
+
end
|
181
|
+
|
182
|
+
it "should support pagination" do
|
183
|
+
url = LocSearch.make_sru_request_uri( "test", :page => 2 )
|
184
|
+
uri = URI.parse( url )
|
185
|
+
expect( Hash[uri.query.split(/\&/).collect{|e| e.split(/=/) }] ).to eq( {
|
186
|
+
"query" => "test",
|
187
|
+
"version" => "1.1",
|
188
|
+
"operation" => "searchRetrieve",
|
189
|
+
"maximumRecords" => "10",
|
190
|
+
"recordSchema" => "mods",
|
191
|
+
"startRecord" => "11",
|
192
|
+
} )
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require 'spec_helper'
|
4
|
+
require File.expand_path("../../config/environment", __FILE__)
|
5
|
+
require 'rspec/rails'
|
6
|
+
|
7
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
8
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
9
|
+
# run as spec files by default. This means that files in spec/support that end
|
10
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
11
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
12
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
13
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
14
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
15
|
+
|
16
|
+
# Checks for pending migrations before tests are run.
|
17
|
+
# If you are not using ActiveRecord, you can remove this line.
|
18
|
+
ActiveRecord::Migration.maintain_test_schema!
|
19
|
+
|
20
|
+
RSpec.configure do |config|
|
21
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
22
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
23
|
+
|
24
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
25
|
+
# examples within a transaction, remove the following line or assign false
|
26
|
+
# instead of true.
|
27
|
+
config.use_transactional_fixtures = true
|
28
|
+
|
29
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
30
|
+
# based on their file location, for example enabling you to call `get` and
|
31
|
+
# `post` in specs under `spec/controllers`.
|
32
|
+
#
|
33
|
+
# You can disable this behaviour by removing the line below, and instead
|
34
|
+
# explicitly tag your specs with their type, e.g.:
|
35
|
+
#
|
36
|
+
# RSpec.describe UsersController, :type => :controller do
|
37
|
+
# # ...
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
# The different available types are documented in the features, such as in
|
41
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
42
|
+
config.infer_spec_type_from_file_location!
|
43
|
+
end
|