From d85c6c2f0e7aae2ea1a17f94264ef764cf3317e2 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Thu, 18 Jan 2024 01:45:57 +0100 Subject: [PATCH 1/6] [ci] actually allow to run Haml v6 --- .github/workflows/ci.yml | 2 -- Gemfile | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c02cbf1..b79c582 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,5 +19,3 @@ jobs: bundler-cache: true - name: Runs tests run: bundle exec rake test - env: - TEST: true diff --git a/Gemfile b/Gemfile index ad1e4e3..702cc38 100644 --- a/Gemfile +++ b/Gemfile @@ -6,8 +6,8 @@ gem "middleman-core", git: "https://github.com/middleman/middleman.git" gemspec # Build and doc tools -gem 'rake', '~> 10.3', require: false -gem 'yard', '~> 0.8', require: false +gem 'rake', '~> 13.1', require: false +gem 'yard', '~> 0.9', require: false # Test tools gem 'pry', '~> 0.10', group: :development @@ -15,7 +15,7 @@ gem 'aruba', '~> 1.0.0' gem 'rspec', '~> 3.0' gem 'cucumber', '~> 2.0' gem 'capybara', '~> 2.5.0' -gem 'haml', '< 6' +gem 'haml', '< 7' gem 'slim', '< 5' gem 'kramdown' gem "redcarpet" From 0efb04af87ff1f1ee00cf2a2a7d996fd86e55a18 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Thu, 18 Jan 2024 16:25:32 +0100 Subject: [PATCH 2/6] small adjusments --- Gemfile | 2 +- README.md | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 702cc38..9e8dfe2 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,7 @@ gem 'rspec', '~> 3.0' gem 'cucumber', '~> 2.0' gem 'capybara', '~> 2.5.0' gem 'haml', '< 7' -gem 'slim', '< 5' +gem 'slim', '>= 3', '< 5' gem 'kramdown' gem "redcarpet" diff --git a/README.md b/README.md index 79ab63c..fc27a7d 100644 --- a/README.md +++ b/README.md @@ -196,7 +196,7 @@ The best way to get quick responses to your issues and swift fixes to your bugs ## Donate -[Click here to lend your support to Middleman](https://spacebox.io/s/4dXbHBorC3) +[Click here to lend your support to Middleman](https://github.com/sponsors/tdreyno) ## License @@ -205,6 +205,4 @@ Copyright (c) 2012-2014 Benjamin Hollis. MIT Licensed, see [LICENSE] for details [middleman]: http://middlemanapp.com [gem]: https://rubygems.org/gems/middleman-syntax [travis]: http://travis-ci.org/middleman/middleman-syntax -[gemnasium]: https://gemnasium.com/middleman/middleman-syntax -[codeclimate]: https://codeclimate.com/github/middleman/middleman-syntax [LICENSE]: https://github.com/middleman/middleman-syntax/blob/master/LICENSE.md From 8864eb3ac02a19fe4cf08dcf611e0f07a80fb8ae Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Thu, 18 Jan 2024 16:28:55 +0100 Subject: [PATCH 3/6] [ci] test Haml 6 on Ruby 3+ and Haml 5 for older Rubies --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 9e8dfe2..8d0ef20 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem 'aruba', '~> 1.0.0' gem 'rspec', '~> 3.0' gem 'cucumber', '~> 2.0' gem 'capybara', '~> 2.5.0' -gem 'haml', '< 7' +gem 'haml', RUBY_VERSION > '3.0' ? '< 7' : '< 6' gem 'slim', '>= 3', '< 5' gem 'kramdown' gem "redcarpet" From dce0a22b312b3af53bb201f8ff6c502df0f3bcfb Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Thu, 18 Jan 2024 16:35:13 +0100 Subject: [PATCH 4/6] Remove cane gem --- Gemfile | 3 --- Rakefile | 13 ------------- 2 files changed, 16 deletions(-) diff --git a/Gemfile b/Gemfile index 8d0ef20..ebb1564 100644 --- a/Gemfile +++ b/Gemfile @@ -20,8 +20,5 @@ gem 'slim', '>= 3', '< 5' gem 'kramdown' gem "redcarpet" -# Code Quality -gem "cane", require: false - # For old Rubies gem 'nokogiri', '~> 1.12.0' diff --git a/Rakefile b/Rakefile index df9d58d..2f7ff76 100644 --- a/Rakefile +++ b/Rakefile @@ -13,19 +13,6 @@ require 'rake/clean' task :test => ["cucumber"] -begin - require 'cane/rake_task' - - desc "Run cane to check quality metrics" - Cane::RakeTask.new(:quality) do |cane| - cane.no_style = true - cane.no_doc = true - cane.abc_glob = "lib/middleman-syntax/**/*.rb" - end -rescue LoadError - # warn "cane not available, quality task not provided." -end - task :default => :test desc "Build HTML documentation" From 140fd7bac0eace3313bdf9a5f222c290c8e7bf79 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Thu, 18 Jan 2024 16:54:29 +0100 Subject: [PATCH 5/6] fix Haml 6 integration --- lib/middleman-syntax/haml_monkey_patch.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/middleman-syntax/haml_monkey_patch.rb b/lib/middleman-syntax/haml_monkey_patch.rb index 5e0bea8..ccc6de2 100644 --- a/lib/middleman-syntax/haml_monkey_patch.rb +++ b/lib/middleman-syntax/haml_monkey_patch.rb @@ -21,8 +21,14 @@ def render(code) module Haml class Filters class Code < Base - extend HamlMonkeyPatch + include HamlMonkeyPatch + + def compile(node) + [:static, render(node.value[:text])] + end end + + register :code, Code end end else From 65f338a4c6d76677a58eb6a6053b68d7021ae301 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Thu, 18 Jan 2024 17:15:45 +0100 Subject: [PATCH 6/6] small clean up on Rakefile and gemspec --- Rakefile | 7 +------ middleman-syntax.gemspec | 4 +--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Rakefile b/Rakefile index 2f7ff76..cdb49fc 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,4 @@ -require 'bundler' -Bundler::GemHelper.install_tasks - +require 'bundler/gem_tasks' require 'cucumber/rake/task' Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t| @@ -9,10 +7,7 @@ Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t| t.cucumber_opts = "--color --tags ~@wip #{exempt_tags} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}" end -require 'rake/clean' - task :test => ["cucumber"] - task :default => :test desc "Build HTML documentation" diff --git a/middleman-syntax.gemspec b/middleman-syntax.gemspec index 860c172..6ffe6f0 100644 --- a/middleman-syntax.gemspec +++ b/middleman-syntax.gemspec @@ -1,6 +1,4 @@ -# -*- encoding: utf-8 -*- -$:.push File.expand_path("../lib", __FILE__) -require "middleman-syntax/version" +require "./lib/middleman-syntax/version" Gem::Specification.new do |s| s.name = "middleman-syntax"