enju_ndl 0.1.0.pre11 → 0.1.0.pre12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/enju_ndl/ndl_search.rb +7 -12
  3. data/lib/enju_ndl/version.rb +1 -1
  4. data/spec/cassette_library/NdlBook/import/should_get_series_title.yml +6 -6
  5. data/spec/cassette_library/NdlBook/import/should_get_volume_number.yml +8 -8
  6. data/spec/cassette_library/NdlBook/import/should_import_audio_cd.yml +5 -5
  7. data/spec/cassette_library/NdlBook/import/should_import_bibliographic_record.yml +5 -5
  8. data/spec/cassette_library/NdlBook/import/should_import_bibliographic_record_that_does_not_have_any_classifications.yml +6 -6
  9. data/spec/cassette_library/NdlBook/import/should_import_pud_date_is_nil.yml +6 -6
  10. data/spec/cassette_library/NdlBook/import/should_import_series_statement.yml +5 -5
  11. data/spec/cassette_library/NdlBook/import/should_import_series_statement_if_the_resource_is_periodical.yml +161 -190
  12. data/spec/cassette_library/NdlBook/import/should_import_title_alternative.yml +163 -165
  13. data/spec/cassette_library/NdlBook/import/should_import_url_contain_whitespace.yml +151 -154
  14. data/spec/cassette_library/NdlBook/import/should_import_video_dvd.yml +6 -6
  15. data/spec/cassette_library/NdlBook/import/should_import_volume_number_string.yml +131 -134
  16. data/spec/cassette_library/NdlBook/import/should_not_get_series_title_if_book_has_not_series_title.yml +6 -6
  17. data/spec/cassette_library/NdlBook/import/should_not_get_volume_number_if_book_has_not_volume.yml +6 -6
  18. data/spec/cassette_library/NdlBook/search/should_not_distinguish_double_byte_space_from_one-byte_space_in_a_query.yml +208 -198
  19. data/spec/cassette_library/NdlBook/search/should_search_bibliographic_record.yml +34 -36
  20. data/spec/cassette_library/NdlBooksController/GET_index/should_get_index.yml +133 -133
  21. data/spec/cassette_library/NdlBooksController/POST_create/should_create_a_bibliographic_record_if_nbn_is_set.yml +7 -7
  22. data/spec/cassette_library/NdlBooksController/POST_create/should_not_create_a_bibliographic_record_if_nbn_is_not_set.yml +6 -6
  23. data/spec/cassette_library/Question/should_respond_to_search_crd.yml +456 -456
  24. data/spec/dummy/db/test.sqlite3 +0 -0
  25. data/spec/models/manifestation_spec.rb +1 -1
  26. data/spec/models/ndl_book_spec.rb +1 -1
  27. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b70b71f357354093947125b3203ff08f6581d0c9
4
- data.tar.gz: 96e1a7624061605088bfbfba287ed681bd2d1f74
3
+ metadata.gz: b9724c8694811e438179387d1234ddfa7b2410cc
4
+ data.tar.gz: 4a73dc043ecfe6929a967e3a4dad1077d619549d
5
5
  SHA512:
6
- metadata.gz: 098c501cc821a2c5f4c8f6204e236bee54053885f5894b32baf8dba9dc3fc770ab57b40875461eee23f1f57be54e635335a843c878c01bd64d29849cb6776563
7
- data.tar.gz: ed41bea1983361807bce153d0be357a5565df5c65f61e41a5a1c2521ff1dfd6dc0d4c30e58fd570f579952a433750ffa8953bb2ab763fdc5104f1df35fc5ce2d
6
+ metadata.gz: 07ee6cd50bcb9ed88c9d8c4530ad728f3ad8b975b3ab57aa10eb8d2de8074c762a37a81ec30e818e1b7e6987da94ab9e7bc7006fae44c1d74392b84b96154e9f
7
+ data.tar.gz: 6da4ded4fa6be71d972cfde1e7bc60f022e9f0ae7f7ad7cc58094759d7bf445ce1e190a082c5b74690ded92defe1540b59204c1cfa05eca3c9eafe5b7004f7ba
@@ -6,10 +6,11 @@ module EnjuNdl
6
6
  end
7
7
 
8
8
  module ClassMethods
