stanford-mods 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NmY1ZWQ2ZGMyNjZiYzZjY2M5MzE3ODYxNTliN2NkYTcyNGEyMTZjMQ==
5
- data.tar.gz: !binary |-
6
- YjhmY2NkODk0M2Q5OGYzODNkZTQ5NmI4YTc0Y2QyNTBiYzQ1M2RiZg==
2
+ SHA1:
3
+ metadata.gz: 95a95f8bfaee60c6772aaa2a165693620e7b2758
4
+ data.tar.gz: 2bcd5a5c3a82ec7993a9e52b2b599a3af21d0492
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NzM5OTVjYTQ5ODg1NWMzMWMwMDY2YmY5ZTZiZjZlY2Y0NGI2OTYzNjllZWQ2
10
- OGY4NWUxYmYwNGQzNTc1OTE3OTg4YTg3YjQzNDdiNTdmMjk0Nzg0ZDA5NDU1
11
- MTY0NDI3YjE1OWQ4Yjc4YzY4N2Q4ZjhmZTgwZmJhZmY3Y2M5YmE=
12
- data.tar.gz: !binary |-
13
- Yjg5YmFmYzY0MjU2YjM1ZjE5MjMwMGU1MTIyMDkzNmUxMjM1Mjk0MmFiNjdm
14
- YTJmYmNkODczYTFjMTcyMTNhNmI4ZWI2OWY5YTdlZDcwZmYxNGU1MTYyZDgx
15
- NzFmMjk5ODI5YzA4NWM0NTdiOTMxN2VkNjQ2MzYwOTEzZGVhZWU=
6
+ metadata.gz: 75fde964e08ad140a23fe66dd2e04e40fe6c521e52dbf43cd88d78a6d02e7bf0b8fed61313315e93efe911678046fcf0e916aafc14747a998cad540f34f02601
7
+ data.tar.gz: 52311ffea59fa1be748b503bceb7c82e9eeb5c98b8587460af66c0748a0d4b6202d8a82d85edfdf473c552cfbfe68eafddba5b5e3755549f569fe8b9175b2edb
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/.travis.yml CHANGED
@@ -1,9 +1,11 @@
1
1
  language: ruby
2
2
  script: rake rspec
3
3
  rvm:
4
- - 2.1.0
4
+ - 2.1.1
5
+ - 2.0.0
5
6
  - 1.9.3
6
7
  - ruby-head
8
+ - jruby-19mode # JRuby in 1.9 mode
7
9
  - jruby-head
8
10
  # - jruby-19mode
9
11
  notifications:
data/Gemfile CHANGED
@@ -4,3 +4,8 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  #gem 'mods', :path => '../mods'
7
+
8
+ group :test do
9
+ gem 'coveralls', require: false
10
+ end
11
+
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Stanford::Mods
2
2
 
