ebsco-eds 1.0.1 → 1.0.2
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/CHANGELOG.md +7 -8
- data/lib/ebsco/eds/citations.rb +74 -2
- data/lib/ebsco/eds/configuration.rb +2 -1
- data/lib/ebsco/eds/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: 42a5c889f404eaac591fe266e49bc3b22f9d1dcd
|
|
4
|
+
data.tar.gz: b046859c4a40ab2d14b5d1e61193afbda1fc9f15
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 153cda1a6a05db24fb952b1a6cf868d1c545364c53137b28b856ffbb121bcad10b1cf0dbe02ffdd39e0310529b595375abaf43f9ca773ea2e2f8fa85bade68bd
|
|
7
|
+
data.tar.gz: 62b221b0c0bbcaebff457ce31d87caddba1bbaec9a127f60dacda1a3e0a2cfef93898bc490558b7e094f8f0cf123bd2bcb72a315888d489af72818350302ad9d
|
data/CHANGELOG.md
CHANGED
|
@@ -4,14 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
-
## [
|
|
8
|
-
|
|
7
|
+
## [1.0.2] - 2018-10-15
|
|
9
8
|
### Added
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
### Removed
|
|
13
|
-
### Fixed
|
|
14
|
-
### Security
|
|
9
|
+
- EBSCOhost links are removed from citation styles and exports by default
|
|
10
|
+
|
|
15
11
|
|
|
16
12
|
## [1.0.1] - 2018-10-10
|
|
17
13
|
### Added
|
|
@@ -69,4 +65,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
69
65
|
|
|
70
66
|
## [0.3.11.pre] - 2017-09-06
|
|
71
67
|
### Added
|
|
72
|
-
- Adds KW (keywords) and SH (subject heading) to solr search fields
|
|
68
|
+
- Adds KW (keywords) and SH (subject heading) to solr search fields
|
|
69
|
+
|
|
70
|
+
[1.0.2]: https://github.com/ebsco/edsapi-ruby/compare/1.0.1...1.0.2
|
|
71
|
+
[1.0.1]: https://github.com/ebsco/edsapi-ruby/compare/1.0.0...1.0.1
|
data/lib/ebsco/eds/citations.rb
CHANGED
|
@@ -9,6 +9,15 @@ module EBSCO
|
|
|
9
9
|
|
|
10
10
|
def initialize(dbid:, an:, citation_result:, eds_config: nil)
|
|
11
11
|
|
|
12
|
+
# remove links?
|
|
13
|
+
(ENV.has_key? 'EDS_REMOVE_CITATION_LINKS') ?
|
|
14
|
+
if %w(y Y yes Yes true True).include?(ENV['EDS_REMOVE_CITATION_LINKS'])
|
|
15
|
+
@remove_links = true
|
|
16
|
+
else
|
|
17
|
+
@remove_links = false
|
|
18
|
+
end :
|
|
19
|
+
@remove_links = eds_config[:remove_citation_links]
|
|
20
|
+
|
|
12
21
|
@eds_database_id = dbid
|
|
13
22
|
@eds_accession_number = an
|
|
14
23
|
@eds_record_id = @eds_database_id + '__' + @eds_accession_number
|
|
@@ -30,7 +39,11 @@ module EBSCO
|
|
|
30
39
|
end
|
|
31
40
|
|
|
32
41
|
if style.key? 'Data'
|
|
33
|
-
|
|
42
|
+
data = JSON.parse(style['Data'].to_json)
|
|
43
|
+
if @remove_links
|
|
44
|
+
data = removeLinksFromStyles(data)
|
|
45
|
+
end
|
|
46
|
+
item['data'] = data
|
|
34
47
|
end
|
|
35
48
|
|
|
36
49
|
if style.key? 'Caption'
|
|
@@ -62,7 +75,11 @@ module EBSCO
|
|
|
62
75
|
end
|
|
63
76
|
|
|
64
77
|
if citation_result.key? 'Data'
|
|
65
|
-
|
|
78
|
+
data = JSON.parse(citation_result['Data'].to_json)
|
|
79
|
+
if @remove_links
|
|
80
|
+
data = removeLinksFromExports(data)
|
|
81
|
+
end
|
|
82
|
+
item['data'] = data
|
|
66
83
|
end
|
|
67
84
|
|
|
68
85
|
if citation_result.key? 'Error'
|
|
@@ -75,6 +92,61 @@ module EBSCO
|
|
|
75
92
|
|
|
76
93
|
end
|
|
77
94
|
|
|
95
|
+
|
|
96
|
+
def removeLinksFromStyles(citation)
|
|
97
|
+
|
|
98
|
+
# 1. abnt
|
|
99
|
+
#
|
|
100
|
+
# CHITEA, F. Electrical Signatures of Mud Volcanoes Case Studies from Romania. <b>Proceedings of the International Multidisciplinary Scientific GeoConference SGEM</b>, jul. 2016. v. 3, p. 467–474. Disponível em: <http://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=asn&AN=118411536>. Acesso em: 15 out. 2018.
|
|
101
|
+
#
|
|
102
|
+
# 2. ama
|
|
103
|
+
# <i>Caplacizumab for Acquired Thrombotic Thrombocytopenic Purpura</i>. Germany, Europe: Massachusetts Medical Society; 2016. http://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=edsbas&AN=edsbas.AA261780. Accessed October 12, 2018.
|
|
104
|
+
#
|
|
105
|
+
# 3. apa
|
|
106
|
+
# <i>Caplacizumab for Acquired Thrombotic Thrombocytopenic Purpura</i>. (2016). Germany, Europe: Massachusetts Medical Society. Retrieved from http://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=edsbas&AN=edsbas.AA261780
|
|
107
|
+
#
|
|
108
|
+
# 4. chicago
|
|
109
|
+
# <i>Caplacizumab for Acquired Thrombotic Thrombocytopenic Purpura</i>. 2016. Germany, Europe: Massachusetts Medical Society. http://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=edsbas&AN=edsbas.AA261780.
|
|
110
|
+
#
|
|
111
|
+
# 5. harvard
|
|
112
|
+
# <i>Caplacizumab for Acquired Thrombotic Thrombocytopenic Purpura</i> (2016). Germany, Europe: Massachusetts Medical Society. Available at: http://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=edsbas&AN=edsbas.AA261780 (Accessed: 12 October 2018).
|
|
113
|
+
#
|
|
114
|
+
# 6. harvardaustralian
|
|
115
|
+
# <i>Caplacizumab for Acquired Thrombotic Thrombocytopenic Purpura</i> 2016, Massachusetts Medical Society, Germany, Europe, viewed 12 October 2018, <http://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=edsbas&AN=edsbas.AA261780>.
|
|
116
|
+
#
|
|
117
|
+
# 7. mla
|
|
118
|
+
# <i>Caplacizumab for Acquired Thrombotic Thrombocytopenic Purpura</i>. Massachusetts Medical Society, 2016. <i>EBSCOhost</i>, search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=edsbas&AN=edsbas.AA261780.
|
|
119
|
+
#
|
|
120
|
+
# 8. turbanian
|
|
121
|
+
# <i>Caplacizumab for Acquired Thrombotic Thrombocytopenic Purpura</i>. Germany, Europe: Massachusetts Medical Society, 2016. http://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=edsbas&AN=edsbas.AA261780.
|
|
122
|
+
#
|
|
123
|
+
# 9. vancouver
|
|
124
|
+
# Caplacizumab for Acquired Thrombotic Thrombocytopenic Purpura [Internet]. Germany, Europe: Massachusetts Medical Society; 2016 [cited 2018 Oct 12]. Available from: http://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=edsbas&AN=edsbas.AA261780
|
|
125
|
+
#
|
|
126
|
+
#
|
|
127
|
+
#
|
|
128
|
+
#
|
|
129
|
+
if citation
|
|
130
|
+
citation.gsub!(/[.,]\s+(<i>EBSCOhost|viewed|Available|Retrieved from|http:\/\/search.ebscohost.com|Disponível em).+$/, '.')
|
|
131
|
+
end
|
|
132
|
+
citation
|
|
133
|
+
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def removeLinksFromExports(citation)
|
|
137
|
+
|
|
138
|
+
# 1. RIS
|
|
139
|
+
# UR - http://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=edsbas&AN=edsbas.AA261780
|
|
140
|
+
# DP - EBSCOhost
|
|
141
|
+
#
|
|
142
|
+
if citation
|
|
143
|
+
citation.gsub!(/UR\s+-\s+http:\/\/search\.ebscohost\.com.+\s+/,'')
|
|
144
|
+
citation.gsub!(/DP\s+-\s+EBSCOhost\s+/, '')
|
|
145
|
+
end
|
|
146
|
+
citation
|
|
147
|
+
|
|
148
|
+
end
|
|
149
|
+
|
|
78
150
|
end
|
|
79
151
|
end
|
|
80
152
|
end
|
|
@@ -45,7 +45,8 @@ module EBSCO
|
|
|
45
45
|
:recover_from_bad_source_type => false,
|
|
46
46
|
:all_subjects_search_links => false,
|
|
47
47
|
:decode_sanitize_html => false,
|
|
48
|
-
:titleize_facets => false
|
|
48
|
+
:titleize_facets => false,
|
|
49
|
+
:remove_citation_links => true
|
|
49
50
|
}
|
|
50
51
|
@valid_config_keys = @config.keys
|
|
51
52
|
end
|
data/lib/ebsco/eds/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ebsco-eds
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bill McKinney
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2018-10-
|
|
12
|
+
date: 2018-10-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: faraday
|