roboneuro 0.1.1 → 0.1.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/.gitignore +2 -1
- data/Gemfile.lock +1 -1
- data/bin/whedon +6 -1
- data/fixtures/review_body.txt +5 -1
- data/fixtures/vcr_cassettes/review.yml +6 -2
- data/lib/whedon/auditor.rb +11 -2
- data/lib/whedon/compilers.rb +19 -4
- data/lib/whedon/processor.rb +10 -2
- data/lib/whedon/version.rb +1 -1
- data/lib/whedon.rb +10 -2
- data/paperdraft.Dockerfile +5 -1
- data/resources/NeuroLibre/latex.template +1 -1
- data/resources/NeuroLibre/logo_link.png +0 -0
- data/spec/auditor_spec.rb +6 -1
- data/spec/whedon_spec.rb +1 -1
- metadata +2 -5
- data/.DS_Store +0 -0
- data/resources/.DS_Store +0 -0
- data/resources/NeuroLibre/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78096b7533c92f42eaf738db0ec575a6b41e28af65bd4352cd0187355a6cd509
|
4
|
+
data.tar.gz: 229efd4a36c74c79d4bd13b049d5fabc490755ba1cfd3c6b4975d7d3a679f6ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1850c4dc81d2678265f2850d3b2e8eb1fe71bdfc88d0e948874ac803e7cd6f539a60c7d2a19a0401cba42e768b60a08d078bdd291320fb858f417f52fce822cd
|
7
|
+
data.tar.gz: 6bb0ccf1b8a1f58f3217505e05c548bc97efbe1f0151b397a0fabd8e6bd53be1e935ab16329933f27f218e7a369d131881ddd981b557eafe53822189c4548d8d
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/bin/whedon
CHANGED
@@ -42,7 +42,12 @@ class WhedonCli < Thor
|
|
42
42
|
def prepare(issue_id, custom_path=nil, custom_branch=nil)
|
43
43
|
review = Whedon::Review.new(issue_id)
|
44
44
|
processor = Whedon::Processor.new(issue_id, review.issue_body, custom_path)
|
45
|
-
processor.
|
45
|
+
processor.repository_doi = 'PENDING'
|
46
|
+
processor.data_doi = 'PENDING'
|
47
|
+
processor.book_doi = 'PENDING'
|
48
|
+
processor.docker_doi = 'PENDING'
|
49
|
+
processor.book_exec_url = 'PENDING'
|
50
|
+
|
46
51
|
|
47
52
|
# Optionally set the path to work in
|
48
53
|
path = custom_path ? custom_path : "tmp/#{issue_id}"
|
data/fixtures/review_body.txt
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
**Submitting author:** @zhaozhang (<a href="http://orcid.org/0000-0001-5921-0035">Zhao Zhang</a>)
|
2
2
|
**Repository:** <a href="https://github.com/applicationskeleton/Skeleton" target ="_blank">https://github.com/applicationskeleton/Skeleton</a>
|
3
3
|
**Version:** v1.2
|
4
|
-
**
|
4
|
+
**Jupyter Book:** <a href="https://neurolibre.org" target ="_blank">https://neurolibre.org</a>
|
5
|
+
**Repository archive:** <a href="http://dx.doi.org/10.5281/zenodo.13750" target ="_blank">http://dx.doi.org/10.5281/zenodo.13750</a>
|
6
|
+
**Data archive:** <a href="http://dx.doi.org/10.5281/zenodo.13750" target ="_blank">http://dx.doi.org/10.5281/zenodo.13750</a>
|
7
|
+
**Book archive:** <a href="http://dx.doi.org/10.5281/zenodo.13750" target ="_blank">http://dx.doi.org/10.5281/zenodo.13750</a>
|
8
|
+
**Docker archive:** <a href="http://dx.doi.org/10.5281/zenodo.13750" target ="_blank">http://dx.doi.org/10.5281/zenodo.13750</a>
|
5
9
|
|
6
10
|
## Status
|
7
11
|
|
@@ -80,8 +80,12 @@ http_interactions:
|
|
80
80
|
author:** @zhaozhang (<a href=\"http://orcid.org/0000-0001-5921-0035\">Zhao
|
81
81
|
Zhang</a>)\r\n**Repository:** <a href=\"https://github.com/applicationskeleton/Skeleton\"
|
82
82
|
target =\"_blank\">https://github.com/applicationskeleton/Skeleton</a>\r\n**Version:**
|
83
|
-
v1.2\r\n**Editor:** @arfon\r\n**Reviewers:** @jim, @bob\r\n**
|
84
|
-
=\"_blank\">http://dx.doi.org/10.5281/zenodo.13750</a
|
83
|
+
v1.2\r\n**Editor:** @arfon\r\n**Reviewers:** @jim, @bob\r\n**Repository archive:** <a href=\"http://dx.doi.org/10.5281/zenodo.13750\" target
|
84
|
+
=\"_blank\">http://dx.doi.org/10.5281/zenodo.13750</a>r\n**Data archive:** <a href=\"http://dx.doi.org/10.5281/zenodo.13750\" target
|
85
|
+
=\"_blank\">http://dx.doi.org/10.5281/zenodo.13750</a>r\n**Book archive:** <a href=\"http://dx.doi.org/10.5281/zenodo.13750\" target
|
86
|
+
=\"_blank\">http://dx.doi.org/10.5281/zenodo.13750</a>r\n**Docker archive:** <a href=\"http://dx.doi.org/10.5281/zenodo.13750\" target
|
87
|
+
=\"_blank\">http://dx.doi.org/10.5281/zenodo.13750</a>r\n**Jupyter Book:** <a href=\"https://neurolibre.org\" target
|
88
|
+
=\"_blank\">https://neurolibre.org</a>\r\n\r\n## Status\r\n\r\n[](http://joss.theoj.org/papers/6b34fdbf8215c1ecd4941afc8be7a7e6)\r\n\r\nStatus
|
85
89
|
badge code:\r\n\r\n```\r\nHTML: <a href=\"http://joss.theoj.org/papers/6b34fdbf8215c1ecd4941afc8be7a7e6\"><img
|
86
90
|
src=\"http://joss.theoj.org/papers/6b34fdbf8215c1ecd4941afc8be7a7e6/status.svg\"></a>\r\nMarkdown:
|
87
91
|
[]http://joss.theoj.org/papers/6b34fdbf8215c1ecd4941afc8be7a7e6\r\n```\r\n\r\n##
|
data/lib/whedon/auditor.rb
CHANGED
@@ -14,6 +14,7 @@ module Whedon
|
|
14
14
|
puts verify_version
|
15
15
|
puts verify_repository
|
16
16
|
puts verify_archive
|
17
|
+
puts verify_book
|
17
18
|
end
|
18
19
|
|
19
20
|
def verify_author
|
@@ -32,8 +33,16 @@ module Whedon
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def verify_archive
|
35
|
-
|
36
|
-
|
36
|
+
archive_repository = review_body[ARCHIVE_REPOSITORY_REGEX]
|
37
|
+
archive_data = review_body[ARCHIVE_DATA_REGEX]
|
38
|
+
archive_book = review_body[ARCHIVE_BOOK_REGEX]
|
39
|
+
archive_docker = review_body[ARCHIVE_DOCKER_REGEX]
|
40
|
+
return "Repository archive: #{archive_repository} Data archive: #{archive_data} Book archive: #{archive_book} Docker archive: #{archive_docker}" if archive_repository && archive_book && archive_data && archive_docker
|
41
|
+
end
|
42
|
+
|
43
|
+
def verify_book
|
44
|
+
book = review_body[BOOK_EXEC_REGEX]
|
45
|
+
return "Jupyter Book: #{book}"
|
37
46
|
end
|
38
47
|
end
|
39
48
|
end
|
data/lib/whedon/compilers.rb
CHANGED
@@ -106,6 +106,7 @@ module Compilers
|
|
106
106
|
def pdf_from_markdown(custom_branch=nil, draft=true, paper_issue=nil, paper_volume=nil, paper_year=nil)
|
107
107
|
latex_template_path = "#{Whedon.resources}/#{ENV['JOURNAL_ALIAS']}/latex.template"
|
108
108
|
csl_file = "#{Whedon.resources}/#{ENV['JOURNAL_ALIAS']}/apa.csl"
|
109
|
+
book_exec_icon = "#{Whedon.resources}/#{ENV['JOURNAL_ALIAS']}/logo_link.png"
|
109
110
|
|
110
111
|
url = "#{ENV['JOURNAL_URL']}/papers/lookup/#{@review_issue_id}"
|
111
112
|
response = RestClient.get(url)
|
@@ -142,7 +143,12 @@ module Compilers
|
|
142
143
|
|
143
144
|
metadata = {
|
144
145
|
"repository" => repository_address,
|
145
|
-
"
|
146
|
+
"repository_doi" => repository_doi,
|
147
|
+
"data_doi" => data_doi,
|
148
|
+
"book_doi" => book_doi,
|
149
|
+
"docker_doi" => docker_doi,
|
150
|
+
"book_exec_url" => book_exec_url,
|
151
|
+
"book_exec_icon" => book_exec_icon,
|
146
152
|
"paper_url" => paper.pdf_url,
|
147
153
|
"journal_name" => ENV['JOURNAL_NAME'],
|
148
154
|
"review_issue_url" => paper.review_issue_url,
|
@@ -167,7 +173,12 @@ module Compilers
|
|
167
173
|
|
168
174
|
`cd #{paper.directory} && pandoc \
|
169
175
|
-V repository="#{repository_address}" \
|
170
|
-
-V
|
176
|
+
-V repository_doi="#{repository_doi}" \
|
177
|
+
-V data_doi="#{data_doi}" \
|
178
|
+
-V book_doi="#{book_doi}" \
|
179
|
+
-V docker_doi="#{docker_doi}" \
|
180
|
+
-V book_exec_url="#{book_exec_url}" \
|
181
|
+
-V book_exec_icon="#{book_exec_icon}" \
|
171
182
|
-V review_issue_url="#{paper.review_issue_url}" \
|
172
183
|
-V editor_url="#{editor_url}" \
|
173
184
|
-V graphics="true" \
|
@@ -182,7 +193,7 @@ module Compilers
|
|
182
193
|
if File.exists?("#{paper.directory}/#{paper.filename_doi}.pdf")
|
183
194
|
puts "#{paper.directory}/#{paper.filename_doi}.pdf"
|
184
195
|
else
|
185
|
-
abort("Looks like we failed to compile the PDF")
|
196
|
+
abort("Looks like we failed to compile the PDF :/")
|
186
197
|
end
|
187
198
|
end
|
188
199
|
|
@@ -280,7 +291,11 @@ module Compilers
|
|
280
291
|
"timestamp" => Time.now.strftime('%Y%m%d%H%M%S'),
|
281
292
|
"doi_batch_id" => generate_doi_batch_id,
|
282
293
|
"formatted_doi" => paper.formatted_doi,
|
283
|
-
"
|
294
|
+
"repository_doi" => repository_doi,
|
295
|
+
"data_doi" => data_doi,
|
296
|
+
"book_doi" => book_doi,
|
297
|
+
"docker_doi" => docker_doi,
|
298
|
+
"book_exec_url" => book_exec_url,
|
284
299
|
"review_issue_url" => paper.review_issue_url,
|
285
300
|
"paper_url" => paper.pdf_url,
|
286
301
|
"joss_resource_url" => paper.joss_resource_url,
|
data/lib/whedon/processor.rb
CHANGED
@@ -12,7 +12,11 @@ module Whedon
|
|
12
12
|
attr_accessor :review_issue_id
|
13
13
|
attr_accessor :review_body
|
14
14
|
attr_accessor :repository_address
|
15
|
-
attr_accessor :
|
15
|
+
attr_accessor :repository_doi
|
16
|
+
attr_accessor :data_doi
|
17
|
+
attr_accessor :book_exec_url
|
18
|
+
attr_accessor :book_doi
|
19
|
+
attr_accessor :docker_doi
|
16
20
|
attr_accessor :paper_path
|
17
21
|
attr_accessor :xml_path
|
18
22
|
attr_accessor :doi_batch_id
|
@@ -26,7 +30,11 @@ module Whedon
|
|
26
30
|
@review_issue_id = review_issue_id
|
27
31
|
@review_body = review_body
|
28
32
|
@repository_address = review_body[REPO_REGEX]
|
29
|
-
@
|
33
|
+
@repository_doi = review_body[ARCHIVE_REPOSITORY_REGEX]
|
34
|
+
@data_doi = review_body[ARCHIVE_DATA_REGEX]
|
35
|
+
@book_doi = review_body[ARCHIVE_BOOK_REGEX]
|
36
|
+
@docker_doi = review_body[ARCHIVE_DOCKER_REGEX]
|
37
|
+
@book_exec_url = review_body[BOOK_EXEC_REGEX]
|
30
38
|
@custom_path = custom_path
|
31
39
|
# Probably a much nicer way to do this...
|
32
40
|
@current_year = ENV["CURRENT_YEAR"].nil? ? Time.new.year : ENV["CURRENT_YEAR"]
|
data/lib/whedon/version.rb
CHANGED
data/lib/whedon.rb
CHANGED
@@ -32,7 +32,12 @@ module Whedon
|
|
32
32
|
AUTHOR_REGEX = /(?<=\*\*Submitting author:\*\*\s)(\S+)/
|
33
33
|
REPO_REGEX = /(?<=\*\*Repository:\*\*.<a\shref=)"(.*?)"/
|
34
34
|
VERSION_REGEX = /(?<=\*\*Version:\*\*\s)(\S+)/
|
35
|
-
|
35
|
+
ARCHIVE_REPOSITORY_REGEX = /(?<=\*\*Repository archive:\*\*.<a\shref=)"(.*?)"/
|
36
|
+
ARCHIVE_DATA_REGEX = /(?<=\*\*Data archive:\*\*.<a\shref=)"(.*?)"/
|
37
|
+
ARCHIVE_BOOK_REGEX = /(?<=\*\*Book archive:\*\*.<a\shref=)"(.*?)"/
|
38
|
+
ARCHIVE_DOCKER_REGEX = /(?<=\*\*Docker archive:\*\*.<a\shref=)"(.*?)"/
|
39
|
+
BOOK_EXEC_REGEX = /(?<=\*\*Jupyter Book:\*\*.<a\shref=)"(.*?)"/
|
40
|
+
|
36
41
|
|
37
42
|
class Paper
|
38
43
|
include GitHub
|
@@ -176,7 +181,10 @@ module Whedon
|
|
176
181
|
%w(title tags languages).each { |var| payload['paper'][var] = self.send(var) }
|
177
182
|
payload['paper']['authors'] = authors.collect { |a| a.to_h }
|
178
183
|
payload['paper']['doi'] = formatted_doi
|
179
|
-
payload['paper']['
|
184
|
+
payload['paper']['repository_doi'] = review_issue_body[ARCHIVE_REPOSITORY_REGEX].gsub('"', '')
|
185
|
+
payload['paper']['data_doi'] = review_issue_body[ARCHIVE_DATA_REGEX].gsub('"', '')
|
186
|
+
payload['paper']['book_doi'] = review_issue_body[ARCHIVE_BOOK_REGEX].gsub('"', '')
|
187
|
+
payload['paper']['docker_doi'] = review_issue_body[ARCHIVE_DOCKER_REGEX].gsub('"', '')
|
180
188
|
payload['paper']['repository_address'] = review_issue_body[REPO_REGEX].gsub('"', '')
|
181
189
|
payload['paper']['editor'] = "@#{editor}"
|
182
190
|
payload['paper']['reviewers'] = reviewers.collect(&:strip)
|
data/paperdraft.Dockerfile
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
FROM pandoc/latex:2.11.2
|
2
2
|
|
3
3
|
# Update tlmgr
|
4
|
-
RUN tlmgr
|
4
|
+
RUN tlmgr repository add ftp://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2021/tlnet-final; \
|
5
|
+
tlmgr repository list; \
|
6
|
+
tlmgr repository remove http://mirror.ctan.org/systems/texlive/tlnet; \
|
7
|
+
tlmgr option repository ftp://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2021/tlnet-final; \
|
8
|
+
tlmgr update --self
|
5
9
|
|
6
10
|
# Install additional LaTeX packages
|
7
11
|
RUN tlmgr install \
|
Binary file
|
data/spec/auditor_spec.rb
CHANGED
@@ -17,6 +17,11 @@ describe Whedon::Auditor do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "knows how to find the archive from the issue body" do
|
20
|
-
expect(subject.verify_archive).to eql("
|
20
|
+
expect(subject.verify_archive).to eql("Repository archive: \"http://dx.doi.org/10.5281/zenodo.13750\" Data archive: \"http://dx.doi.org/10.5281/zenodo.13750\" Book archive: \"http://dx.doi.org/10.5281/zenodo.13750\" Docker archive: \"http://dx.doi.org/10.5281/zenodo.13750\"")
|
21
|
+
end
|
22
|
+
|
23
|
+
it "knows how to find the Jupyter Book from the issue body" do
|
24
|
+
expect(subject.verify_book).to eql("Jupyter Book: \"https://neurolibre.org\"")
|
21
25
|
end
|
22
26
|
end
|
27
|
+
|
data/spec/whedon_spec.rb
CHANGED
@@ -85,7 +85,7 @@ describe Whedon do
|
|
85
85
|
|
86
86
|
it "should know how to generate the deposit_payload" do
|
87
87
|
VCR.use_cassette('review') do
|
88
|
-
%w{title tags languages authors doi
|
88
|
+
%w{title tags languages authors doi repository_doi data_doi book_doi docker_doi repository_address editor reviewers}.each do |attribute|
|
89
89
|
expect(paper_with_harder_names.deposit_payload['paper'][attribute].nil?).to be_falsey
|
90
90
|
end
|
91
91
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roboneuro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agah Karakuzu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bibtex-ruby
|
@@ -270,7 +270,6 @@ executables:
|
|
270
270
|
extensions: []
|
271
271
|
extra_rdoc_files: []
|
272
272
|
files:
|
273
|
-
- ".DS_Store"
|
274
273
|
- ".env-example"
|
275
274
|
- ".env.test"
|
276
275
|
- ".github/workflows/docker-image.yml"
|
@@ -316,8 +315,6 @@ files:
|
|
316
315
|
- lib/whedon/version.rb
|
317
316
|
- paperdraft.Dockerfile
|
318
317
|
- pkg/roboneuro-0.1.0.gem
|
319
|
-
- resources/.DS_Store
|
320
|
-
- resources/NeuroLibre/.DS_Store
|
321
318
|
- resources/NeuroLibre/aas-logo.png
|
322
319
|
- resources/NeuroLibre/apa.csl
|
323
320
|
- resources/NeuroLibre/defaults.yaml
|
data/.DS_Store
DELETED
Binary file
|
data/resources/.DS_Store
DELETED
Binary file
|
Binary file
|