3
- {<img src="https://secure.travis-ci.org/sul-dlss/stanford-mods.png?branch=master" alt="Build Status" />}[http://travis-ci.org/sul-dlss/stanford-mods] {<img src="https://gemnasium.com/sul-dlss/stanford-mods.png" alt="Dependency Status" />}[https://gemnasium.com/sul-dlss/stanford-mods]
3
+ {<img src="https://secure.travis-ci.org/sul-dlss/stanford-mods.png?branch=master" alt="Build Status" />}[http://travis-ci.org/sul-dlss/stanford-mods] {<img src="https://coveralls.io/repos/sul-dlss/stanford-mods/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/sul-dlss/stanford-mods] {<img src="https://gemnasium.com/sul-dlss/stanford-mods.png" alt="Dependency Status" />}[https://gemnasium.com/sul-dlss/stanford-mods] {<img src="https://badge.fury.io/rb/stanford-mods.svg" alt="Gem Version" />}[http://badge.fury.io/rb/stanford-mods]
4
4
 
5
5
  A Gem with Stanford specific wranglings of MODS (Metadata Object Description Schema) metadata from DOR, the Stanford Digital Object Repository.
6
6
 
@@ -59,6 +59,7 @@ Example Using SearchWorks Mixins:
59
59
  6. Create new Pull Request
60
60
 
61
61
  == Releases
62
+ * <b>0.0.25</b> map typeOfResource 'text' and genre 'report' to searchworks format 'Book'
62
63
  * <b>0.0.24</b> Largely cosmetic refactoring for easier maintenance.
63
64
  * <b>0.0.23</b> Added logic for dealing with "u-notation" approximate dates, e.g., 198u
64
65
  * <b>0.0.20</b> Added mapping for typeOfResource notated music
@@ -497,6 +497,7 @@ module Stanford
497
497
  val << 'Conference Proceedings' if genres and genres.include? 'conference publication'
498
498
  val << 'Other' if genres and genres.include? 'student project report'
499
499
  val << 'Book' if genres and genres.include? 'technical report'
500
+ val << 'Book' if genres and genres.include? 'report'
500
501
  when 'still image'
501
502
  val << 'Image'
502
503
  when 'mixed material'
@@ -1,6 +1,6 @@
1
1
  module Stanford
2
2
  module Mods
3
3
  # this is the Ruby Gem version
4
- VERSION = "0.0.24"
4
+ VERSION = "0.0.25"
5
5
  end
6
6
  end
@@ -9,84 +9,77 @@ describe "Format field from Searchworks mixin for Stanford::Mods::Record" do
9
9
  end
10
10
 
11
11
  it "should check genre as part of deciding format" do
12
- m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResouce><genre>thesis</genre></mods>"
13
- @smods_rec = Stanford::Mods::Record.new
12
+ m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResource><genre>thesis</genre></mods>"
14
13
  @smods_rec.from_str(m)
15
14
  @smods_rec.format.should == ['Thesis']
16
15
  end
17
16
 
18
17
  it 'should work for datasets' do
19
- m = "<mods #{@ns_decl}><typeOfResource>software, multimedia</typeOfResouce></mods>"
20
- @smods_rec = Stanford::Mods::Record.new
18
+ m = "<mods #{@ns_decl}><typeOfResource>software, multimedia</typeOfResource></mods>"
21
19
  @smods_rec.from_str(m)
22
20
  @smods_rec.format.should == ['Computer File']
23
21
  end
24
22
 
25
23
  it 'should work for books' do
26
- m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResouce><originInfo><issuance>monographic</issueance></originInfo></mods>"
27
- @smods_rec = Stanford::Mods::Record.new
24
+ m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResource><originInfo><issuance>monographic</issuance></originInfo></mods>"
28
25
  @smods_rec.from_str(m)
29
26
  @smods_rec.format.should == ['Book']
30
27
  end
31
28
 
32
29
  it "should work for a hydrus journal article" do
33
- m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResouce><genre>article</genre></mods>"
34
- @smods_rec = Stanford::Mods::Record.new
30
+ m = "<mods #{@ns_decl}><typeOfResource>text</typeOfResource><genre>article</genre></mods>"
35
31
  @smods_rec.from_str(m)
36
32
  @smods_rec.format.should == ['Journal/Periodical']
37
33
  end
38
34
 
39
35
  it "should work for image" do
40
- m = "<mods #{@ns_decl}><typeOfResource>still image</typeOfResouce></mods>"
41
- @smods_rec = Stanford::Mods::Record.new
36
+ m = "<mods #{@ns_decl}><typeOfResource>still image</typeOfResource></mods>"
42
37
  @smods_rec.from_str(m)
43
38
  @smods_rec.format.should == ['Image']
44
39
  end
45
40
 
46
41
  context "Hydrus mappings per GRYPHONDOR-207" do
47
- it "should give a format of Computer File for <genre>game</genre> and <typeOfResource>software, multimedia</typeOfResouce>" do
48
- m = "<mods #{@ns_decl}><genre>game</genre><typeOfResource>software, multimedia</typeOfResouce></mods>"
49
- @smods_rec = Stanford::Mods::Record.new
42
+ it "should give a format of Computer File for <genre>game</genre> and <typeOfResource>software, multimedia</typeOfResource>" do
43
+ m = "<mods #{@ns_decl}><genre>game</genre><typeOfResource>software, multimedia</typeOfResource></mods>"
50
44
  @smods_rec.from_str(m)
51
45
  @smods_rec.format.should == ['Computer File']
52
46
  end
53
- it "should give a format of Video for <genre>motion picture</genre> and <typeOfResource>moving image</typeOfResouce>" do
54
- m = "<mods #{@ns_decl}><genre>motion picture</genre><typeOfResource>moving image</typeOfResouce></mods>"
55
- @smods_rec = Stanford::Mods::Record.new
47
+ it "should give a format of Video for <genre>motion picture</genre> and <typeOfResource>moving image</typeOfResource>" do
48
+ m = "<mods #{@ns_decl}><genre>motion picture</genre><typeOfResource>moving image</typeOfResource></mods>"
56
49
  @smods_rec.from_str(m)
57
50
  @smods_rec.format.should == ['Video']
58
51
  end
59
- it "should give a format of Sound Recording for <genre>sound</genre> and <typeOfResource>sound recording-nonmusical</typeOfResouce>" do
60
- m = "<mods #{@ns_decl}><genre>sound</genre><typeOfResource>sound recording-nonmusical</typeOfResouce></mods>"
61
- @smods_rec = Stanford::Mods::Record.new
52
+ it "should give a format of Sound Recording for <genre>sound</genre> and <typeOfResource>sound recording-nonmusical</typeOfResource>" do
53
+ m = "<mods #{@ns_decl}><genre>sound</genre><typeOfResource>sound recording-nonmusical</typeOfResource></mods>"
62
54
  @smods_rec.from_str(m)
63
55
  @smods_rec.format.should == ['Sound Recording']
64
56
  end
65
- it "should give a format of Conference Proceedings for <genre>conference publication</genre> and <typeOfResource>text</typeOfResouce>" do
66
- m = "<mods #{@ns_decl}><genre>conference publication</genre><typeOfResource>text</typeOfResouce></mods>"
67
- @smods_rec = Stanford::Mods::Record.new
57
+ it "should give a format of Conference Proceedings for <genre>conference publication</genre> and <typeOfResource>text</typeOfResource>" do
58
+ m = "<mods #{@ns_decl}><genre>conference publication</genre><typeOfResource>text</typeOfResource></mods>"
68
59
  @smods_rec.from_str(m)
69
60
  @smods_rec.format.should == ['Conference Proceedings']
70
61
  end
71
- it "should give a format of Book for <genre>technical report</genre> and <typeOfResource>text</typeOfResouce>" do
72
- m = "<mods #{@ns_decl}><genre>technical report</genre><typeOfResource>text</typeOfResouce></mods>"
73
- @smods_rec = Stanford::Mods::Record.new
62
+ it "should give a format of Book for <genre>technical report</genre> and <typeOfResource>text</typeOfResource>" do
63
+ m = "<mods #{@ns_decl}><genre>technical report</genre><typeOfResource>text</typeOfResource></mods>"
64
+ @smods_rec.from_str(m)
65
+ @smods_rec.format.should == ['Book']
66
+ end
67
+ it "should give a format of Book for <genre>report</genre> and <typeOfResource>text</typeOfResource>", :jira => 'GRYP-170', :github => 'gdor-indexer/#7' do
68
+ m = "<mods #{@ns_decl}><genre>report</genre><typeOfResource>text</typeOfResource></mods>"
74
69
  @smods_rec.from_str(m)
75
70
  @smods_rec.format.should == ['Book']
76
71
  end
77
72
  end
78
73
 
79
74
  # Student Project Reports: spec via email from Vitus, August 16, 2013
80
- it "should give a format of Other for <genre>student project report</genre> and <typeOfResource>text</typeOfResouce>" do
81
- m = "<mods #{@ns_decl}><genre>student project report</genre><typeOfResource>text</typeOfResouce></mods>"
82
- @smods_rec = Stanford::Mods::Record.new
75
+ it "should give a format of Other for <genre>student project report</genre> and <typeOfResource>text</typeOfResource>" do
76
+ m = "<mods #{@ns_decl}><genre>student project report</genre><typeOfResource>text</typeOfResource></mods>"
83
77
  @smods_rec.from_str(m)
84
78
  @smods_rec.format.should == ['Other']
85
79
  end
86
80
 
87
- it "should give a format of Music - Score for <typeOfResource>notated music</typeOfResouce>" do
88
- m = "<mods #{@ns_decl}><typeOfResource>notated music</typeOfResouce></mods>"
89
- @smods_rec = Stanford::Mods::Record.new
81
+ it "should give a format of Music - Score for <typeOfResource>notated music</typeOfResource>" do
82
+ m = "<mods #{@ns_decl}><typeOfResource>notated music</typeOfResource></mods>"
90
83
  @smods_rec.from_str(m)
91
84
  @smods_rec.format.should == ['Music - Score']
92
85
  end
@@ -95,7 +88,6 @@ describe "Format field from Searchworks mixin for Stanford::Mods::Record" do
95
88
  m = "<mods #{@ns_decl}><originInfo>
96
89
  <dateCreated>1904</dateCreated>
97
90
  </originInfo></mods>"
98
- @smods_rec = Stanford::Mods::Record.new
99
91
  @smods_rec.from_str(m)
100
92
  @smods_rec.format.should == []
101
93
  end
data/spec/spec_helper.rb CHANGED
@@ -1,16 +1,5 @@
1
- # for test coverage
2
- require 'simplecov'
3
- require 'simplecov-rcov'
4
- class SimpleCov::Formatter::MergedFormatter
5
- def format(result)
6
- SimpleCov::Formatter::HTMLFormatter.new.format(result)
7
- SimpleCov::Formatter::RcovFormatter.new.format(result)
8
- end
9
- end
10
- SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter
11
- SimpleCov.start do
12
- add_filter "/spec/"
13
- end
1
+ require 'coveralls'
2
+ Coveralls.wear!
14
3
 
15
4
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
16
5
  $LOAD_PATH.unshift(File.dirname(__FILE__))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stanford-mods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
@@ -9,104 +9,104 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-14 00:00:00.000000000 Z
12
+ date: 2014-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mods
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ! '>='
25
+ - - '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ! '>='
32
+ - - '>='
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ! '>='
39
+ - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rdoc
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ! '>='
46
+ - - '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ! '>='
53
+ - - '>='
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: yard
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ! '>='
60
+ - - '>='
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ! '>='
67
+ - - '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ! '>='
74
+ - - '>='
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ! '>='
81
+ - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: simplecov
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ! '>='
88
+ - - '>='
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ! '>='
95
+ - - '>='
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: simplecov-rcov
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ! '>='
102
+ - - '>='
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ! '>='
109
+ - - '>='
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  description: Stanford specific wrangling of MODS metadata from DOR, the Stanford Digital
@@ -120,6 +120,7 @@ extra_rdoc_files:
120
120
  - LICENSE
121
121
  - README.rdoc
122
122
  files:
123
+ - .coveralls.yml
123
124
  - .gitignore
124
125
  - .travis.yml
125
126
  - .yardopts
@@ -149,12 +150,12 @@ require_paths:
149
150
  - lib
150
151
  required_ruby_version: !ruby/object:Gem::Requirement
151
152
  requirements:
152
- - - ! '>='
153
+ - - '>='
153
154
  - !ruby/object:Gem::Version
154
155
  version: '0'
155
156
  required_rubygems_version: !ruby/object:Gem::Requirement
156
157
  requirements:
157
- - - ! '>='
158
+ - - '>='
158
159
  - !ruby/object:Gem::Version
159
160
  version: '0'
160
161
  requirements: []