Skip to content

Commit

Permalink
Merge pull request #84 from markets/fix_haml_6
Browse files Browse the repository at this point in the history
Fix Haml 6 support
  • Loading branch information
tdreyno authored Jan 18, 2024
2 parents 0a8e205 + 65f338a commit 3099653
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 35 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ jobs:
bundler-cache: true
- name: Runs tests
run: bundle exec rake test
env:
TEST: true
11 changes: 4 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,19 @@ 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
gem 'aruba', '~> 1.0.0'
gem 'rspec', '~> 3.0'
gem 'cucumber', '~> 2.0'
gem 'capybara', '~> 2.5.0'
gem 'haml', '< 6'
gem 'slim', '< 5'
gem 'haml', RUBY_VERSION > '3.0' ? '< 7' : '< 6'
gem 'slim', '>= 3', '< 5'
gem 'kramdown'
gem "redcarpet"

# Code Quality
gem "cane", require: false

# For old Rubies
gem 'nokogiri', '~> 1.12.0'
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
20 changes: 1 addition & 19 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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|
Expand All @@ -9,23 +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"]

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"
Expand Down
8 changes: 7 additions & 1 deletion lib/middleman-syntax/haml_monkey_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions middleman-syntax.gemspec
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 3099653

Please sign in to comment.