Skip to content

Commit

Permalink
Merge branch 'joss' into resciencec
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed Feb 15, 2024
2 parents 548f3b3 + a60ec4e commit e1c1c20
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
continue-on-error: ${{ matrix.failure-allowed }}
strategy:
matrix:
ruby-version: ['2.7.8', '3.0.6', '3.1.4', '3.2.2']
ruby-version: ['3.0.6', '3.1.4', '3.2.3', '3.3.0']
failure-allowed: [false]
include:
- ruby-version: 'truffleruby'
Expand Down
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.2
3.3.0
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ if ENV["CUSTOM_RUBY_VERSION"]
end

gem 'octokit'
gem 'sinatra', '3.1.0'
gem 'sinatra-contrib', '3.1.0'
gem 'sinatra', '4.0.0'
gem 'sinatra-contrib', '4.0.0'
gem 'openssl'
gem 'puma'
gem 'sidekiq'
Expand Down
94 changes: 52 additions & 42 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,70 +1,78 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.1.1)
bibtex-ruby (6.0.0)
base64 (0.2.0)
bibtex-ruby (6.1.0)
latex-decode (~> 0.0)
cgi (0.3.6)
racc (~> 1.7)
bigdecimal (3.1.6)
cgi (0.4.1)
charlock_holmes (0.7.7)
chronic (0.10.2)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crack (0.4.5)
crack (0.4.6)
bigdecimal
rexml
diff-lcs (1.5.0)
diff-lcs (1.5.1)
dotenv (2.8.1)
faraday (2.7.11)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday (2.9.0)
faraday-net_http (>= 2.0, < 3.2)
faraday-follow_redirects (0.1.0)
faraday (>= 2, < 3)
faraday-net_http (3.0.2)
faraday-net_http (3.1.0)
net-http
faraday-retry (2.2.0)
faraday (~> 2.0)
github-linguist (7.27.0)
github-linguist (7.28.0)
cgi
charlock_holmes (~> 0.7.7)
mini_mime (~> 1.0)
rugged (~> 1.0)
hashdiff (1.0.1)
hashdiff (1.1.0)
issue (1.0.0)
openssl
rack
latex-decode (0.4.0)
licensee (9.16.0)
licensee (9.16.1)
dotenv (~> 2.0)
octokit (>= 4.20, < 7.0)
octokit (>= 4.20, < 9.0)
reverse_markdown (>= 1, < 3)
rugged (>= 0.24, < 2.0)
thor (>= 0.19, < 2.0)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
mini_portile2 (2.8.5)
multi_json (1.15.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.9)
nokogiri (1.15.4)
net-http (0.4.1)
uri
nio4r (2.7.0)
nokogiri (1.16.0)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
octokit (6.1.1)
octokit (8.1.0)
base64
faraday (>= 1, < 3)
sawyer (~> 0.9)
ojra (1.1.0)
faraday (~> 2.7)
ojra (1.1.1)
faraday (~> 2.9)
openssl (3.2.0)
public_suffix (5.0.3)
puma (6.4.0)
public_suffix (5.0.4)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.8)
rack-protection (3.1.0)
rack (~> 2.2, >= 2.2.4)
racc (1.7.3)
rack (3.0.9)
rack-protection (4.0.0)
base64 (>= 0.1.0)
rack (>= 3.0.0, < 4)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
redis-client (0.17.0)
redis-client (0.19.1)
connection_pool
reverse_markdown (2.1.1)
nokogiri
Expand Down Expand Up @@ -93,24 +101,26 @@ GEM
multi_json (~> 1.15)
rexml (~> 3.2, >= 3.2.5)
thor (~> 1.2, >= 1.2.1)
sidekiq (7.1.4)
sidekiq (7.2.1)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.14.0)
sinatra (3.1.0)
redis-client (>= 0.19.0)
sinatra (4.0.0)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.1.0)
rack (>= 3.0.0, < 4)
rack-protection (= 4.0.0)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
sinatra-contrib (3.1.0)
multi_json
sinatra-contrib (4.0.0)
multi_json (>= 0.0.2)
mustermann (~> 3.0)
rack-protection (= 3.1.0)
sinatra (= 3.1.0)
rack-protection (= 4.0.0)
sinatra (= 4.0.0)
tilt (~> 2.0)
thor (1.2.2)
thor (1.3.0)
tilt (2.3.0)
uri (0.13.0)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand All @@ -136,9 +146,9 @@ DEPENDENCIES
rspec
serrano
sidekiq
sinatra (= 3.1.0)
sinatra-contrib (= 3.1.0)
sinatra (= 4.0.0)
sinatra-contrib (= 4.0.0)
webmock

BUNDLED WITH
2.3.4
2.5.4
2 changes: 1 addition & 1 deletion app/lib/paper_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def self.find(search_path)

if Dir.exist? search_path
Find.find(search_path).each do |path|
if path =~ /paper\.tex$|paper\.md$/
if path =~ /\/paper\.tex$|\/paper\.md$/
paper_path = path
break
end
Expand Down
4 changes: 2 additions & 2 deletions app/workers/repo_checks_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def repo_summary
def detect_languages
repo = Rugged::Repository.new(path)
project = Linguist::Repository.new(repo, repo.head.target_id)

top_3 = project.languages.keys.take(3)
ordered_languages = project.languages.sort_by { |_, size| size }.reverse
top_3 = ordered_languages.first(3).map {|l,s| l}
label_issue(top_3) unless top_3.empty?
end

Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
extensions = [
'sphinx.ext.mathjax',
'recommonmark',
'sphinx_rtd_theme',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
2 changes: 1 addition & 1 deletion spec/paper_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

it "should return a nil PaperFile if no paper file found" do
expect(Dir).to receive(:exist?).with("/repo/path/").and_return(true)
allow(Find).to receive(:find).with("/repo/path/").and_return(["lib/papers.pdf", "./docs", "app"])
allow(Find).to receive(:find).with("/repo/path/").and_return(["lib/papers.pdf", "lib/other_paper.md", "./docs", "app"])

paper_file = PaperFile.find("/repo/path/")

Expand Down
2 changes: 1 addition & 1 deletion spec/workers/repo_checks_worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
describe "#detect_languages" do
before do
repo = OpenStruct.new(head: OpenStruct.new(target_id: 33))
expected_languages = OpenStruct.new(languages: {"Ruby"=>176110, "HTML"=>664, "TeX"=>475, "Go"=>21})
expected_languages = OpenStruct.new(languages: {"Go"=>21, "HTML"=>664, "Ruby"=>176110, "TeX"=>475, "XML" => 100})
allow(Rugged::Repository).to receive(:new).and_return(repo)
allow(Linguist::Repository).to receive(:new).with(repo, 33).and_return(expected_languages)
end
Expand Down

0 comments on commit e1c1c20

Please sign in to comment.