9
- def import_isbn(isbn)
10
- return nil unless isbn
11
- lisbn = Lisbn.new(isbn)
12
- raise EnjuNdl::InvalidIsbn unless lisbn.valid?
9
+ def import_from_ndl_search(options)
10
+ #if options[:isbn]
11
+ lisbn = Lisbn.new(options[:isbn])
12
+ raise EnjuNdl::InvalidIsbn unless lisbn.valid?
13
+ #end
13
14
 
14
15
  manifestation = Manifestation.find_by_isbn(lisbn.isbn)
15
16
  return manifestation if manifestation
@@ -110,7 +111,7 @@ module EnjuNdl
110
111
  manifestation.manifestation_content_type = content_type if content_type
111
112
  if manifestation.save
112
113
  manifestation.publishers << publisher_patrons
113
- create_frbr_instance(doc, manifestation)
114
+ create_additional_attributes(doc, manifestation)
114
115
  create_series_statement(doc, manifestation)
115
116
  end
116
117
  end
@@ -119,13 +120,7 @@ module EnjuNdl
119
120
  return manifestation
120
121
  end
121
122
 
122
- def import_isbn!(isbn)
123
- manifestation = import_isbn(isbn)
124
- manifestation.save!
125
- manifestation
126
- end
127
-
128
- def create_frbr_instance(doc, manifestation)
123
+ def create_additional_attributes(doc, manifestation)
129
124
  title = get_title(doc)
130
125
  creators = get_creators(doc).uniq
131
126
  language = get_language(doc)
@@ -1,3 +1,3 @@
1
1
  module EnjuNdl
2
- VERSION = "0.1.0.pre11"
2
+ VERSION = "0.1.0.pre12"
3
3
  end
@@ -19,7 +19,7 @@ http_interactions:
19
19
  message: OK
20
20
  headers:
21
21
  date:
22
- - Mon, 25 Feb 2013 06:47:18 GMT
22
+ - Wed, 10 Apr 2013 02:43:51 GMT
23
23
  server:
24
24
  - Apache
25
25
  x-powered-by:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  x-ua-compatible:
30
30
  - IE=Edge,chrome=1
31
31
  x-runtime:
32
- - '0.190220'
32
+ - '0.222430'
33
33
  cache-control:
34
34
  - max-age=0, private, must-revalidate
35
35
  status:
@@ -37,9 +37,9 @@ http_interactions:
37
37
  content-type:
38
38
  - application/xml; charset=utf-8
39
39
  set-cookie:
40
- - _front_session_id=0f10727f315c811e11ee7ded1e23f80c; domain=.iss.ndl.go.jp;
41
- path=/; expires=Mon, 25-Feb-2013 07:47:18 GMT; HttpOnly
42
- - serverid=1101; path=/
40
+ - _front_session_id=c074feccdbb7d54773865f76e7ac53ca; domain=.iss.ndl.go.jp;
41
+ path=/; expires=Wed, 10-Apr-2013 03:43:51 GMT; HttpOnly
42
+ - serverid=1102; path=/
43
43
  vary:
44
44
  - Accept-Encoding,User-Agent
45
45
  content-encoding:
@@ -111,5 +111,5 @@ http_interactions:
111
111
  dHA6Ly9pZC5uZGwuZ28uanAvYmliLzAwMDAwODE4MDAwMyIvPgogICAgPC9p
112
112
  dGVtPgogIDwvY2hhbm5lbD4KPC9yc3M+Cg==
113
113
  http_version: '1.0'
114
- recorded_at: Mon, 25 Feb 2013 06:47:17 GMT
114
+ recorded_at: Wed, 10 Apr 2013 02:43:52 GMT
115
115
  recorded_with: VCR 2.4.0
@@ -19,17 +19,17 @@ http_interactions:
19
19
  message: OK
20
20
  headers:
21
21
  date:
22
- - Mon, 25 Feb 2013 06:47:18 GMT
22
+ - Wed, 10 Apr 2013 02:43:51 GMT
23
23
  server:
24
24
  - Apache
25
25
  x-powered-by:
26
26
  - Phusion Passenger (mod_rails/mod_rack) 2.2.15
27
27
  etag:
28
- - '"a8cc1dda7552728fef69d063d262e21b"'
28
+ - '"867921384dfb763ce72815f16b2b5dc1"'
29
29
  x-ua-compatible:
