Skip to content

Commit

Permalink
Merge pull request #20 from cat-in-136/ruby3.3
Browse files Browse the repository at this point in the history
upgrade to Ruby3.3
  • Loading branch information
cat-in-136 authored Aug 18, 2024
2 parents dc58f21 + 53e8b8f commit 912a90d
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.3
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Generate document
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.3
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Generate document
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ group :jekyll_plugins do
gem 'jekyll-paginate-v2'
end

gem 'image_size', '~> 3.0'
gem 'fastimage', '~> 2.3'

group :lsi do
gem 'numo-narray'
Expand Down
132 changes: 113 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
bigdecimal (3.1.7)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
bigdecimal (3.1.8)
classifier-reborn (2.3.0)
fast-stemmer (~> 1.0)
matrix (~> 0.4)
colorator (1.1.0)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.4)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
fast-stemmer (1.0.2)
ffi (1.16.3)
fastimage (2.3.1)
ffi (1.17.0)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-aarch64-linux-musl)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm-linux-musl)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86-linux-musl)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
ffi (1.17.0-x86_64-linux-musl)
forwardable-extended (2.6.0)
google-protobuf (4.26.1-x86_64-linux)
google-protobuf (4.27.3)
bigdecimal
rake (>= 13)
google-protobuf (4.27.3-aarch64-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.27.3-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.27.3-x86-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.27.3-x86_64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.27.3-x86_64-linux)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
i18n (1.14.4)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
image_size (3.4.0)
jekyll (4.3.3)
addressable (~> 2.4)
colorator (~> 1.0)
Expand Down Expand Up @@ -61,20 +87,63 @@ GEM
numo-narray (0.9.2.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.5)
public_suffix (6.0.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.3.3)
rexml (3.3.5)
strscan
rouge (4.2.1)
rouge (4.3.0)
safe_yaml (1.0.5)
sass-embedded (1.76.0-x86_64-linux-gnu)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.8)
google-protobuf (~> 4.26)
rake (>= 13)
sass-embedded (1.77.8-aarch64-linux-android)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-aarch64-linux-gnu)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-aarch64-linux-musl)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-aarch64-mingw-ucrt)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-arm-linux-androideabi)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-arm-linux-gnueabihf)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-arm-linux-musleabihf)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-arm64-darwin)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-riscv64-linux-android)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-riscv64-linux-gnu)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-riscv64-linux-musl)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-x86-cygwin)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-x86-linux-android)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-x86-linux-gnu)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-x86-linux-musl)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-x86-mingw-ucrt)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-x86_64-cygwin)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-x86_64-darwin)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-x86_64-linux-android)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-x86_64-linux-gnu)
google-protobuf (~> 4.26)
sass-embedded (1.77.8-x86_64-linux-musl)
google-protobuf (~> 4.26)
strscan (3.1.0)
sync (0.5.0)
term-ansicolor (1.8.0)
term-ansicolor (1.11.2)
tins (~> 1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
Expand All @@ -85,12 +154,37 @@ GEM
webrick (1.8.1)

PLATFORMS
x86_64-linux
aarch64-linux
aarch64-linux-android
aarch64-linux-gnu
aarch64-linux-musl
aarch64-mingw-ucrt
arm-linux-androideabi
arm-linux-gnu
arm-linux-gnueabihf
arm-linux-musl
arm-linux-musleabihf
arm64-darwin
riscv64-linux-android
riscv64-linux-gnu
riscv64-linux-musl
ruby
x86-cygwin
x86-linux
x86-linux-android
x86-linux-gnu
x86-linux-musl
x86-mingw-ucrt
x86_64-cygwin
x86_64-darwin
x86_64-linux-android
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
classifier-reborn
fastimage (~> 2.3)
http_parser.rb (~> 0.6.0)
image_size (~> 3.0)
jekyll (~> 4.3)
jekyll-archives
jekyll-paginate-v2
Expand All @@ -104,7 +198,7 @@ DEPENDENCIES
webrick

RUBY VERSION
ruby 3.3.1p55
ruby 3.3.4p94

BUNDLED WITH
2.4.10
2.5.11
23 changes: 3 additions & 20 deletions _plugins/asset_image_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
# Title: Simple Image Path URL expansion tag
# Author: @cat_in_136
#
# Copyright (C) 2014 @cat_in_136
# Copyright (C) 2014-2024 @cat_in_136
#
# Avarilable under MIT License <http://opensource.org/licenses/mit-license.php>
#

require 'image_size'
require 'rexml/document'
require 'fastimage'

module Jekyll
class AssetImagePathTag < Liquid::Tag
Expand Down Expand Up @@ -47,24 +46,8 @@ def render(context)
end

def self.get_size(filename)
width = height = nil
path = File.expand_path("../images/#{filename}", File.basename(__FILE__))
raise "File not found: '#{filename}'" unless File.exist?(path)
if (File.extname(path).downcase == '.svg')
File.open(path, 'r') do |f|
f.flock(File::LOCK_SH)
doc = REXML::Document.new(f)
width = doc.root.attribute(:width).value.to_f.round # "/*/@width"
height = doc.root.attribute(:height).value.to_f.round # "/*/@height"
end
else
File.open(path, 'r') do |f|
f.flock(File::LOCK_SH)
imgsize = ImageSize.new(f)
width = imgsize.width
height = imgsize.height
end
end
width, height = FastImage.size(path)

[width, height]
end
Expand Down

0 comments on commit 912a90d

Please sign in to comment.