theoj 1.4.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9486cf3fe9aaf56c43efbe6123016ce9b90a054398b2cd936b3bb5dbe4d31f2a
4
- data.tar.gz: 8709e9a5baa199b67f6debe4e2cc839fd4d7a892f6ecf8997449c119b655a9b3
3
+ metadata.gz: 21d76f6633f14e9e22090bfd9eb08ab9cd5ccb7a9d2d6fbd44faca24a25fe431
4
+ data.tar.gz: dfb1f9b6a104c863b0d44cf56c3b04b07a475819bd9c35a8efb498bec7babf95
5
5
  SHA512:
6
- metadata.gz: 896db89c08cf36344bcd312ed433b63ea759f232b7892ec3ae3711f92e40247aed257dba1a04e03d33de9bd4acde2e0ab17fcea2d3d436593dfa04b5878966a0
7
- data.tar.gz: 6dd748505af068cbe1019e621419ce0dbae212f9eefec025554e5ee4afb670b819082a98c30bd5ca08379582e6eb69b14b69dadf5e565c76eb16c8331ab02668
6
+ metadata.gz: a504520a70a9020bab23d881496a04585b305f8ca368652fd5929d762a48d64a74d09f16bd0db89216c04e084a485692f0192575e7daba3c3d54d3ca085b89f2
7
+ data.tar.gz: 6a3d7e059fe578e4c5b3ecb6a0b325a8136de07df7684fc3b4a82c6c538d7eedf1de9f265bb16742f4ad7f76747921fcd06efc48e035e63272c67c92a305aaf9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.0 (2022-10-02)
4
+
5
+ - Added Commonmarker as dependency
6
+ - Submission metadata's title is converted to plain text
7
+
3
8
  ## 1.4.1 (2022-09-28)
4
9
 
5
10
  - Added method to Submission to get track information
@@ -2,6 +2,7 @@ require "json"
2
2
  require "date"
3
3
  require "base64"
4
4
  require "faraday"
5
+ require "commonmarker"
5
6
 
6
7
  module Theoj
7
8
  class Submission
@@ -96,7 +97,7 @@ module Theoj
96
97
 
97
98
  def all_metadata
98
99
  metadata = {
99
- title: paper.title,
100
+ title: plaintext(paper.title),
100
101
  tags: paper.tags,
101
102
  languages: paper.languages,
102
103
  authors: paper.authors.collect { |a| a.to_h },
@@ -184,6 +185,10 @@ module Theoj
184
185
  "#{metadata[:citation_author]}, (#{metadata[:year]}). #{metadata[:title]}. #{metadata[:journal_name]}, #{metadata[:volume]}(#{metadata[:issue]}), #{metadata[:review_issue_id]}, https://doi.org/#{metadata[:doi]}"
185
186
  end
186
187
 
188
+ def plaintext(t)
189
+ CommonMarker.render_doc(t, :DEFAULT).to_plaintext.strip.gsub(" ", " ")
190
+ end
191
+
187
192
  def format_date(date_string)
188
193
  Date.parse(date_string.to_s).strftime("%Y-%m-%d")
189
194
  rescue Date::Error
data/lib/theoj/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Theoj
2
- VERSION = "1.4.1"
2
+ VERSION = "1.5.0"
3
3
  end
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.1
4
+ version: 1.5.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: 2022-09-28 00:00:00.000000000 Z
11
+ date: 2022-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.5.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: faraday-retry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: openjournals-nameable
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +94,20 @@ dependencies:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
96
  version: 1.5.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: commonmarker
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.23'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.23'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: rake
85
113
  requirement: !ruby/object:Gem::Requirement