30
30
  - IE=Edge,chrome=1
31
31
  x-runtime:
32
- - '0.196298'
32
+ - '0.259952'
33
33
  cache-control:
34
34
  - max-age=0, private, must-revalidate
35
35
  status:
@@ -37,15 +37,15 @@ http_interactions:
37
37
  content-type:
38
38
  - application/xml; charset=utf-8
39
39
  set-cookie:
40
- - _front_session_id=d49bab14d134c6ce1eae8da808b2fe07; domain=.iss.ndl.go.jp;
41
- path=/; expires=Mon, 25-Feb-2013 07:47:18 GMT; HttpOnly
40
+ - _front_session_id=c0a313bb37c8a017568b09ab18c626cd; domain=.iss.ndl.go.jp;
41
+ path=/; expires=Wed, 10-Apr-2013 03:43:51 GMT; HttpOnly
42
42
  - serverid=1101; path=/
43
43
  vary:
44
44
  - Accept-Encoding,User-Agent
45
45
  content-encoding:
46
46
  - gzip
47
47
  content-length:
48
- - '1173'
48
+ - '1174'
49
49
  connection:
50
50
  - close
51
51
  body:
@@ -85,7 +85,7 @@ http_interactions:
85
85
  5Yay5pa55LiBIFvokZddLDwvYXV0aG9yPgogICAgICA8Y2F0ZWdvcnk+5pys
86
86
  PC9jYXRlZ29yeT4KICAgICAgPGd1aWQgaXNQZXJtYUxpbms9InRydWUiPmh0
87
87
  dHA6Ly9pc3MubmRsLmdvLmpwL2Jvb2tzL1IxMDAwMDAwMDItSTAyMzU5MTUy
88
- My0wMDwvZ3VpZD4KICAgICAgPHB1YkRhdGU+RnJpLCAwMyBBdWcgMjAxMiAw
88
+ My0wMDwvZ3VpZD4KICAgICAgPHB1YkRhdGU+RnJpLCAyOSBNYXIgMjAxMyAw
89
89
  OTowMDowMCArMDkwMDwvcHViRGF0ZT4KICAgICAgPGRjOnRpdGxlPuWkqeWc
90
90
  sOaYjuWvnzwvZGM6dGl0bGU+CiAgICAgIDxkY25kbDp0aXRsZVRyYW5zY3Jp
91
91
  cHRpb24+44OG44Oz44OBIOODoeOCpOOCteODhDwvZGNuZGw6dGl0bGVUcmFu
@@ -112,5 +112,5 @@ http_interactions:
112
112
  OnJlc291cmNlPSJodHRwOi8vaWQubmRsLmdvLmpwL2JpYi8wMjM1OTE1MjMi
113
113
  Lz4KICAgIDwvaXRlbT4KICA8L2NoYW5uZWw+CjwvcnNzPgo=
114
114
  http_version: '1.0'
115
- recorded_at: Mon, 25 Feb 2013 06:47:16 GMT
115
+ recorded_at: Wed, 10 Apr 2013 02:43:51 GMT
116
116
  recorded_with: VCR 2.4.0
@@ -19,7 +19,7 @@ http_interactions:
19
19
  message: OK
20
20
  headers:
21
21
  date:
22
- - Mon, 25 Feb 2013 06:47:17 GMT
22
+ - Wed, 10 Apr 2013 02:43:50 GMT
23
23
  server:
24
24
  - Apache
25
25
  x-powered-by:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  x-ua-compatible:
30
30
  - IE=Edge,chrome=1
31
31
  x-runtime:
32
- - '0.094809'
32
+ - '0.078273'
33
33
  cache-control:
34
34
  - max-age=0, private, must-revalidate
35
35
  status:
@@ -37,8 +37,8 @@ http_interactions:
37
37
  content-type:
38
38
  - application/xml; charset=utf-8
39
39
  set-cookie:
40
- - _front_session_id=c1bc9f375c5bd5296418e9b052033817; domain=.iss.ndl.go.jp;
41
- path=/; expires=Mon, 25-Feb-2013 07:47:17 GMT; HttpOnly
40
+ - _front_session_id=1ed4069b623d21e99ff9b76ebd9b2cac; domain=.iss.ndl.go.jp;
41
+ path=/; expires=Wed, 10-Apr-2013 03:43:50 GMT; HttpOnly
42
42
  - serverid=1101; path=/
