mods_display 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/mods_display.rb +3 -1
- data/lib/mods_display/fields/format.rb +6 -6
- data/lib/mods_display/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 696af737773d1dc801bfd3d700ebb694cc831f52
|
4
|
+
data.tar.gz: a884d43c1640681aa477cf3f7de28159b7de68f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 647c86e5eebc05550a32e3f4cc258eb3e9c9eb0c106ec0a5a7c40c84792942a490f52006c53663f54ed0c3fdea7919a58c748c5468d97e24d88bed352e6785b8
|
7
|
+
data.tar.gz: 532ce43cc00f02d1ae6202bc5e1d2d8afa315d674f0baa7e09b867c58e10998f02bd1da6b682a9524acc7f95d9d461aeae9b2c57ef40f9ef46e05631cf3834b7
|
data/README.md
CHANGED
@@ -4,6 +4,10 @@
|
|
4
4
|
|
5
5
|
A gem for displaying MODS Metadata in a configurable way.
|
6
6
|
|
7
|
+
## Demo
|
8
|
+
|
9
|
+
You can experiment with the output of the latest release of the gem in the [demo app](http://mods-display.herokuapp.com/).
|
10
|
+
|
7
11
|
## Installation
|
8
12
|
|
9
13
|
Add this line to your application's Gemfile:
|
@@ -170,7 +174,7 @@ You can also access the array of ModsDisplay::Values objects for a given class d
|
|
170
174
|
render_mods_display(@model).abstract
|
171
175
|
=> [#<ModsDisplay::Values @label="Abstract:", @values=["Hey. I'm an abstract."]>]
|
172
176
|
|
173
|
-
Given that this semantics that we're concerned with here are more about titles and data construction rather than XML it may be required that you find something by the label. A common example of this is the imprint class. The imprint class can
|
177
|
+
Given that this semantics that we're concerned with here are more about titles and data construction rather than XML it may be required that you find something by the label. A common example of this is the imprint class. The imprint class can return other publication data that is not the imprint statement. You'll want to select (using your favorite enumerable method) the element in the array that is an imprint.
|
174
178
|
|
175
179
|
imprint = render_mods_display(@model).imprint.find do |data|
|
176
180
|
data.label == "Imprint:"
|
data/lib/mods_display.rb
CHANGED
@@ -39,8 +39,10 @@ require "mods_display/fields/sub_title"
|
|
39
39
|
require "mods_display/fields/title"
|
40
40
|
require "mods_display/fields/values"
|
41
41
|
|
42
|
+
require 'stanford-mods'
|
43
|
+
|
42
44
|
require "i18n"
|
43
45
|
require "i18n/backend/fallbacks"
|
44
46
|
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
|
45
47
|
I18n.load_path += Dir["#{File.expand_path('../..', __FILE__)}/config/locales/*.yml"]
|
46
|
-
I18n.backend.load_translations
|
48
|
+
I18n.backend.load_translations
|
@@ -2,12 +2,12 @@ class ModsDisplay::Format < ModsDisplay::Field
|
|
2
2
|
|
3
3
|
def fields
|
4
4
|
return_fields = []
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
if @values.respond_to?(:format) and
|
6
|
+
!@values.format.nil? and
|
7
|
+
!@values.format.empty?
|
8
|
+
return_fields << ModsDisplay::Values.new(:label => format_label,
|
9
|
+
:values => [decorate_formats(@values.format).join(", ")])
|
10
|
+
end
|
11
11
|
unless @values.physical_description.nil?
|
12
12
|
@values.physical_description.each do |description|
|
13
13
|
unless description.form.nil? or description.form.empty?
|
data/lib/mods_display/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mods_display
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jessie Keck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stanford-mods
|