hydra-mods 0.0.1

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.
@@ -0,0 +1,30 @@
1
+ # @deprecated Leftover from Hydrangea; will be removed in release 5.x
2
+ module Uva
3
+ module ModsIndexMethods
4
+
5
+ def self.included(base)
6
+ ActiveSupport::Deprecation.warn("Uva::ModsIndexMethods has been deprecated and its functionality has been encorporated into Hydra::Datastream::ModsArticle")
7
+ end
8
+
9
+ # extracts the last_name##full_name##computing_id to be used by home view
10
+ def extract_person_full_names_and_computing_ids
11
+ names = {}
12
+ self.find_by_terms(:person).each do |person|
13
+ name_parts = person.children.inject({}) do |hash,child|
14
+ hash[child.get_attribute(:type)] = child.text if ["family","given"].include? child.get_attribute(:type)
15
+ hash["computing_id"] = child.text if child.name == 'computing_id'
16
+ hash
17
+ end
18
+ if name_parts.length == 3 and person.search(:roleTerm).children.text.include?("Author")
19
+ if name_parts["family"].blank? && name_parts["given"].blank? && name_parts["computing_id"].blank?
20
+ value = "Unknown Author"
21
+ else
22
+ value = "#{name_parts["family"]}, #{name_parts["given"]} (#{name_parts["computing_id"]})"
23
+ end
24
+ ::Solrizer::Extractor.insert_solr_field_value(names, "person_full_name_cid_facet", value) if name_parts.length == 3
25
+ end
26
+ end
27
+ names
28
+ end
29
+ end
30
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hydra-mods
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Matt Zumwalt, Bess Sadler, Julie Meloni, Naomi Dushay, Jessie Keck, John Scofield,
9
+ Justin Coyne & many more. See https://github.com/projecthydra/hydra-head/contributors
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2012-06-07 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hydra-head
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
31
+ description: Hydra MODS components split out from hydra-head
32
+ email:
33
+ - hydra-tech@googlegroups.com
34
+ executables: []
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - Gemfile
39
+ - Rakefile
40
+ - app/models/hydra/datastream/common_mods_index_methods.rb
41
+ - app/models/hydra/datastream/mods_article.rb
42
+ - app/models/hydra/datastream/mods_basic.rb
43
+ - app/models/hydra/datastream/mods_dataset.rb
44
+ - app/models/hydra/datastream/mods_generic_content.rb
45
+ - app/models/hydra/datastream/mods_image.rb
46
+ - app/models/mods_asset.rb
47
+ - hydra-mods.gemspec
48
+ - lib/hydra-mods.rb
49
+ - lib/hydra/common_mods_index_methods.rb
50
+ - lib/hydra/model_mixins/mods_object.rb
51
+ - lib/hydra/mods.rb
52
+ - lib/hydra/mods_article.rb
53
+ - lib/hydra/mods_dataset.rb
54
+ - lib/hydra/mods_generic_content.rb
55
+ - lib/hydra/mods_image.rb
56
+ - lib/uva/mods_index_methods.rb
57
+ homepage: http://projecthydra.org
58
+ licenses: []
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ - app/models
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 1.8.24
79
+ signing_key:
80
+ specification_version: 3
81
+ summary: Hydra MODS components split out from hydra-head
82
+ test_files: []