theoj 1.1.1 → 1.2.0
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 -0
- data/lib/theoj/journal.rb +8 -0
- data/lib/theoj/published_paper.rb +1 -1
- data/lib/theoj/review_issue.rb +1 -1
- data/lib/theoj/submission.rb +62 -0
- data/lib/theoj/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9c9c517ea91deba2fcbca39a4098266b8b2adcf749de0c1803c0c36905d54d9
|
4
|
+
data.tar.gz: 1a4877b0a9e1bb9d58ceebf7a5bbca8cdaefcc2f35a7cbe2696570c828e6d96c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f6661c7163fedb8ba1248b2e1861c6a9f2c842ccfa2a4824fa42cd660ce7660c13b7097728c4078881748d3d69898a78f594717dffcfce08e6cb957e2c7a382
|
7
|
+
data.tar.gz: 2c812174f9bfd07155ada8ee909dca12a10398f05c042092d014b3401efecba59f9d9c3a2213fdd626a40b06d84156eadbe675e9877ce5950ec3c991b902d159
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.2.0 (2021-11-23)
|
4
|
+
|
5
|
+
- Added reviews_repository_url to Journal
|
6
|
+
- Added article_metadata to Submission
|
7
|
+
- Added editor and paper dates lookup information in Submission
|
8
|
+
- Fixed error reading reviewers list from issue body
|
9
|
+
|
3
10
|
## 1.1.1 (2021-11-05)
|
4
11
|
|
5
12
|
- Added support for test-journal
|
data/lib/theoj/journal.rb
CHANGED
@@ -34,6 +34,14 @@ module Theoj
|
|
34
34
|
"#@doi_prefix/#{paper_id}"
|
35
35
|
end
|
36
36
|
|
37
|
+
def reviews_repository_url(issue_id=nil)
|
38
|
+
reviews_url = "https://github.com/#{data[:reviews_repository]}"
|
39
|
+
if issue_id
|
40
|
+
reviews_url += "/issues/" + issue_id.to_s
|
41
|
+
end
|
42
|
+
reviews_url
|
43
|
+
end
|
44
|
+
|
37
45
|
private
|
38
46
|
|
39
47
|
def set_data(custom_data)
|
data/lib/theoj/review_issue.rb
CHANGED
@@ -28,7 +28,7 @@ module Theoj
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def reviewers
|
31
|
-
@reviewers ||= read_value_from_body("reviewers").split(",").map{|r| r.strip} - ["Pending", "TBD"]
|
31
|
+
@reviewers ||= read_value_from_body("reviewers-list").split(",").map{|r| r.strip} - ["Pending", "TBD"]
|
32
32
|
end
|
33
33
|
|
34
34
|
def editor
|
data/lib/theoj/submission.rb
CHANGED
@@ -4,6 +4,8 @@ require "faraday"
|
|
4
4
|
|
5
5
|
module Theoj
|
6
6
|
class Submission
|
7
|
+
include Theoj::GitHub
|
8
|
+
|
7
9
|
attr_accessor :journal
|
8
10
|
attr_accessor :review_issue
|
9
11
|
attr_accessor :paper
|
@@ -49,6 +51,66 @@ module Theoj
|
|
49
51
|
metadata.to_json
|
50
52
|
end
|
51
53
|
|
54
|
+
# Create metadata used to generate PDF/JATS outputs
|
55
|
+
def article_metadata
|
56
|
+
metadata = {
|
57
|
+
title: paper.title,
|
58
|
+
tags: paper.tags,
|
59
|
+
languages: paper.languages,
|
60
|
+
authors: paper.authors.collect { |a| a.to_h },
|
61
|
+
doi: paper_doi,
|
62
|
+
software_repository_url: review_issue.target_repository,
|
63
|
+
reviewers: review_issue.reviewers.collect(&:strip),
|
64
|
+
volume: journal.current_volume,
|
65
|
+
issue: journal.current_issue,
|
66
|
+
year: journal.current_year,
|
67
|
+
page: review_issue.issue_id,
|
68
|
+
journal_alias: journal.alias,
|
69
|
+
software_review_url: journal.reviews_repository_url(review_issue.issue_id),
|
70
|
+
archive_doi: review_issue.archive,
|
71
|
+
citation_string: citation_string
|
72
|
+
}
|
73
|
+
|
74
|
+
metadata.merge(editor_info, dates_info)
|
75
|
+
end
|
76
|
+
|
77
|
+
def editor_info
|
78
|
+
editor_info = { editor: {
|
79
|
+
github_user: review_issue.editor,
|
80
|
+
name: nil,
|
81
|
+
url: nil,
|
82
|
+
orcid: nil
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
if review_issue.editor
|
87
|
+
editor_lookup = Faraday.get(journal.url + "/editors/lookup/" + user_login(review_issue.editor))
|
88
|
+
if editor_lookup.status == 200
|
89
|
+
info = JSON.parse(editor_lookup.body, symbolize_names: true)
|
90
|
+
editor_info[:editor][:name] = info[:name]
|
91
|
+
editor_info[:editor][:url] = info[:url]
|
92
|
+
editor_info[:editor][:orcid] = info[:orcid]
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
editor_info
|
97
|
+
end
|
98
|
+
|
99
|
+
def dates_info
|
100
|
+
dates_info = { submitted_at: nil, published_at: nil }
|
101
|
+
|
102
|
+
if review_issue.issue_id
|
103
|
+
paper_lookup = Faraday.get(journal.url + "/papers/lookup/" + review_issue.issue_id.to_s)
|
104
|
+
if paper_lookup.status == 200
|
105
|
+
info = JSON.parse(paper_lookup.body, symbolize_names: true)
|
106
|
+
dates_info[:submitted_at] = info[:submitted]
|
107
|
+
dates_info[:published_at] = info[:accepted]
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
dates_info
|
112
|
+
end
|
113
|
+
|
52
114
|
def deposit!(secret)
|
53
115
|
parameters = deposit_payload.merge(secret: secret)
|
54
116
|
Faraday.post(journal.data[:deposit_url], parameters.to_json, {"Content-Type" => "application/json"})
|
data/lib/theoj/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theoj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juanjo Bazán
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|