From e1148197accfb674c0a38bcd59edfba552e642a5 Mon Sep 17 00:00:00 2001 From: Jose Luis Salas Date: Mon, 11 Mar 2024 10:50:38 +0100 Subject: [PATCH] Fix ruby 3.3 compatibility --- .github/workflows/publish.yml | 2 +- .gitignore | 1 + Gemfile.lock | 1 + Rules | 14 +++++++------- content/past.haml | 2 +- lib/helpers.rb | 6 +++--- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7ca882e..75aeab3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,7 +30,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: '3.1' + ruby-version: '3.3' - name: Install ruby dependencies run: BUNDLE_WITHOUT=development bundle install - name: Build site diff --git a/.gitignore b/.gitignore index 076cb22..98fab88 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ bundle /tmp /output /.tool-versions +/crash.log diff --git a/Gemfile.lock b/Gemfile.lock index d00d44d..4e02e35 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -92,6 +92,7 @@ GEM zeitwerk (2.6.13) PLATFORMS + arm64-darwin-23 x86_64-linux DEPENDENCIES diff --git a/Rules b/Rules index d9cd5e0..8909e7a 100644 --- a/Rules +++ b/Rules @@ -25,19 +25,19 @@ # end # end -compile '/**/*.haml' do +compile "/**/*.haml" do filter :haml - layout '/default.*' - write item.identifier.without_ext + '.html' + layout "/default.*" + write item.identifier.without_ext + ".html" end -compile '/**/stylesheets/*.scss' do - next if item.identifier.to_s.split("/").last =~ /^_/ # pass partials nested in folders +compile "/**/stylesheets/*.scss" do + next if /^_/.match?(item.identifier.to_s.split("/").last) # pass partials nested in folders filter :sass, syntax: :scss write item.identifier.without_ext end -passthrough '/**/*' +passthrough "/**/*" -layout '/**/*', :haml, format: :html5 +layout "/**/*", :haml, format: :html5 diff --git a/content/past.haml b/content/past.haml index 2099712..3a58cba 100755 --- a/content/past.haml +++ b/content/past.haml @@ -19,7 +19,7 @@ title: Los eventos anteriores %section{:class => "#{m[:type]}"} - m[:talks].each do |f| %article - %h3= f[:title] + %h3!= f[:title] - f[:author].each do |t| %p = t[:name] diff --git a/lib/helpers.rb b/lib/helpers.rb index 526455a..3c6d43a 100644 --- a/lib/helpers.rb +++ b/lib/helpers.rb @@ -3,10 +3,10 @@ use_helper Nanoc::Helpers::Rendering def is_page_selected(page) - @item.identifier.without_ext == page ? "selected" : "" + (@item.identifier.without_ext == page) ? "selected" : "" end -class Data +class YamlData def method_missing(method_name, *arguments, &block) YAML.safe_load_file(File.join(File.expand_path("..", __dir__), "data", "#{method_name}.yml"), symbolize_names: true) end @@ -18,5 +18,5 @@ def respond_to_missing?(method_name, include_private = false) end def data - Data.new + YamlData.new end