Skip to content

Commit

Permalink
better handling of crossref titles. crosscite#102
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Oct 11, 2020
1 parent 1f0072f commit 7146efd
Show file tree
Hide file tree
Showing 85 changed files with 2,574 additions and 1,469 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem "iso8601", "~> 0.9.0"
gem "maremma", "~> 4.7.1"
gem "faraday", "~> 0.17.3"
gem "bolognese", "~> 1.7"
gem "json-ld-preloaded", "~> 3.1", ">= 3.1.3"
gem "dalli", "~> 2.7.6"
gem "lograge", "~> 0.11.2"
gem "logstash-event", "~> 1.2", ">= 1.2.02"
Expand Down
126 changes: 64 additions & 62 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.4.3)
actionpack (= 5.2.4.3)
actioncable (5.2.4.4)
actionpack (= 5.2.4.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.4.3)
actionpack (= 5.2.4.3)
actionview (= 5.2.4.3)
activejob (= 5.2.4.3)
actionmailer (5.2.4.4)
actionpack (= 5.2.4.4)
actionview (= 5.2.4.4)
activejob (= 5.2.4.4)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.4.3)
actionview (= 5.2.4.3)
activesupport (= 5.2.4.3)
actionpack (5.2.4.4)
actionview (= 5.2.4.4)
activesupport (= 5.2.4.4)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.4.3)
activesupport (= 5.2.4.3)
actionview (5.2.4.4)
activesupport (= 5.2.4.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.4.3)
activesupport (= 5.2.4.3)
activejob (5.2.4.4)
activesupport (= 5.2.4.4)
globalid (>= 0.3.6)
activemodel (5.2.4.3)
activesupport (= 5.2.4.3)
activerecord (5.2.4.3)
activemodel (= 5.2.4.3)
activesupport (= 5.2.4.3)
activemodel (5.2.4.4)
activesupport (= 5.2.4.4)
activerecord (5.2.4.4)
activemodel (= 5.2.4.4)
activesupport (= 5.2.4.4)
arel (>= 9.0)
activestorage (5.2.4.3)
actionpack (= 5.2.4.3)
activerecord (= 5.2.4.3)
activestorage (5.2.4.4)
actionpack (= 5.2.4.4)
activerecord (= 5.2.4.4)
marcel (~> 0.3.1)
activesupport (5.2.4.3)
activesupport (5.2.4.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -47,15 +47,15 @@ GEM
arel (9.0.0)
ast (2.4.1)
benchmark_methods (0.7)
better_errors (2.7.1)
better_errors (2.8.3)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
bibtex-ruby (5.1.4)
latex-decode (~> 0.0)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
bolognese (1.7.3)
bolognese (1.8.10)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
bibtex-ruby (>= 5.1.0)
Expand All @@ -79,7 +79,7 @@ GEM
postrank-uri (~> 1.0, >= 1.0.18)
rdf-rdfxml (~> 3.1)
rdf-turtle (~> 3.1)
thor (~> 1.0, >= 1.0.1)
thor (>= 0.19)
builder (3.2.4)
capybara (3.33.0)
addressable
Expand All @@ -96,21 +96,22 @@ GEM
csl (~> 1.5)
coderay (1.1.3)
colorize (0.8.1)
concurrent-ruby (1.1.6)
crack (0.4.3)
safe_yaml (~> 1.0.0)
concurrent-ruby (1.1.7)
crack (0.4.4)
crass (1.0.6)
csl (1.5.1)
namae (~> 1.0)
csl-styles (1.0.1.10)
csl (~> 1.0)
dalli (2.7.10)
dalli (2.7.11)
debug_inspector (0.0.3)
diff-lcs (1.4.4)
docile (1.3.2)
dotenv (2.7.6)
ebnf (1.2.0)
ebnf (2.1.1)
htmlentities (~> 4.3)
rdf (~> 3.1)
scanf (~> 1.0)
sxp (~> 1.1)
edtf (3.0.5)
activesupport (>= 3.0, < 7.0)
Expand All @@ -131,14 +132,14 @@ GEM
rchardet (~> 1.8)
globalid (0.4.2)
activesupport (>= 4.2.0)
haml (5.1.2)
haml (5.2.0)
temple (>= 0.8.0)
tilt
hamster (3.0.0)
concurrent-ruby (~> 1.0)
hashdiff (1.0.1)
htmlentities (4.3.4)
i18n (1.8.3)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
iso8601 (0.9.1)
jaro_winkler (1.5.4)
Expand Down Expand Up @@ -170,14 +171,14 @@ GEM
logstash-event (1.2.02)
logstash-logger (0.26.1)
logstash-event (~> 1.2)
loofah (2.6.0)
loofah (2.7.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
maremma (4.7.1)
maremma (4.7.2)
activesupport (>= 4.2.5)
addressable (>= 2.3.6)
builder (~> 3.2, >= 3.2.2)
Expand All @@ -192,18 +193,18 @@ GEM
mimemagic (0.3.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.14.1)
minitest (5.14.2)
multi_json (1.15.0)
multipart-post (2.1.1)
namae (1.0.1)
nio4r (2.5.2)
nio4r (2.5.4)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
oj (3.10.6)
oj (3.10.14)
oj_mimic_json (1.0.1)
optimist (3.0.1)
parallel (1.19.2)
parser (2.7.1.4)
parser (2.7.2.0)
ast (~> 2.4.1)
postrank-uri (1.0.24)
addressable (>= 2.4.0)
Expand All @@ -215,27 +216,27 @@ GEM
rack (>= 2.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.4.3)
actioncable (= 5.2.4.3)
actionmailer (= 5.2.4.3)
actionpack (= 5.2.4.3)
actionview (= 5.2.4.3)
activejob (= 5.2.4.3)
activemodel (= 5.2.4.3)
activerecord (= 5.2.4.3)
activestorage (= 5.2.4.3)
activesupport (= 5.2.4.3)
rails (5.2.4.4)
actioncable (= 5.2.4.4)
actionmailer (= 5.2.4.4)
actionpack (= 5.2.4.4)
actionview (= 5.2.4.4)
activejob (= 5.2.4.4)
activemodel (= 5.2.4.4)
activerecord (= 5.2.4.4)
activestorage (= 5.2.4.4)
activesupport (= 5.2.4.4)
bundler (>= 1.3.0)
railties (= 5.2.4.3)
railties (= 5.2.4.4)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (5.2.4.3)
actionpack (= 5.2.4.3)
activesupport (= 5.2.4.3)
railties (5.2.4.4)
actionpack (= 5.2.4.4)
activesupport (= 5.2.4.4)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
Expand All @@ -245,7 +246,7 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
rchardet (1.8.0)
rdf (3.1.4)
rdf (3.1.6)
hamster (~> 3.0)
link_header (~> 0.0, >= 0.0.8)
rdf-aggregate-repo (3.1.0)
Expand All @@ -262,17 +263,17 @@ GEM
rdf (~> 3.1)
rdf-rdfa (~> 3.1)
rdf-xsd (~> 3.1)
rdf-turtle (3.1.1)
ebnf (~> 1.2)
rdf-turtle (3.1.2)
ebnf (~> 2.0)
rdf (~> 3.1, >= 3.1.2)
rdf-vocab (3.1.7)
rdf-vocab (3.1.8)
rdf (~> 3.1, >= 3.1.2)
rdf-xsd (3.1.0)
rdf (~> 3.1)
regexp_parser (1.7.1)
regexp_parser (1.8.1)
request_store (1.5.0)
rack (>= 1.4)
rspec-core (3.9.2)
rspec-core (3.9.3)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0)
Expand Down Expand Up @@ -303,22 +304,22 @@ GEM
rack (>= 1.1)
rubocop (>= 0.72.0)
ruby-progressbar (1.10.1)
safe_yaml (1.0.5)
scanf (1.0.0)
sentry-raven (2.13.0)
faraday (>= 0.7.6, < 1.0)
simplecov (0.17.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
spring (2.1.0)
spring (2.1.1)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
Expand All @@ -333,7 +334,7 @@ GEM
unicode-display_width (1.6.1)
unicode_utils (1.4.0)
vcr (3.0.3)
webmock (3.8.3)
webmock (3.9.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand All @@ -358,6 +359,7 @@ DEPENDENCIES
gender_detector (~> 0.1.2)
git (~> 1.5)
iso8601 (~> 0.9.0)
json-ld-preloaded (~> 3.1, >= 3.1.3)
listen (~> 3.0.5)
lograge (~> 0.11.2)
logstash-event (~> 1.2, >= 1.2.02)
Expand Down
18 changes: 18 additions & 0 deletions spec/api/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,24 @@
expect(response["type"]).to eq("article-journal")
end

it "header crossref" do
get "/10.1186/1471-2164-7-187", nil, { "HTTP_ACCEPT" => "application/vnd.citationstyles.csl+json" }

expect(last_response.status).to eq(200)
response = JSON.parse(last_response.body)
expect(response["type"]).to eq("article-journal")
expect(response["title"]).to eq("Finding function: evaluation methods for functional genomic data")
end

it "link crossref" do
get "/application/vnd.citationstyles.csl+json/10.1186/1471-2164-7-187"

expect(last_response.status).to eq(200)
response = JSON.parse(last_response.body)
expect(response["type"]).to eq("article-journal")
expect(response["title"]).to eq("Finding function: evaluation methods for functional genomic data")
end

# it "doi with + character" do
# doi = "10.14454/terra+aqua/ceres/cldtyphist_l3.004"
# get "/#{doi}", nil, { "HTTP_ACCEPT" => "application/vnd.citationstyles.csl+json" }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7146efd

Please sign in to comment.