43
43
  vary:
44
44
  - Accept-Encoding,User-Agent
@@ -158,5 +158,5 @@ http_interactions:
158
158
  PjE8L3JlY29yZFBvc2l0aW9uPgogICAgPC9yZWNvcmQ+CiAgPC9yZWNvcmRz
159
159
  Pgo8L3NlYXJjaFJldHJpZXZlUmVzcG9uc2U+Cg==
160
160
  http_version: '1.0'
161
- recorded_at: Mon, 25 Feb 2013 06:47:15 GMT
161
+ recorded_at: Wed, 10 Apr 2013 02:43:50 GMT
162
162
  recorded_with: VCR 2.4.0
@@ -19,7 +19,7 @@ http_interactions:
19
19
  message: OK
20
20
  headers:
21
21
  date:
22
- - Mon, 25 Feb 2013 06:46:47 GMT
22
+ - Wed, 10 Apr 2013 02:43:46 GMT
23
23
  server:
24
24
  - Apache
25
25
  x-powered-by:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  x-ua-compatible:
30
30
  - IE=Edge,chrome=1
31
31
  x-runtime:
32
- - '0.159132'
32
+ - '0.370741'
33
33
  cache-control:
34
34
  - max-age=0, private, must-revalidate
35
35
  status:
@@ -37,8 +37,8 @@ http_interactions:
37
37
  content-type:
38
38
  - application/xml; charset=utf-8
39
39
  set-cookie:
40
- - _front_session_id=f1ac831bb6cd0e0cdb7f7570faf4162b; domain=.iss.ndl.go.jp;
41
- path=/; expires=Mon, 25-Feb-2013 07:46:47 GMT; HttpOnly
40
+ - _front_session_id=63bb6ebec9ef5c129f360f58269523e9; domain=.iss.ndl.go.jp;
41
+ path=/; expires=Wed, 10-Apr-2013 03:43:46 GMT; HttpOnly
42
42
  - serverid=1105; path=/
43
43
  vary:
44
44
  - Accept-Encoding,User-Agent
@@ -192,5 +192,5 @@ http_interactions:
192
192
  b24+MTwvcmVjb3JkUG9zaXRpb24+CiAgICA8L3JlY29yZD4KICA8L3JlY29y
193
193
  ZHM+Cjwvc2VhcmNoUmV0cmlldmVSZXNwb25zZT4K
194
194
  http_version: '1.0'
195
- recorded_at: Mon, 25 Feb 2013 06:46:46 GMT
195
+ recorded_at: Wed, 10 Apr 2013 02:43:47 GMT
196
196
  recorded_with: VCR 2.4.0
@@ -19,7 +19,7 @@ http_interactions:
19
19
  message: OK
20
20
  headers:
21
21
  date:
22
- - Mon, 25 Feb 2013 06:46:48 GMT
22
+ - Wed, 10 Apr 2013 02:43:47 GMT
23
23
  server:
24
24
  - Apache
25
25
  x-powered-by:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  x-ua-compatible:
30
30
  - IE=Edge,chrome=1
31
31
  x-runtime:
32
- - '0.276558'
32
+ - '0.226711'
33
33
  cache-control:
34
34
  - max-age=0, private, must-revalidate
35
35
  status:
@@ -37,9 +37,9 @@ http_interactions:
37
37
  content-type:
38
38
  - application/xml; charset=utf-8
39
39
  set-cookie:
40
- - _front_session_id=2e0285a85e3a0159bacfa0941f6051f3; domain=.iss.ndl.go.jp;
41
- path=/; expires=Mon, 25-Feb-2013 07:46:48 GMT; HttpOnly
42
- - serverid=1101; path=/
40
+ - _front_session_id=2104556fe84eebb96957ebecc3d28056; domain=.iss.ndl.go.jp;
41
+ path=/; expires=Wed, 10-Apr-2013 03:43:47 GMT; HttpOnly
42
+ - serverid=1102; path=/
43
43
  vary:
44
44
  - Accept-Encoding,User-Agent
45
45
  content-encoding:
@@ -184,5 +184,5 @@ http_interactions:
184
184
  PjE8L3JlY29yZFBvc2l0aW9uPgogICAgPC9yZWNvcmQ+CiAgPC9yZWNvcmRz
