theoj 1.2.1 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1ad9ac2e66ed16201c855e064d879df50c722e84c9b2178ebce0951ef76c56a
4
- data.tar.gz: 93b83ab12f5d6416e3e2147a94fda33cde91b1d294df40c9f9d6a4b91f798c42
3
+ metadata.gz: 7193fb99087c97cc7fc07912ae2fee9aee41da47fb2a914a0a072d88682c63f2
4
+ data.tar.gz: c041cd0adca72f34321de635981115625a0de28fa68136d01df638cf7af9141d
5
5
  SHA512:
6
- metadata.gz: 046fc9a6df0c72d2a69bcd98c303becab7adac7eebdaff4608fbfe65e47e7e7f4ed63b951c45871eb6437c6d2900e2d3cbe5684cfcd3e9d0124a148d4a421d2d
7
- data.tar.gz: 7a5048156f8f55f54aa3141f7073ffb13a4a8803cacd7fe520aa7c67b1590f116dd39d6986c90fe0650ac5c4b95e9c365710871a83416575992f3a025615edec
6
+ metadata.gz: 9b1bc3147a29ed640ee5ff0e772af845e1af269d39776432f753ca01512f85355198df501a1a95707d5dea50fcbe6e19438eb7a3b14789b35f61d2bb8f2a9f8b
7
+ data.tar.gz: 3425fe8d3d51244583ecc9db5a5309ac285ebc22b45beda6a738e7fee6d1fc564b0ed5c34d003cde99c7e248eb9f053356bf913eb97d3692ec9a95f7cd793f62
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.2 (2022-03-17)
4
+
5
+ - Allow setting GitHub access using GITHUB_TOKEN env var
6
+
7
+ ## 1.3.1 (2022-03-09)
8
+
9
+ - Fix error when loading metadata for papers with wrong path
10
+
11
+ ## 1.3.0 (2022-03-02)
12
+
13
+ - Change branches using git-switch instead of git-checkout to remove ambiguaties. Requires Git >= 2.23
14
+
3
15
  ## 1.2.1 (2021-11-30)
4
16
 
5
17
  - Changed metadata dates format to ISO
data/lib/theoj/git.rb CHANGED
@@ -14,7 +14,7 @@ module Theoj
14
14
 
15
15
  def change_branch(branch, local_path)
16
16
  return true if (branch.nil? || branch.strip.empty?)
17
- stdout, stderr, status = Open3.capture3 "git -C #{local_path} checkout #{branch}"
17
+ stdout, stderr, status = Open3.capture3 "git -C #{local_path} switch #{branch}"
18
18
  status.success?
19
19
  end
20
20
  end
data/lib/theoj/github.rb CHANGED
@@ -12,7 +12,7 @@ module Theoj
12
12
 
13
13
  # GitHub access token
14
14
  def github_access_token
15
- @github_access_token ||= ENV["GH_ACCESS_TOKEN"]
15
+ @github_access_token ||= (ENV["GH_ACCESS_TOKEN"] || ENV["GITHUB_TOKEN"])
16
16
  end
17
17
 
18
18
  # GitHub API headers
data/lib/theoj/paper.rb CHANGED
@@ -105,7 +105,9 @@ module Theoj
105
105
  end
106
106
 
107
107
  def load_metadata
108
- @paper_metadata ||= if paper_path.include?('.tex')
108
+ @paper_metadata ||= if paper_path.nil?
109
+ {}
110
+ elsif paper_path.include?('.tex')
109
111
  YAML.load_file(paper_path.gsub('.tex', '.yml'))
110
112
  else
111
113
  YAML.load_file(paper_path)
@@ -132,14 +134,14 @@ module Theoj
132
134
  parsed_authors
133
135
  end
134
136
 
135
- def parse_affiliations(affliations_yaml)
136
- affliations_metadata = {}
137
+ def parse_affiliations(affiliations_yaml)
138
+ affiliations_metadata = {}
137
139
 
138
- affliations_yaml.each do |affiliation|
139
- affliations_metadata[affiliation['index']] = affiliation['name']
140
+ affiliations_yaml.each do |affiliation|
141
+ affiliations_metadata[affiliation['index']] = affiliation['name']
140
142
  end
141
143
 
142
- affliations_metadata
144
+ affiliations_metadata
143
145
  end
144
146
 
145
147
  def detect_languages
data/lib/theoj/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Theoj
2
- VERSION = "1.2.1"
2
+ VERSION = "1.3.2"
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.2.1
4
+ version: 1.3.2
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-30 00:00:00.000000000 Z
11
+ date: 2022-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -28,58 +28,58 @@ dependencies:
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '1.10'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '1.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: openjournals-nameable
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: github-linguist
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 7.19.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 7.19.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rugged
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 1.4.2
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 1.4.2
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
159
  requirements: []
160
- rubygems_version: 3.2.22
160
+ rubygems_version: 3.3.3
161
161
  signing_key:
162
162
  specification_version: 4
163
163
  summary: Editorial objects used by the Open Journals