Skip to content

Commit

Permalink
Merge a11dbbd into ef50bf3
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Dec 13, 2023
2 parents ef50bf3 + a11dbbd commit 135c101
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 105 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
- "3.1"
- "3.2"
gemfile:
- haml4
- haml5.0
- haml5.1
- haml5.2
Expand Down
4 changes: 0 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
# After updating this file, run `bundle exec appraisal install` to update
# dependency files.

appraise 'haml4' do
gem 'haml', '~> 4'
end

appraise 'haml5.0' do
gem 'haml', '~> 5.0.0'
end
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# HAML-Lint Changelog

### main

* Drop Haml 4 compatibility

### 0.52.0

* Add Haml 6.3 compatibility
Expand Down
15 changes: 0 additions & 15 deletions gemfiles/haml4.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion gemfiles/haml5.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rspec", "~> 3.8"
gem "rspec-its", "~> 1.0"
gem "appraisal"
gem "overcommit", "0.60.0"
gem "rubocop", "1.56.4"
gem "rubocop", "1.57.2"
gem "simplecov", "~> 0.22.0"
gem "simplecov-lcov", "~> 0.8.0"
gem "haml", "~> 5.0.0"
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/haml5.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rspec", "~> 3.8"
gem "rspec-its", "~> 1.0"
gem "appraisal"
gem "overcommit", "0.60.0"
gem "rubocop", "1.56.4"
gem "rubocop", "1.57.2"
gem "simplecov", "~> 0.22.0"
gem "simplecov-lcov", "~> 0.8.0"
gem "haml", "~> 5.1.0"
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/haml5.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rspec", "~> 3.8"
gem "rspec-its", "~> 1.0"
gem "appraisal"
gem "overcommit", "0.60.0"
gem "rubocop", "1.56.4"
gem "rubocop", "1.57.2"
gem "simplecov", "~> 0.22.0"
gem "simplecov-lcov", "~> 0.8.0"
gem "haml", "~> 5.2.0"
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/haml6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rspec", "~> 3.8"
gem "rspec-its", "~> 1.0"
gem "appraisal"
gem "overcommit", "0.60.0"
gem "rubocop", "1.56.4"
gem "rubocop", "1.57.2"
gem "simplecov", "~> 0.22.0"
gem "simplecov-lcov", "~> 0.8.0"
gem "haml", "~> 6.0.0"
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/haml6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rspec", "~> 3.8"
gem "rspec-its", "~> 1.0"
gem "appraisal"
gem "overcommit", "0.60.0"
gem "rubocop", "1.56.4"
gem "rubocop", "1.57.2"
gem "simplecov", "~> 0.22.0"
gem "simplecov-lcov", "~> 0.8.0"
gem "haml", "~> 6.1.0"
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/haml6.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rspec", "~> 3.8"
gem "rspec-its", "~> 1.0"
gem "appraisal"
gem "overcommit", "0.60.0"
gem "rubocop", "1.56.4"
gem "rubocop", "1.57.2"
gem "simplecov", "~> 0.22.0"
gem "simplecov-lcov", "~> 0.8.0"
gem "haml", "~> 6.2.0"
Expand Down
2 changes: 1 addition & 1 deletion haml_lint.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |s|

s.required_ruby_version = '>= 2.7.0'

s.add_dependency 'haml', '>= 4.0'
s.add_dependency 'haml', '>= 5.0'
s.add_dependency 'parallel', '~> 1.10'
s.add_dependency 'rainbow'
s.add_dependency 'rubocop', '>= 1.0'
Expand Down
2 changes: 0 additions & 2 deletions lib/haml_lint/adapter.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require 'haml_lint/adapter/haml_4'
require 'haml_lint/adapter/haml_5'
require 'haml_lint/adapter/haml_6'
require 'haml_lint/exceptions'
Expand All @@ -19,7 +18,6 @@ class Adapter
def self.detect_class
version = haml_version
case version
when '~> 4.0' then HamlLint::Adapter::Haml4
when '~> 5.0', '~> 5.1', '~> 5.2' then HamlLint::Adapter::Haml5
when '~> 6.0', '~> 6.0.a', '~> 6.1', '~> 6.2', '~> 6.3' then HamlLint::Adapter::Haml6
else fail HamlLint::Exceptions::UnknownHamlVersion, "Cannot handle Haml version: #{version}"
Expand Down
62 changes: 0 additions & 62 deletions lib/haml_lint/adapter/haml_4.rb

This file was deleted.

16 changes: 2 additions & 14 deletions spec/haml_lint/adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,13 @@
describe '.detect_class' do
subject { described_class.detect_class }

context 'on Haml 4' do
before { stub_const('Haml::VERSION', '4.0.7') }

it { should == HamlLint::Adapter::Haml4 }
end

context 'on Haml 5' do
before { stub_const('Haml::VERSION', '5.0.0') }

it { should == HamlLint::Adapter::Haml5 }
end

context 'on Haml 5' do
before { stub_const('Haml::VERSION', '5.0.0') }

it { should == HamlLint::Adapter::Haml5 }
end

context 'on Haml 6' do
context 'on Haml 6 (pre)' do
before { stub_const('Haml::VERSION', '6.0.0.beta.2') }

it { should == HamlLint::Adapter::Haml6 }
Expand All @@ -35,7 +23,7 @@
end

context 'on unknown version of Haml' do
before { stub_const('Haml::VERSION', '3.0.0') }
before { stub_const('Haml::VERSION', '4.0.0') }

it 'raises an error' do
expect { subject }.to raise_error(HamlLint::Exceptions::UnknownHamlVersion)
Expand Down

0 comments on commit 135c101

Please sign in to comment.