stanford-mods 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,7 +30,10 @@ module Stanford
30
30
  result << SEARCHWORKS_LANGUAGES[v.strip]
31
31
  end
32
32
  else
33
- result << SEARCHWORKS_LANGUAGES[v.strip]
33
+ vals = ct.text.split(/[,|\ ]/).reject {|x| x.strip.length == 0 }
34
+ vals.each do |v|
35
+ result << SEARCHWORKS_LANGUAGES[v.strip]
36
+ end
34
37
  end
35
38
  }
36
39
  # add languageTerm text values
@@ -73,7 +76,9 @@ module Stanford
73
76
 
74
77
  # @return [Array<String>] values for author_corp_display
75
78
  def sw_corporate_authors
76
- @mods_ng_xml.plain_name.select {|n| n.type_at == 'corporate'}.map { |n| n.display_value_w_date }
79
+ val=@mods_ng_xml.plain_name.select {|n| n.type_at == 'corporate'}.map { |n| n.display_value_w_date }
80
+ puts val.to_s
81
+ val
77
82
  end
78
83
 
79
84
  # @return [Array<String>] values for author_meeting_display
@@ -82,8 +87,8 @@ module Stanford
82
87
  end
83
88
 
84
89
  # Returns a sortable version of the main_author:
85
- # main_author + sorting title
86
- # which is the mods approximation of the value created for a marc record
90
+ # main_author + sorting title
91
+ # which is the mods approximation of the value created for a marc record
87
92
  # @return [String] value for author_sort field
88
93
  def sw_sort_author
89
94
  # substitute java Character.MAX_CODE_POINT for nil main_author so missing main authors sort last
@@ -100,7 +105,11 @@ module Stanford
100
105
 
101
106
  # @return [String] value for title_245_search, title_display, title_full_display
102
107
  def sw_full_title
103
- full_titles ? full_titles.find { |s| s =~ Regexp.new(Regexp.escape(sw_short_title)) } : nil
108
+ toret = full_titles ? full_titles.find { |s| s =~ Regexp.new(Regexp.escape(sw_short_title)) } : nil
109
+ if toret
110
+ toret = toret.gsub(/,$/, '')
111
+ end
112
+ toret
104
113
  end
105
114
 
106
115
  # this includes all titles except
@@ -1,6 +1,6 @@
1
1
  module Stanford
2
2
  module Mods
3
3
  # this is the Ruby Gem version
4
- VERSION = "0.0.11"
4
+ VERSION = "0.0.12"
5
5
  end
6
6
  end
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.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-01 00:00:00.000000000 Z
13
+ date: 2013-04-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mods