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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0846e2b92576d1d40de21c10bf70cfa9a62413de
4
- data.tar.gz: 8fc10c5ae9a5b62476817ba578a83ed1c62033c7
3
+ metadata.gz: 696af737773d1dc801bfd3d700ebb694cc831f52
4
+ data.tar.gz: a884d43c1640681aa477cf3f7de28159b7de68f5
5
5
  SHA512:
6
- metadata.gz: 1b88965874892d9b9b1ebdf43d13193e50bf43c1a781c81b8838949ff7c494b5be996c6c014f82c2c5f70dbdd2035ee580119c01712a81bcbed889a3ccbc54e8
7
- data.tar.gz: c7136275008ad79043fd17af5d52a9355733bea7e68a8969750b0ef743f859a45c9389e3a8977ec3b9dff9aea1a333cbb2a8a4498aa81da79c9c4b6f4aab2eda
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 retun 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.
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
- # if @values.respond_to?(:format) and
6
- # !@values.format.nil? and
7
- # !@values.format.empty?
8
- # return_fields << ModsDisplay::Values.new(:label => "Format",
9
- # :values => [decorate_formats(@values.format).join(", ")])
10
- # end
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?
@@ -1,3 +1,3 @@
1
1
  module ModsDisplay
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
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.2
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-03-06 00:00:00.000000000 Z
11
+ date: 2014-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stanford-mods