hyrax 1.0.3 → 1.0.4
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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/assets/javascripts/hyrax/autocomplete.es6 +0 -2
- data/app/helpers/hyrax/citations_behaviors/formatters/apa_formatter.rb +45 -19
- data/app/helpers/hyrax/citations_behaviors/formatters/chicago_formatter.rb +2 -3
- data/app/helpers/hyrax/citations_behaviors/formatters/mla_formatter.rb +3 -4
- data/app/services/hyrax/curation_concern.rb +6 -2
- data/app/services/hyrax/file_set_audit_service.rb +1 -1
- data/hyrax.gemspec +8 -8
- data/lib/hyrax/engine.rb +0 -2
- data/lib/hyrax/version.rb +1 -1
- data/spec/services/hyrax/file_set_audit_service_spec.rb +14 -0
- data/spec/views/hyrax/citations/work.html.erb_spec.rb +161 -71
- data/template.rb +1 -1
- metadata +41 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8ad2991ded6a429bb8dad99fd4f9eccbbc7b74d
|
4
|
+
data.tar.gz: a3aa325263c85f965daf3b36ae3c76feee564dc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 953b2193c4e569fd2d54b93f24c54960147a2399aa7967d140e95205536f353fafeb615c65c30e2b771a14d99603d441ec85cd301077e4fe7d1aa2fd26b33751
|
7
|
+
data.tar.gz: 04dd1fbcdf0d254710784c76bc5776ec373d480e350f6723a5ded2557eac36df6d5537baf8cdb13d190a79f590a5744f41ccd0ab0ad0ee31dd0dbe70233022cb
|
data/README.md
CHANGED
@@ -59,7 +59,7 @@ If you have questions or need help, please email [the Hydra community tech list]
|
|
59
59
|
# Getting started
|
60
60
|
|
61
61
|
This document contains instructions specific to setting up an app with __Hyrax
|
62
|
-
v1.0.
|
62
|
+
v1.0.4__. If you are looking for instructions on installing a different
|
63
63
|
version, be sure to select the appropriate branch or tag from the drop-down
|
64
64
|
menu above.
|
65
65
|
|
@@ -133,7 +133,7 @@ Rails requires that you have a JavaScript runtime -- for example, nodejs -- inst
|
|
133
133
|
Generate a new Rails application using the template.
|
134
134
|
|
135
135
|
```
|
136
|
-
rails new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v1.0.
|
136
|
+
rails new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v1.0.4/template.rb
|
137
137
|
```
|
138
138
|
|
139
139
|
Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
|
@@ -7,28 +7,28 @@ module Hyrax
|
|
7
7
|
|
8
8
|
def format(work)
|
9
9
|
text = ''
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
text <<
|
14
|
-
unless text.blank?
|
15
|
-
text = "<span class=\"citation-author\">#{text}</span> "
|
16
|
-
end
|
17
|
-
# Get Pub Date
|
18
|
-
pub_date = setup_pub_date(work)
|
19
|
-
text << format_date(pub_date)
|
20
|
-
|
21
|
-
# setup title info
|
22
|
-
title_info = setup_title_info(work)
|
23
|
-
text << format_title(title_info)
|
24
|
-
|
25
|
-
# Publisher info
|
26
|
-
pub_info = clean_end_punctuation(setup_pub_info(work))
|
27
|
-
text << pub_info unless pub_info.nil?
|
28
|
-
text << "." unless text.blank? || text =~ /\.$/
|
10
|
+
text << authors_text_for(work)
|
11
|
+
text << pub_date_text_for(work)
|
12
|
+
text << add_title_text_for(work)
|
13
|
+
text << add_publisher_text_for(work)
|
29
14
|
text.html_safe
|
30
15
|
end
|
31
16
|
|
17
|
+
private
|
18
|
+
|
19
|
+
def authors_text_for(work)
|
20
|
+
# setup formatted author list
|
21
|
+
authors_list = author_list(work).reject(&:blank?)
|
22
|
+
author_text = format_authors(authors_list)
|
23
|
+
if author_text.blank?
|
24
|
+
author_text
|
25
|
+
else
|
26
|
+
"<span class=\"citation-author\">#{author_text}</span> "
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
public
|
31
|
+
|
32
32
|
def format_authors(authors_list = [])
|
33
33
|
authors_list = Array.wrap(authors_list).collect { |name| abbreviate_name(surname_first(name)).strip }
|
34
34
|
text = ''
|
@@ -44,6 +44,32 @@ module Hyrax
|
|
44
44
|
text
|
45
45
|
end
|
46
46
|
|
47
|
+
private
|
48
|
+
|
49
|
+
def pub_date_text_for(work)
|
50
|
+
# Get Pub Date
|
51
|
+
pub_date = setup_pub_date(work)
|
52
|
+
format_date(pub_date)
|
53
|
+
end
|
54
|
+
|
55
|
+
def add_title_text_for(work)
|
56
|
+
# setup title info
|
57
|
+
title_info = setup_title_info(work)
|
58
|
+
format_title(title_info)
|
59
|
+
end
|
60
|
+
|
61
|
+
def add_publisher_text_for(work)
|
62
|
+
# Publisher info
|
63
|
+
pub_info = clean_end_punctuation(setup_pub_info(work))
|
64
|
+
if pub_info.nil?
|
65
|
+
''
|
66
|
+
else
|
67
|
+
pub_info + "."
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
public
|
72
|
+
|
47
73
|
def format_date(pub_date)
|
48
74
|
pub_date.blank? ? "" : "(" + pub_date + "). "
|
49
75
|
end
|
@@ -11,17 +11,16 @@ module Hyrax
|
|
11
11
|
# setup formatted author list
|
12
12
|
authors_list = all_authors(work)
|
13
13
|
text << format_authors(authors_list)
|
14
|
-
|
14
|
+
if text.present?
|
15
15
|
text = "<span class=\"citation-author\">#{text}</span>"
|
16
16
|
end
|
17
17
|
# Get Pub Date
|
18
18
|
pub_date = setup_pub_date(work)
|
19
19
|
text << " #{pub_date}." unless pub_date.nil?
|
20
|
-
text << "." unless text.blank? || text =~ /\.$/
|
21
20
|
|
22
21
|
text << format_title(work.to_s)
|
23
22
|
pub_info = setup_pub_info(work, false)
|
24
|
-
text << " #{pub_info}."
|
23
|
+
text << " #{pub_info}." if pub_info.present?
|
25
24
|
text.html_safe
|
26
25
|
end
|
27
26
|
|
@@ -9,7 +9,7 @@ module Hyrax
|
|
9
9
|
text = ''
|
10
10
|
|
11
11
|
# setup formatted author list
|
12
|
-
authors = author_list(work).
|
12
|
+
authors = author_list(work).reject(&:blank?)
|
13
13
|
text << "<span class=\"citation-author\">#{format_authors(authors)}</span>"
|
14
14
|
# setup title
|
15
15
|
title_info = setup_title_info(work)
|
@@ -18,8 +18,7 @@ module Hyrax
|
|
18
18
|
# Publication
|
19
19
|
pub_info = clean_end_punctuation(setup_pub_info(work, true))
|
20
20
|
|
21
|
-
text << pub_info
|
22
|
-
text << "." unless text.blank? || text =~ /\.$/
|
21
|
+
text << pub_info + "." if pub_info.present?
|
23
22
|
text.html_safe
|
24
23
|
end
|
25
24
|
|
@@ -27,7 +26,7 @@ module Hyrax
|
|
27
26
|
return "" if authors_list.blank?
|
28
27
|
authors_list = Array.wrap(authors_list)
|
29
28
|
text = concatenate_authors_from(authors_list)
|
30
|
-
|
29
|
+
if text.present?
|
31
30
|
text << "." unless text =~ /\.$/
|
32
31
|
text << " "
|
33
32
|
end
|
@@ -1,7 +1,11 @@
|
|
1
1
|
module Hyrax
|
2
2
|
class CurationConcern
|
3
|
-
#
|
4
|
-
|
3
|
+
# You can customize the actor stack, so long as you do so before the actor
|
4
|
+
# is used. Once it is used, it becomes immutable.
|
5
|
+
# @return [Hyrax::ActorFactory]
|
6
|
+
def self.actor_factory
|
7
|
+
Hyrax::ActorFactory
|
8
|
+
end
|
5
9
|
|
6
10
|
# A consumer of this method can inject a different factory
|
7
11
|
# into this class in order to change the behavior of this method.
|
@@ -60,7 +60,7 @@ module Hyrax
|
|
60
60
|
# @param [ActiveFedora::File] file to audit
|
61
61
|
# @param [Array] log container for messages
|
62
62
|
def audit_file(file, log = [])
|
63
|
-
versions = file.has_versions? ? file.versions.all : file
|
63
|
+
versions = file.has_versions? ? file.versions.all : Array.wrap(file)
|
64
64
|
versions.each { |v| log << audit_file_version(file.id, v.uri) }
|
65
65
|
log
|
66
66
|
end
|
data/hyrax.gemspec
CHANGED
@@ -25,17 +25,17 @@ EOF
|
|
25
25
|
spec.version = Hyrax::VERSION
|
26
26
|
spec.license = 'Apache-2.0'
|
27
27
|
|
28
|
-
spec.add_dependency 'hydra-head', '>= 10.4.0'
|
28
|
+
spec.add_dependency 'hydra-head', '~> 10.4', '>= 10.4.0'
|
29
29
|
spec.add_dependency 'hydra-editor', '~> 3.2'
|
30
30
|
spec.add_dependency 'hydra-works', '~> 0.16'
|
31
31
|
spec.add_dependency 'hydra-derivatives', '~> 3.3'
|
32
|
-
spec.add_dependency 'browse-everything', '>= 0.10.5'
|
32
|
+
spec.add_dependency 'browse-everything', '~> 0.10', '>= 0.10.5'
|
33
33
|
spec.add_dependency 'blacklight', '~> 6.9'
|
34
34
|
spec.add_dependency 'blacklight-gallery', '~> 0.7'
|
35
35
|
spec.add_dependency 'tinymce-rails', '~> 4.1'
|
36
36
|
spec.add_dependency 'tinymce-rails-imageupload', '~> 4.0.17.beta'
|
37
37
|
spec.add_dependency 'font-awesome-rails', '~> 4.2'
|
38
|
-
spec.add_dependency 'select2-rails', '~> 3.5.9'
|
38
|
+
spec.add_dependency 'select2-rails', '~> 3.5', '>= 3.5.9'
|
39
39
|
spec.add_dependency 'json-schema' # for Arkivio
|
40
40
|
spec.add_dependency 'nest', '~> 2.0'
|
41
41
|
spec.add_dependency 'mailboxer', '~> 0.12'
|
@@ -46,12 +46,12 @@ EOF
|
|
46
46
|
spec.add_dependency 'legato', '~> 0.3'
|
47
47
|
spec.add_dependency 'posix-spawn'
|
48
48
|
spec.add_dependency 'jquery-ui-rails', '~> 5.0'
|
49
|
-
spec.add_dependency 'redis-namespace', '~> 1.5.2'
|
49
|
+
spec.add_dependency 'redis-namespace', '~> 1.5', '>= 1.5.2'
|
50
50
|
spec.add_dependency 'flot-rails', '~> 0.0.6'
|
51
51
|
spec.add_dependency 'almond-rails', '~> 0.1'
|
52
52
|
spec.add_dependency 'qa', '~> 1.0' # questioning_authority
|
53
53
|
spec.add_dependency 'flipflop', '~> 2.3'
|
54
|
-
spec.add_dependency 'jquery-datatables-rails', '~> 3.4.0'
|
54
|
+
spec.add_dependency 'jquery-datatables-rails', '~> 3.4', '>= 3.4.0'
|
55
55
|
spec.add_dependency 'rdf-rdfxml' # controlled vocabulary importer
|
56
56
|
spec.add_dependency 'railties', '~> 5.0'
|
57
57
|
spec.add_dependency 'clipboard-rails', '~> 1.5'
|
@@ -67,7 +67,7 @@ EOF
|
|
67
67
|
spec.add_dependency 'active_attr', '~> 0.9'
|
68
68
|
spec.add_dependency 'redlock', '~> 0.1.2'
|
69
69
|
spec.add_dependency 'retriable', '>= 2.9', '< 4.0'
|
70
|
-
spec.add_dependency 'active-fedora', '>= 11.3.1'
|
70
|
+
spec.add_dependency 'active-fedora', '~> 11.3', '>= 11.3.1'
|
71
71
|
spec.add_dependency 'linkeddata' # Required for getting values from geonames
|
72
72
|
|
73
73
|
spec.add_development_dependency 'engine_cart', '~> 1.0'
|
@@ -84,9 +84,9 @@ EOF
|
|
84
84
|
spec.add_development_dependency "equivalent-xml", '~> 0.5'
|
85
85
|
spec.add_development_dependency "jasmine", '~> 2.3'
|
86
86
|
spec.add_development_dependency 'rubocop', '~> 0.47.0'
|
87
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 1.10.0'
|
87
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.10.0' # intentionally pessimistic
|
88
88
|
spec.add_development_dependency 'shoulda-matchers', '~> 3.1'
|
89
|
-
spec.add_development_dependency 'rails-controller-testing'
|
89
|
+
spec.add_development_dependency 'rails-controller-testing'
|
90
90
|
spec.add_development_dependency 'webmock'
|
91
91
|
spec.add_development_dependency 'i18n-debug' unless ENV['TRAVIS']
|
92
92
|
spec.add_development_dependency 'i18n_yaml_sorter' unless ENV['TRAVIS']
|
data/lib/hyrax/engine.rb
CHANGED
@@ -66,8 +66,6 @@ module Hyrax
|
|
66
66
|
ActiveFedora::Noid.config.minter_class = c.noid_minter_class
|
67
67
|
ActiveFedora::Noid.config.statefile = c.minter_statefile
|
68
68
|
end
|
69
|
-
|
70
|
-
Hyrax::CurationConcern.actor_factory = Hyrax::ActorFactory
|
71
69
|
end
|
72
70
|
|
73
71
|
initializer 'hyrax.assets.precompile' do |app|
|
data/lib/hyrax/version.rb
CHANGED
@@ -22,6 +22,20 @@ describe Hyrax::FileSetAuditService do
|
|
22
22
|
specify 'returns a single result' do
|
23
23
|
expect(subject.length).to eq(1)
|
24
24
|
end
|
25
|
+
context 'when a file has two versions' do
|
26
|
+
before do
|
27
|
+
Hyrax::VersioningService.create(f.original_file) # create a second version -- the factory creates the first version when it attaches +content+
|
28
|
+
end
|
29
|
+
specify 'returns two log results' do
|
30
|
+
expect(subject.count).to eq(2)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
context "when a file has no versions (i.e. has_versions? == false)" do
|
34
|
+
subject { service_by_object.send(:audit_file, Hydra::PCDM::File.new) }
|
35
|
+
specify "returns one log result" do
|
36
|
+
expect(subject.count).to eq(1)
|
37
|
+
end
|
38
|
+
end
|
25
39
|
end
|
26
40
|
|
27
41
|
describe '#audit_file_version' do
|
@@ -1,84 +1,174 @@
|
|
1
|
+
RSpec.describe 'hyrax/citations/work.html.erb', type: :view do
|
2
|
+
context "full work metadata" do
|
3
|
+
let(:object_profile) { ["{\"id\":\"999\"}"] }
|
4
|
+
let(:contributor) { ['Gandalf Grey'] }
|
5
|
+
let(:creator) { ['Bilbo Baggins', 'Baggins, Frodo'] }
|
6
|
+
let(:solr_document) do
|
7
|
+
SolrDocument.new(
|
8
|
+
id: '999',
|
9
|
+
object_profile_ssm: object_profile,
|
10
|
+
has_model_ssim: ['GenericWork'],
|
11
|
+
human_readable_type_tesim: ['Generic Work'],
|
12
|
+
contributor_tesim: contributor,
|
13
|
+
creator_tesim: creator,
|
14
|
+
license_tesim: ['http://creativecommons.org/licenses/by/3.0/us/'],
|
15
|
+
title_tesim: ['the Roared about the Langs'],
|
16
|
+
based_near_tesim: ['London'],
|
17
|
+
date_created_tesim: ['1969']
|
18
|
+
)
|
19
|
+
end
|
20
|
+
let(:ability) { nil }
|
21
|
+
let(:presenter) do
|
22
|
+
Hyrax::WorkShowPresenter.new(solr_document, ability)
|
23
|
+
end
|
1
24
|
|
2
|
-
describe '
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
SolrDocument.new(
|
8
|
-
id: '999',
|
9
|
-
object_profile_ssm: object_profile,
|
10
|
-
has_model_ssim: ['GenericWork'],
|
11
|
-
human_readable_type_tesim: ['Generic Work'],
|
12
|
-
contributor_tesim: contributor,
|
13
|
-
creator_tesim: creator,
|
14
|
-
rights_tesim: ['http://creativecommons.org/licenses/by/3.0/us/'],
|
15
|
-
title_tesim: ['the Roared about the Langs'],
|
16
|
-
based_near_tesim: ['London'],
|
17
|
-
date_created_tesim: ['1969']
|
18
|
-
)
|
19
|
-
end
|
20
|
-
let(:ability) { nil }
|
21
|
-
let(:presenter) do
|
22
|
-
Hyrax::WorkShowPresenter.new(solr_document, ability)
|
23
|
-
end
|
25
|
+
describe 'citations' do
|
26
|
+
let(:page) { Capybara::Node::Simple.new(rendered) }
|
27
|
+
let(:citation) { page.find(citation_selector) }
|
28
|
+
let(:title_selector) { "#{citation_selector} > i.citation-title" }
|
29
|
+
let(:author_selector) { "#{citation_selector} > .citation-author" }
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
let(:author_selector) { "#{citation_selector} > .citation-author" }
|
30
|
-
before do
|
31
|
-
assign(:presenter, presenter)
|
32
|
-
render
|
33
|
-
end
|
31
|
+
before do
|
32
|
+
assign(:presenter, presenter)
|
33
|
+
render
|
34
|
+
end
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
context 'in APA style' do
|
37
|
+
let(:citation_selector) { 'span.apa-citation' }
|
38
|
+
let(:formatted_title) { 'the Roared about the Langs.' }
|
39
|
+
# entities will be unescaped
|
40
|
+
let(:authors) { 'Baggins, B., & Baggins, F.' }
|
41
|
+
|
42
|
+
it 'exports title' do
|
43
|
+
expect(page).to have_selector(title_selector, count: 1)
|
44
|
+
expect(page.find(title_selector)).to have_content(formatted_title)
|
45
|
+
end
|
46
|
+
it 'exports authors' do
|
47
|
+
expect(page).to have_selector(author_selector, count: 1)
|
48
|
+
expect(page.find(author_selector)).to have_content(authors)
|
49
|
+
end
|
50
|
+
it 'cites' do
|
51
|
+
expect(citation.text).to eql("#{authors} (1969). #{formatted_title} London.")
|
52
|
+
end
|
43
53
|
end
|
44
|
-
|
45
|
-
|
46
|
-
|
54
|
+
context 'in Chicago style' do
|
55
|
+
let(:citation_selector) { 'span.chicago-citation' }
|
56
|
+
let(:formatted_title) { 'The Roared about the Langs.' }
|
57
|
+
let(:authors) { 'Baggins, Bilbo, and Frodo Baggins.' }
|
58
|
+
|
59
|
+
it 'exports title' do
|
60
|
+
expect(page).to have_selector(title_selector, count: 1)
|
61
|
+
expect(page.find(title_selector)).to have_content(formatted_title)
|
62
|
+
end
|
63
|
+
it 'exports authors' do
|
64
|
+
expect(page).to have_selector(author_selector, count: 1)
|
65
|
+
expect(page.find(author_selector)).to have_content(authors)
|
66
|
+
end
|
67
|
+
it 'cites' do
|
68
|
+
expect(citation.text).to eql("#{authors} 1969. #{formatted_title} London.")
|
69
|
+
end
|
47
70
|
end
|
48
|
-
|
49
|
-
|
71
|
+
context 'in MLA style' do
|
72
|
+
let(:citation_selector) { 'span.mla-citation' }
|
73
|
+
let(:formatted_title) { 'the Roared About the Langs.' }
|
74
|
+
let(:authors) { 'Baggins, Bilbo, and Frodo Baggins.' }
|
75
|
+
|
76
|
+
it 'exports title' do
|
77
|
+
expect(page).to have_selector(title_selector, count: 1)
|
78
|
+
expect(page.find(title_selector)).to have_content(formatted_title)
|
79
|
+
end
|
80
|
+
it 'exports authors' do
|
81
|
+
expect(page).to have_selector(author_selector, count: 1)
|
82
|
+
expect(page.find(author_selector)).to have_content(authors)
|
83
|
+
end
|
84
|
+
it 'cites' do
|
85
|
+
expect(citation.text).to eql("#{authors} #{formatted_title} London, 1969.")
|
86
|
+
end
|
50
87
|
end
|
51
88
|
end
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
89
|
+
end
|
90
|
+
|
91
|
+
context "minimal work metatdata" do
|
92
|
+
let(:object_profile) { ["{\"id\":\"999\"}"] }
|
93
|
+
let(:creator) { ['Bilbo Baggins', 'Baggins, Frodo'] }
|
94
|
+
let(:solr_document) do
|
95
|
+
SolrDocument.new(
|
96
|
+
id: '999',
|
97
|
+
object_profile_ssm: object_profile,
|
98
|
+
has_model_ssim: ['GenericWork'],
|
99
|
+
human_readable_type_tesim: ['Generic Work'],
|
100
|
+
creator_tesim: creator,
|
101
|
+
license_tesim: ['http://creativecommons.org/licenses/by/3.0/us/'],
|
102
|
+
title_tesim: ['the Roared about the Langs']
|
103
|
+
)
|
67
104
|
end
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
105
|
+
let(:ability) { nil }
|
106
|
+
let(:presenter) do
|
107
|
+
Hyrax::WorkShowPresenter.new(solr_document, ability)
|
108
|
+
end
|
109
|
+
|
110
|
+
describe 'citations' do
|
111
|
+
let(:page) { Capybara::Node::Simple.new(rendered) }
|
112
|
+
let(:citation) { page.find(citation_selector) }
|
113
|
+
let(:title_selector) { "#{citation_selector} > i.citation-title" }
|
114
|
+
let(:author_selector) { "#{citation_selector} > .citation-author" }
|
115
|
+
|
116
|
+
before do
|
117
|
+
assign(:presenter, presenter)
|
118
|
+
render
|
75
119
|
end
|
76
|
-
|
77
|
-
|
78
|
-
|
120
|
+
|
121
|
+
context 'in APA style' do
|
122
|
+
let(:citation_selector) { 'span.apa-citation' }
|
123
|
+
let(:formatted_title) { 'the Roared about the Langs.' }
|
124
|
+
# entities will be unescaped
|
125
|
+
let(:authors) { 'Baggins, B., & Baggins, F.' }
|
126
|
+
|
127
|
+
it 'exports title' do
|
128
|
+
expect(page).to have_selector(title_selector, count: 1)
|
129
|
+
expect(page.find(title_selector)).to have_content(formatted_title)
|
130
|
+
end
|
131
|
+
it 'exports authors' do
|
132
|
+
expect(page).to have_selector(author_selector, count: 1)
|
133
|
+
expect(page.find(author_selector)).to have_content(authors)
|
134
|
+
end
|
135
|
+
it 'cites' do
|
136
|
+
expect(citation.text).to eql("#{authors} #{formatted_title} ")
|
137
|
+
end
|
79
138
|
end
|
80
|
-
|
81
|
-
|
139
|
+
context 'in Chicago style' do
|
140
|
+
let(:citation_selector) { 'span.chicago-citation' }
|
141
|
+
let(:formatted_title) { 'The Roared about the Langs.' }
|
142
|
+
let(:authors) { 'Baggins, Bilbo, and Frodo Baggins.' }
|
143
|
+
|
144
|
+
it 'exports title' do
|
145
|
+
expect(page).to have_selector(title_selector, count: 1)
|
146
|
+
expect(page.find(title_selector)).to have_content(formatted_title)
|
147
|
+
end
|
148
|
+
it 'exports authors' do
|
149
|
+
expect(page).to have_selector(author_selector, count: 1)
|
150
|
+
expect(page.find(author_selector)).to have_content(authors)
|
151
|
+
end
|
152
|
+
it 'cites' do
|
153
|
+
expect(citation.text).to eql("#{authors} #{formatted_title}")
|
154
|
+
end
|
155
|
+
end
|
156
|
+
context 'in MLA style' do
|
157
|
+
let(:citation_selector) { 'span.mla-citation' }
|
158
|
+
let(:formatted_title) { 'the Roared About the Langs.' }
|
159
|
+
let(:authors) { 'Baggins, Bilbo, and Frodo Baggins.' }
|
160
|
+
|
161
|
+
it 'exports title' do
|
162
|
+
expect(page).to have_selector(title_selector, count: 1)
|
163
|
+
expect(page.find(title_selector)).to have_content(formatted_title)
|
164
|
+
end
|
165
|
+
it 'exports authors' do
|
166
|
+
expect(page).to have_selector(author_selector, count: 1)
|
167
|
+
expect(page.find(author_selector)).to have_content(authors)
|
168
|
+
end
|
169
|
+
it 'cites' do
|
170
|
+
expect(citation.text).to eql("#{authors} #{formatted_title} ")
|
171
|
+
end
|
82
172
|
end
|
83
173
|
end
|
84
174
|
end
|
data/template.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyrax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -14,12 +14,15 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2017-
|
17
|
+
date: 2017-08-22 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: hydra-head
|
21
21
|
requirement: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
|
+
- - "~>"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '10.4'
|
23
26
|
- - ">="
|
24
27
|
- !ruby/object:Gem::Version
|
25
28
|
version: 10.4.0
|
@@ -27,6 +30,9 @@ dependencies:
|
|
27
30
|
prerelease: false
|
28
31
|
version_requirements: !ruby/object:Gem::Requirement
|
29
32
|
requirements:
|
33
|
+
- - "~>"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '10.4'
|
30
36
|
- - ">="
|
31
37
|
- !ruby/object:Gem::Version
|
32
38
|
version: 10.4.0
|
@@ -76,6 +82,9 @@ dependencies:
|
|
76
82
|
name: browse-everything
|
77
83
|
requirement: !ruby/object:Gem::Requirement
|
78
84
|
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0.10'
|
79
88
|
- - ">="
|
80
89
|
- !ruby/object:Gem::Version
|
81
90
|
version: 0.10.5
|
@@ -83,6 +92,9 @@ dependencies:
|
|
83
92
|
prerelease: false
|
84
93
|
version_requirements: !ruby/object:Gem::Requirement
|
85
94
|
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0.10'
|
86
98
|
- - ">="
|
87
99
|
- !ruby/object:Gem::Version
|
88
100
|
version: 0.10.5
|
@@ -161,6 +173,9 @@ dependencies:
|
|
161
173
|
requirement: !ruby/object:Gem::Requirement
|
162
174
|
requirements:
|
163
175
|
- - "~>"
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '3.5'
|
178
|
+
- - ">="
|
164
179
|
- !ruby/object:Gem::Version
|
165
180
|
version: 3.5.9
|
166
181
|
type: :runtime
|
@@ -168,6 +183,9 @@ dependencies:
|
|
168
183
|
version_requirements: !ruby/object:Gem::Requirement
|
169
184
|
requirements:
|
170
185
|
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '3.5'
|
188
|
+
- - ">="
|
171
189
|
- !ruby/object:Gem::Version
|
172
190
|
version: 3.5.9
|
173
191
|
- !ruby/object:Gem::Dependency
|
@@ -315,6 +333,9 @@ dependencies:
|
|
315
333
|
requirement: !ruby/object:Gem::Requirement
|
316
334
|
requirements:
|
317
335
|
- - "~>"
|
336
|
+
- !ruby/object:Gem::Version
|
337
|
+
version: '1.5'
|
338
|
+
- - ">="
|
318
339
|
- !ruby/object:Gem::Version
|
319
340
|
version: 1.5.2
|
320
341
|
type: :runtime
|
@@ -322,6 +343,9 @@ dependencies:
|
|
322
343
|
version_requirements: !ruby/object:Gem::Requirement
|
323
344
|
requirements:
|
324
345
|
- - "~>"
|
346
|
+
- !ruby/object:Gem::Version
|
347
|
+
version: '1.5'
|
348
|
+
- - ">="
|
325
349
|
- !ruby/object:Gem::Version
|
326
350
|
version: 1.5.2
|
327
351
|
- !ruby/object:Gem::Dependency
|
@@ -385,6 +409,9 @@ dependencies:
|
|
385
409
|
requirement: !ruby/object:Gem::Requirement
|
386
410
|
requirements:
|
387
411
|
- - "~>"
|
412
|
+
- !ruby/object:Gem::Version
|
413
|
+
version: '3.4'
|
414
|
+
- - ">="
|
388
415
|
- !ruby/object:Gem::Version
|
389
416
|
version: 3.4.0
|
390
417
|
type: :runtime
|
@@ -392,6 +419,9 @@ dependencies:
|
|
392
419
|
version_requirements: !ruby/object:Gem::Requirement
|
393
420
|
requirements:
|
394
421
|
- - "~>"
|
422
|
+
- !ruby/object:Gem::Version
|
423
|
+
version: '3.4'
|
424
|
+
- - ">="
|
395
425
|
- !ruby/object:Gem::Version
|
396
426
|
version: 3.4.0
|
397
427
|
- !ruby/object:Gem::Dependency
|
@@ -626,6 +656,9 @@ dependencies:
|
|
626
656
|
name: active-fedora
|
627
657
|
requirement: !ruby/object:Gem::Requirement
|
628
658
|
requirements:
|
659
|
+
- - "~>"
|
660
|
+
- !ruby/object:Gem::Version
|
661
|
+
version: '11.3'
|
629
662
|
- - ">="
|
630
663
|
- !ruby/object:Gem::Version
|
631
664
|
version: 11.3.1
|
@@ -633,6 +666,9 @@ dependencies:
|
|
633
666
|
prerelease: false
|
634
667
|
version_requirements: !ruby/object:Gem::Requirement
|
635
668
|
requirements:
|
669
|
+
- - "~>"
|
670
|
+
- !ruby/object:Gem::Version
|
671
|
+
version: '11.3'
|
636
672
|
- - ">="
|
637
673
|
- !ruby/object:Gem::Version
|
638
674
|
version: 11.3.1
|
@@ -884,14 +920,14 @@ dependencies:
|
|
884
920
|
name: rails-controller-testing
|
885
921
|
requirement: !ruby/object:Gem::Requirement
|
886
922
|
requirements:
|
887
|
-
- - "
|
923
|
+
- - ">="
|
888
924
|
- !ruby/object:Gem::Version
|
889
925
|
version: '0'
|
890
926
|
type: :development
|
891
927
|
prerelease: false
|
892
928
|
version_requirements: !ruby/object:Gem::Requirement
|
893
929
|
requirements:
|
894
|
-
- - "
|
930
|
+
- - ">="
|
895
931
|
- !ruby/object:Gem::Version
|
896
932
|
version: '0'
|
897
933
|
- !ruby/object:Gem::Dependency
|
@@ -2591,7 +2627,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2591
2627
|
version: '0'
|
2592
2628
|
requirements: []
|
2593
2629
|
rubyforge_project:
|
2594
|
-
rubygems_version: 2.
|
2630
|
+
rubygems_version: 2.6.8
|
2595
2631
|
signing_key:
|
2596
2632
|
specification_version: 4
|
2597
2633
|
summary: Hyrax is a front-end based on the robust Samvera framework, providing a user
|