185
185
  Pgo8L3NlYXJjaFJldHJpZXZlUmVzcG9uc2U+Cg==
186
186
  http_version: '1.0'
187
- recorded_at: Mon, 25 Feb 2013 06:46:46 GMT
187
+ recorded_at: Wed, 10 Apr 2013 02:43:47 GMT
188
188
  recorded_with: VCR 2.4.0
@@ -19,7 +19,7 @@ http_interactions:
19
19
  message: OK
20
20
  headers:
21
21
  date:
22
- - Mon, 25 Feb 2013 06:47:07 GMT
22
+ - Wed, 10 Apr 2013 02:43:49 GMT
23
23
  server:
24
24
  - Apache
25
25
  x-powered-by:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  x-ua-compatible:
30
30
  - IE=Edge,chrome=1
31
31
  x-runtime:
32
- - '0.356443'
32
+ - '0.157770'
33
33
  cache-control:
34
34
  - max-age=0, private, must-revalidate
35
35
  status:
@@ -37,9 +37,9 @@ http_interactions:
37
37
  content-type:
38
38
  - application/xml; charset=utf-8
39
39
  set-cookie:
40
- - _front_session_id=36b2e073bd779abc0eb253cb71acee09; domain=.iss.ndl.go.jp;
41
- path=/; expires=Mon, 25-Feb-2013 07:47:16 GMT; HttpOnly
42
- - serverid=1102; path=/
40
+ - _front_session_id=b9eb82b4ffc889411744b7b889e40ab2; domain=.iss.ndl.go.jp;
41
+ path=/; expires=Wed, 10-Apr-2013 03:43:50 GMT; HttpOnly
42
+ - serverid=1101; path=/
43
43
  vary:
44
44
  - Accept-Encoding,User-Agent
45
45
  content-encoding:
@@ -140,5 +140,5 @@ http_interactions:
140
140
  dGlvbj4KICAgIDwvcmVjb3JkPgogIDwvcmVjb3Jkcz4KPC9zZWFyY2hSZXRy
141
141
  aWV2ZVJlc3BvbnNlPgo=
142
142
  http_version: '1.0'
143
- recorded_at: Mon, 25 Feb 2013 06:47:14 GMT
143
+ recorded_at: Wed, 10 Apr 2013 02:43:50 GMT
144
144
  recorded_with: VCR 2.4.0
@@ -19,7 +19,7 @@ http_interactions:
19
19
  message: OK
20
20
  headers:
21
21
  date:
22
- - Mon, 25 Feb 2013 06:46:50 GMT
22
+ - Wed, 10 Apr 2013 02:43:48 GMT
23
23
  server:
24
24
  - Apache
25
25
  x-powered-by:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  x-ua-compatible:
30
30
  - IE=Edge,chrome=1
31
31
  x-runtime:
32
- - '0.273739'
32
+ - '0.119390'
33
33
  cache-control:
34
34
  - max-age=0, private, must-revalidate
35
35
  status:
@@ -37,8 +37,8 @@ http_interactions:
37
37
  content-type:
38
38
  - application/xml; charset=utf-8
39
39
  set-cookie:
40
- - _front_session_id=7d0755491b8032d26c100da7bc59893e; domain=.iss.ndl.go.jp;
41
- path=/; expires=Mon, 25-Feb-2013 07:46:50 GMT; HttpOnly
40
+ - _front_session_id=94117645cbb848521a51ad089050f369; domain=.iss.ndl.go.jp;
41
+ path=/; expires=Wed, 10-Apr-2013 03:43:49 GMT; HttpOnly
42
42
  - serverid=1105; path=/
43
43
  vary:
44
44
  - Accept-Encoding,User-Agent
@@ -221,5 +221,5 @@ http_interactions:
221
221
  b3JkUG9zaXRpb24+MTwvcmVjb3JkUG9zaXRpb24+CiAgICA8L3JlY29yZD4K
222
222
  ICA8L3JlY29yZHM+Cjwvc2VhcmNoUmV0cmlldmVSZXNwb25zZT4K
223
223
  http_version: '1.0'
224
- recorded_at: Mon, 25 Feb 2013 06:46:48 GMT
224
+ recorded_at: Wed, 10 Apr 2013 02:43:49 GMT
225
225
  recorded_with: VCR 2.4.0