theoj 1.3.0 → 1.3.3

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: fe52209e20cb13390a2b85343485fc01a6251c7e98ceafc3eef6c9eed5aa4aa2
4
- data.tar.gz: 2730c6f27f95b3c5175219241c415d8502e5f0631609cc5f2bd5a70f189f0838
3
+ metadata.gz: b3f3262966a5a71981568330e20f0814324e6335edb4a44e47a03f0aa7d89d4d
4
+ data.tar.gz: 150fec7f99a1a5c471b155ad77ba4b948e08952e98fee4295032c87ee7f575d2
5
5
  SHA512:
6
- metadata.gz: b5979b4c89efbf24baa9a4ab03edb8d9f3d988ebedc75d262f573c4b64a55b37418211b8f162246aa8155859470e4d058fe08bbcddde417a7b3a9baa93542d8c
7
- data.tar.gz: 2212d66e3d45784799c99681a01e75b45d1bae74152a04342abf499103082e4d13f142a51d006a92ac6a5388bbd184dec6de46eb801ba27f8a256f52d2a681f6
6
+ metadata.gz: dd83a2dfeafca795c2e6688c08bd0c3ae53c4ff77ad1c0abaf2f79a6660fc19d263303fb2ca86cd6d3846a420c5e8969ba1d027115bcda80ac61d746ec7df5b3
7
+ data.tar.gz: a851572ab77acdc7c3370fd009eab77fc161b485e2bfeac76cd9ce4d7b1561bd2e2ae4493112704ce313f16a30ba484525f6e48f0b14d20f1f5836687365131f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.3 (2022-03-31)
4
+
5
+ - Fix bug with upcased user logins
6
+
7
+ ## 1.3.2 (2022-03-17)
8
+
9
+ - Allow setting GitHub access using GITHUB_TOKEN env var
10
+
11
+ ## 1.3.1 (2022-03-09)
12
+
13
+ - Fix error when loading metadata for papers with wrong path
14
+
3
15
  ## 1.3.0 (2022-03-02)
4
16
 
5
17
  - Change branches using git-switch instead of git-checkout to remove ambiguaties. Requires Git >= 2.23
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
@@ -46,13 +46,13 @@ module Theoj
46
46
 
47
47
  # Uses the GitHub API to determine if a user has a pending invitation
48
48
  def is_invited?(repo, username)
49
- username = user_login(username)
49
+ username = user_login(username).downcase
50
50
  github_client.repository_invitations(repo).any? { |i| i.invitee.login.downcase == username }
51
51
  end
52
52
 
53
53
  # Returns the user login (removes the @ from the username)
54
54
  def user_login(username)
55
- username.to_s.strip.sub(/^@/, "").downcase
55
+ username.to_s.strip.sub(/^@/, "")
56
56
  end
57
57
 
58
58
  # Returns true if the string is a valid GitHub isername (starts with @)
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.3.0"
2
+ VERSION = "1.3.3"
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.3.0
4
+ version: 1.3.3
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-03-02 00:00:00.000000000 Z
11
+ date: 2022-03-31 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