diff -Nru ruby-haml-rails-2.0.1/Appraisals ruby-haml-rails-2.1.0/Appraisals --- ruby-haml-rails-2.0.1/Appraisals 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/Appraisals 2022-10-17 04:20:52.000000000 +0000 @@ -1,27 +1,19 @@ -appraise "rails_4_0" do - gem "rails", "~> 4.0.1" -end - -appraise "rails_4_1" do - gem "rails", "4.1" -end - -appraise "rails_4_2" do - gem "rails", "4.2" +appraise "rails_5_1" do + gem "rails", "~> 5.1.0" end -appraise "rails_5_0" do - gem "rails", "5.0" +appraise "rails_5_2" do + gem "rails", "~> 5.2.0" end -appraise "rails_5_1" do - gem "rails", "5.1" +appraise "rails_6_0" do + gem "rails", "~> 6.0.0" end -appraise "rails_5_2" do - gem "rails", "5.2" +appraise "rails_6_1" do + gem "rails", "~> 6.1.0" end -appraise "rails_6.beta2" do - gem "rails", "6.0.0.beta2" +appraise "rails_7_0" do + gem "rails", "~> 7.0.0" end diff -Nru ruby-haml-rails-2.0.1/debian/changelog ruby-haml-rails-2.1.0/debian/changelog --- ruby-haml-rails-2.0.1/debian/changelog 2020-01-04 08:00:26.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/changelog 2022-12-25 14:58:29.000000000 +0000 @@ -1,3 +1,41 @@ +ruby-haml-rails (2.1.0-1) unstable; urgency=medium + + * Team upload + + [ Debian Janitor ] + * Set field Upstream-Contact in debian/copyright. + * Remove obsolete fields Contact, Name from debian/upstream/metadata + (already present in machine-readable debian/copyright). + * Update standards version to 4.5.0, no changes needed. + * Update watch file format version to 4. + * Remove constraints unnecessary since buster + * Bump debhelper from old 12 to 13. + * Update standards version to 4.5.1, no changes needed. + * Set upstream metadata fields: Bug-Database, Repository-Browse. + * Update standards version to 4.6.1, no changes needed. + + [ Kartik Kulkarni ] + * Updated control for rails 6 transition + + [ Cédric Boutillier ] + * Update team name + * Add .gitattributes to keep unwanted files out of the source package + + [ Antonio Terceiro ] + * New upstream version 2.1.0 + - works with ruby-haml 6.1.1 (Closes: #1026894) + * debian/upstream/metadata: update from template + * debian/rules: install using rubygems layout + * debian/ruby-tests.rake: reset to template + * debian/control: update with dh-make-ruby + - Update Homepage: from upstream metadata + - Drop *-Ruby-Version fields + - Replace hardcoded dependencies with ${ruby:Depends} + * Convert patches to gbp-pq + * Add patch to fix test suite without bundler + + -- Antonio Terceiro Sun, 25 Dec 2022 11:58:29 -0300 + ruby-haml-rails (2.0.1-1) unstable; urgency=medium * New upstream version 2.0.1 diff -Nru ruby-haml-rails-2.0.1/debian/control ruby-haml-rails-2.1.0/debian/control --- ruby-haml-rails-2.0.1/debian/control 2020-01-04 08:00:26.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/control 2022-12-25 14:58:29.000000000 +0000 @@ -1,39 +1,29 @@ Source: ruby-haml-rails -Maintainer: Debian Ruby Extras Maintainers -Uploaders: Balasankar C , - Utkarsh Gupta Section: ruby -Testsuite: autopkgtest-pkg-ruby Priority: optional -Build-Depends: debhelper-compat (= 12), - gem2deb, - rails, +Maintainer: Debian Ruby Team +Uploaders: Balasankar C , + Utkarsh Gupta +Build-Depends: debhelper-compat (= 13), + gem2deb (>= 1), rake, - ruby-actionpack, - ruby-activesupport, - ruby-haml (<< 6.0), - ruby-haml (>= 4.0.6~), - ruby-html2haml (>= 2.0~), - ruby-railties, - ruby-test-unit -Standards-Version: 4.4.1 -Vcs-Browser: https://salsa.debian.org/ruby-team/ruby-haml-rails + ruby-actionmailer (>= 2:5.1), + ruby-actionpack (>= 2:5.1), + ruby-activesupport (>= 2:5.1), + ruby-haml (>= 4.0.6), + ruby-html2haml, + ruby-railties (>= 2:5.1) +Standards-Version: 4.6.1 Vcs-Git: https://salsa.debian.org/ruby-team/ruby-haml-rails.git -Homepage: https://github.com/indirect/haml-rails -XS-Ruby-Versions: all +Vcs-Browser: https://salsa.debian.org/ruby-team/ruby-haml-rails +Homepage: https://github.com/haml/haml-rails +Testsuite: autopkgtest-pkg-ruby Rules-Requires-Root: no Package: ruby-haml-rails Architecture: all -XB-Ruby-Versions: ${ruby:Versions} -Depends: ruby | ruby-interpreter, - ruby-actionpack, - ruby-activesupport, - ruby-haml (<< 6.0), - ruby-haml (>= 4.0.6~), - ruby-html2haml (>= 2.0~), - ruby-railties, - ${misc:Depends}, +Depends: ${misc:Depends}, + ${ruby:Depends}, ${shlibs:Depends} Description: Haml Generator for Rails Haml-rails provides Haml generators for Rails. It also enables Haml as the diff -Nru ruby-haml-rails-2.0.1/debian/copyright ruby-haml-rails-2.1.0/debian/copyright --- ruby-haml-rails-2.0.1/debian/copyright 2020-01-04 08:00:26.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/copyright 2022-12-25 14:58:29.000000000 +0000 @@ -1,6 +1,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: haml-rails Source: https://github.com/indirect/haml-rails +Upstream-Contact: https://github.com/indirect/haml-rails/issues Files: * Copyright: 2010 André Arko diff -Nru ruby-haml-rails-2.0.1/debian/patches/0001-remove-git-usage-in-gemspec.patch ruby-haml-rails-2.1.0/debian/patches/0001-remove-git-usage-in-gemspec.patch --- ruby-haml-rails-2.0.1/debian/patches/0001-remove-git-usage-in-gemspec.patch 1970-01-01 00:00:00.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/patches/0001-remove-git-usage-in-gemspec.patch 2022-12-25 14:58:29.000000000 +0000 @@ -0,0 +1,26 @@ +From: =?utf-8?q?C=C3=A9dric_Boutillier?= +Date: Sun, 25 Dec 2022 11:55:24 -0300 +Subject: remove git usage in gemspec + +gem2deb/metadata.rb should take care of that but there seems to be an +encoding problem See bug report + +Bug-Debian: https://bugs.debian.org/920953 +--- + haml-rails.gemspec | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/haml-rails.gemspec b/haml-rails.gemspec +index 8bb94f1..909b9c7 100644 +--- a/haml-rails.gemspec ++++ b/haml-rails.gemspec +@@ -26,7 +26,7 @@ Gem::Specification.new do |s| + s.add_development_dependency "rake" + s.add_development_dependency 'appraisal' + +- s.files = `git ls-files`.split("\n") +- s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/} ++ s.files = (Dir["**/*"] - Dir["debian/**/*"] - Dir["*.gemspec.gem2deb"]).select { |f| !File.directory?(f) } ++ s.executables = [] + s.require_path = 'lib' + end diff -Nru ruby-haml-rails-2.0.1/debian/patches/0002-test_helper-don-t-assume-bundler-is-in-use.patch ruby-haml-rails-2.1.0/debian/patches/0002-test_helper-don-t-assume-bundler-is-in-use.patch --- ruby-haml-rails-2.0.1/debian/patches/0002-test_helper-don-t-assume-bundler-is-in-use.patch 1970-01-01 00:00:00.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/patches/0002-test_helper-don-t-assume-bundler-is-in-use.patch 2022-12-25 14:58:29.000000000 +0000 @@ -0,0 +1,21 @@ +From: Antonio Terceiro +Date: Sun, 25 Dec 2022 11:57:28 -0300 +Subject: test_helper: don't assume bundler is in use + +--- + test/test_helper.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/test_helper.rb b/test/test_helper.rb +index e2f4609..d75d5be 100644 +--- a/test/test_helper.rb ++++ b/test/test_helper.rb +@@ -6,7 +6,7 @@ require 'action_view' + require 'rails' + require 'rails/generators' + require 'rails/generators/test_case' +-Bundler.require(:default) ++require 'html2haml' + + class TestApp < Rails::Application + config.root = File.dirname(__FILE__) diff -Nru ruby-haml-rails-2.0.1/debian/patches/no-git-in-gemspecs.patch ruby-haml-rails-2.1.0/debian/patches/no-git-in-gemspecs.patch --- ruby-haml-rails-2.0.1/debian/patches/no-git-in-gemspecs.patch 2020-01-04 08:00:26.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/patches/no-git-in-gemspecs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -Description: remove git usage in gemspec - gem2deb/metadata.rb should take care of that - but there seems to be an encoding problem - See bug report -Bug-Debian: https://bugs.debian.org/920953 -Author: Cédric Boutillier -Last-Update: 2019-02-14 ---- a/haml-rails.gemspec -+++ b/haml-rails.gemspec -@@ -26,7 +26,7 @@ - s.add_development_dependency "rake" - s.add_development_dependency 'appraisal', '~> 1.0' - -- s.files = `git ls-files`.split("\n") -- s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/} -+ s.files = (Dir["**/*"] - Dir["debian/**/*"] - Dir["*.gemspec.gem2deb"]).select { |f| !File.directory?(f) } -+ s.executables = [] - s.require_path = 'lib' - end diff -Nru ruby-haml-rails-2.0.1/debian/patches/series ruby-haml-rails-2.1.0/debian/patches/series --- ruby-haml-rails-2.0.1/debian/patches/series 2020-01-04 07:59:11.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/patches/series 2022-12-25 14:58:29.000000000 +0000 @@ -1 +1,2 @@ -no-git-in-gemspecs.patch +0001-remove-git-usage-in-gemspec.patch +0002-test_helper-don-t-assume-bundler-is-in-use.patch diff -Nru ruby-haml-rails-2.0.1/debian/ruby-tests.rake ruby-haml-rails-2.1.0/debian/ruby-tests.rake --- ruby-haml-rails-2.0.1/debian/ruby-tests.rake 2020-01-04 07:59:11.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/ruby-tests.rake 2022-12-25 14:58:29.000000000 +0000 @@ -1,11 +1,6 @@ require 'gem2deb/rake/testtask' Gem2Deb::Rake::TestTask.new do |t| - t.libs << 'lib' << 'test' - t.test_files = FileList['test/**/*_test.rb'] -end - -at_exit do - filepath = File.join(File.dirname(__FILE__),'..','tmp') - system('rm', '-rf', filepath) + t.libs = ['test'] + t.test_files = FileList['test/**/*_test.rb'] + FileList['test/**/test_*.rb'] end diff -Nru ruby-haml-rails-2.0.1/debian/rules ruby-haml-rails-2.1.0/debian/rules --- ruby-haml-rails-2.0.1/debian/rules 2020-01-04 08:00:26.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/rules 2022-12-25 14:58:29.000000000 +0000 @@ -1,18 +1,7 @@ #!/usr/bin/make -f -#export DH_VERBOSE=1 -# -# Uncomment to ignore all test failures (but the tests will run anyway) -#export DH_RUBY_IGNORE_TESTS=all -# -# Uncomment to ignore some test failures (but the tests will run anyway). -# Valid values: -#export DH_RUBY_IGNORE_TESTS=ruby2.1 ruby2.2 -# -# If you need to specify the .gemspec (eg there is more than one) -#export DH_RUBY_GEMSPEC=gem.gemspec -# -# Uncomment to check dependencies during build: + export GEM2DEB_TEST_RUNNER = --check-dependencies +export DH_RUBY = --gem-install %: dh $@ --buildsystem=ruby --with ruby diff -Nru ruby-haml-rails-2.0.1/debian/upstream/metadata ruby-haml-rails-2.1.0/debian/upstream/metadata --- ruby-haml-rails-2.0.1/debian/upstream/metadata 2020-01-04 08:00:26.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/upstream/metadata 2022-12-25 14:58:29.000000000 +0000 @@ -1,9 +1,7 @@ --- Archive: GitHub -Bug-Database: https://github.com/indirect/haml-rails/issues -Bug-Submit: https://github.com/indirect/haml-rails/issues -Changelog: https://github.com/indirect/haml-rails/tags -Contact: https://github.com/indirect/haml-rails/issues -Name: haml-rails -Repository: https://github.com/indirect/haml-rails.git -Repository-Browse: https://github.com/indirect/haml-rails +Bug-Database: https://github.com/haml/haml-rails/issues +Bug-Submit: https://github.com/haml/haml-rails/issues/new +Changelog: https://github.com/haml/haml-rails/releases +Repository: https://github.com/haml/haml-rails.git +Repository-Browse: https://github.com/haml/haml-rails diff -Nru ruby-haml-rails-2.0.1/debian/watch ruby-haml-rails-2.1.0/debian/watch --- ruby-haml-rails-2.0.1/debian/watch 2020-01-04 08:00:26.000000000 +0000 +++ ruby-haml-rails-2.1.0/debian/watch 2022-12-25 14:58:29.000000000 +0000 @@ -1,2 +1,2 @@ -version=3 +version=4 https://gemwatch.debian.net/haml-rails .*/haml-rails-(.*).tar.gz diff -Nru ruby-haml-rails-2.0.1/Gemfile ruby-haml-rails-2.1.0/Gemfile --- ruby-haml-rails-2.0.1/Gemfile 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/Gemfile 2022-10-17 04:20:52.000000000 +0000 @@ -3,6 +3,4 @@ # Specify your gem's dependencies in haml-rails.gemspec gemspec -gem 'rubysl', '~> 2.0', platforms: :rbx -gem 'minitest', platforms: :rbx gem 'html2haml' diff -Nru ruby-haml-rails-2.0.1/gemfiles/rails_5_1.gemfile ruby-haml-rails-2.1.0/gemfiles/rails_5_1.gemfile --- ruby-haml-rails-2.0.1/gemfiles/rails_5_1.gemfile 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/gemfiles/rails_5_1.gemfile 2022-10-17 04:20:52.000000000 +0000 @@ -2,9 +2,7 @@ source "https://rubygems.org" -gem "rubysl", "~> 2.0", :platforms => :rbx -gem "minitest", :platforms => :rbx gem "html2haml" -gem "rails", "~> 5.1.5" +gem "rails", "~> 5.1.0" -gemspec :path => "../" +gemspec path: "../" diff -Nru ruby-haml-rails-2.0.1/gemfiles/rails_5_2.gemfile ruby-haml-rails-2.1.0/gemfiles/rails_5_2.gemfile --- ruby-haml-rails-2.0.1/gemfiles/rails_5_2.gemfile 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/gemfiles/rails_5_2.gemfile 2022-10-17 04:20:52.000000000 +0000 @@ -2,9 +2,7 @@ source "https://rubygems.org" -gem "rubysl", "~> 2.0", :platforms => :rbx -gem "minitest", :platforms => :rbx gem "html2haml" gem "rails", "~> 5.2.0" -gemspec :path => "../" +gemspec path: "../" diff -Nru ruby-haml-rails-2.0.1/gemfiles/rails_6_0.gemfile ruby-haml-rails-2.1.0/gemfiles/rails_6_0.gemfile --- ruby-haml-rails-2.0.1/gemfiles/rails_6_0.gemfile 1970-01-01 00:00:00.000000000 +0000 +++ ruby-haml-rails-2.1.0/gemfiles/rails_6_0.gemfile 2022-10-17 04:20:52.000000000 +0000 @@ -0,0 +1,8 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "html2haml" +gem "rails", "~> 6.0.0" + +gemspec path: "../" diff -Nru ruby-haml-rails-2.0.1/gemfiles/rails_6_1.gemfile ruby-haml-rails-2.1.0/gemfiles/rails_6_1.gemfile --- ruby-haml-rails-2.0.1/gemfiles/rails_6_1.gemfile 1970-01-01 00:00:00.000000000 +0000 +++ ruby-haml-rails-2.1.0/gemfiles/rails_6_1.gemfile 2022-10-17 04:20:52.000000000 +0000 @@ -0,0 +1,8 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "html2haml" +gem "rails", "~> 6.1.0" + +gemspec path: "../" diff -Nru ruby-haml-rails-2.0.1/gemfiles/rails_6.beta2.gemfile ruby-haml-rails-2.1.0/gemfiles/rails_6.beta2.gemfile --- ruby-haml-rails-2.0.1/gemfiles/rails_6.beta2.gemfile 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/gemfiles/rails_6.beta2.gemfile 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rubysl", "~> 2.0", :platforms => :rbx -gem "minitest", :platforms => :rbx -gem "html2haml" -gem "rails", "6.0.0.beta2" - -gemspec :path => "../" diff -Nru ruby-haml-rails-2.0.1/gemfiles/rails_7_0.gemfile ruby-haml-rails-2.1.0/gemfiles/rails_7_0.gemfile --- ruby-haml-rails-2.0.1/gemfiles/rails_7_0.gemfile 1970-01-01 00:00:00.000000000 +0000 +++ ruby-haml-rails-2.1.0/gemfiles/rails_7_0.gemfile 2022-10-17 04:20:52.000000000 +0000 @@ -0,0 +1,8 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "html2haml" +gem "rails", "~> 7.0.0" + +gemspec path: "../" diff -Nru ruby-haml-rails-2.0.1/.github/workflows/ruby.yml ruby-haml-rails-2.1.0/.github/workflows/ruby.yml --- ruby-haml-rails-2.0.1/.github/workflows/ruby.yml 1970-01-01 00:00:00.000000000 +0000 +++ ruby-haml-rails-2.1.0/.github/workflows/ruby.yml 2022-10-17 04:20:52.000000000 +0000 @@ -0,0 +1,64 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake +# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby + +name: Ruby + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: + - 3.1 + - 3.0 + - 2.7 + - jruby + gemfile: + - rails_7_0 + - rails_6_1 + - rails_6_0 + + include: + - ruby-version: 2.7 + gemfile: rails_5_2 + - ruby-version: 2.7 + gemfile: rails_5_1 + + - ruby-version: 2.6 + gemfile: rails_6_1 + - ruby-version: 2.6 + gemfile: rails_6_0 + - ruby-version: 2.6 + gemfile: rails_5_2 + - ruby-version: 2.6 + gemfile: rails_5_1 + + exclude: + - ruby-version: jruby + gemfile: rails_7_0 + + env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby + # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, + # change this to (see https://github.com/ruby/setup-ruby#versioning): + uses: ruby/setup-ruby@v1 + # uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake diff -Nru ruby-haml-rails-2.0.1/.gitignore ruby-haml-rails-2.1.0/.gitignore --- ruby-haml-rails-2.0.1/.gitignore 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/.gitignore 2022-10-17 04:20:52.000000000 +0000 @@ -4,3 +4,4 @@ gemfiles/*.lock tmp/ /vendor/bundle +log diff -Nru ruby-haml-rails-2.0.1/haml-rails.gemspec ruby-haml-rails-2.1.0/haml-rails.gemspec --- ruby-haml-rails-2.0.1/haml-rails.gemspec 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/haml-rails.gemspec 2022-10-17 04:20:52.000000000 +0000 @@ -7,25 +7,24 @@ s.platform = Gem::Platform::RUBY s.authors = ["André Arko"] s.email = ["andre@arko.net"] - s.homepage = "https://github.com/indirect/haml-rails" + s.homepage = "https://github.com/haml/haml-rails" s.summary = "let your Gemfile do the configuring" - s.description = "Haml-rails provides Haml generators for Rails 4. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah." + s.description = "Haml-rails provides Haml generators for Rails 5. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah." s.licenses = ["MIT"] - s.rubyforge_project = "haml-rails" s.required_rubygems_version = ">= 2.0.0" s.required_ruby_version = ">= 2.3.0" - s.add_dependency "haml", [">= 4.0.6", "< 6.0"] + s.add_dependency "haml", [">= 4.0.6"] s.add_dependency "activesupport", [">= 5.1"] s.add_dependency "actionpack", [">= 5.1"] s.add_dependency "railties", [">= 5.1"] - s.add_dependency "html2haml", [">= 1.0.1"] - + + s.add_development_dependency "html2haml", [">= 1.0.1"] s.add_development_dependency "rails", [">= 5.1"] - s.add_development_dependency "bundler", "~> 2.0" + s.add_development_dependency "bundler" s.add_development_dependency "rake" - s.add_development_dependency 'appraisal', '~> 1.0' + s.add_development_dependency 'appraisal' s.files = `git ls-files`.split("\n") s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/} diff -Nru ruby-haml-rails-2.0.1/lib/generators/haml/controller/controller_generator.rb ruby-haml-rails-2.1.0/lib/generators/haml/controller/controller_generator.rb --- ruby-haml-rails-2.0.1/lib/generators/haml/controller/controller_generator.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/lib/generators/haml/controller/controller_generator.rb 2022-10-17 04:20:52.000000000 +0000 @@ -5,12 +5,11 @@ class ControllerGenerator < Erb::Generators::ControllerGenerator source_root File.expand_path("../templates", __FILE__) - protected + private def handler :haml end - end end end diff -Nru ruby-haml-rails-2.0.1/lib/generators/haml/mailer/mailer_generator.rb ruby-haml-rails-2.1.0/lib/generators/haml/mailer/mailer_generator.rb --- ruby-haml-rails-2.0.1/lib/generators/haml/mailer/mailer_generator.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/lib/generators/haml/mailer/mailer_generator.rb 2022-10-17 04:20:52.000000000 +0000 @@ -1,42 +1,14 @@ -require 'generators/haml/controller/controller_generator' +require 'rails/generators/erb/mailer/mailer_generator' module Haml module Generators - class MailerGenerator < ControllerGenerator + class MailerGenerator < Erb::Generators::MailerGenerator source_root File.expand_path("../templates", __FILE__) - def copy_view_files - if ::Rails.version.to_s >= "4.2.0" - view_base_path = File.join("app/views", class_path, file_name + "_mailer") - empty_directory view_base_path + private - if behavior == :invoke - formats.each do |format| - layout_path = File.join("app/views/layouts", class_path, filename_with_extensions("mailer", format)) - template filename_with_extensions(:layout, format), layout_path unless File.exist?(layout_path) - end - end - - actions.each do |action| - @action = action - - formats.each do |format| - @path = File.join(view_base_path, filename_with_extensions(action, format)) - template filename_with_extensions(:view, format), @path - end - end - else - super - end - end - - protected - def format - :text - end - - def formats - [:text, :html] + def handler + :haml end end end diff -Nru ruby-haml-rails-2.0.1/lib/generators/haml/scaffold/scaffold_generator.rb ruby-haml-rails-2.1.0/lib/generators/haml/scaffold/scaffold_generator.rb --- ruby-haml-rails-2.0.1/lib/generators/haml/scaffold/scaffold_generator.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/lib/generators/haml/scaffold/scaffold_generator.rb 2022-10-17 04:20:52.000000000 +0000 @@ -21,7 +21,7 @@ end end - protected + private def available_views %w(index edit show new) @@ -30,7 +30,6 @@ def handler :haml end - end end end diff -Nru ruby-haml-rails-2.0.1/lib/haml-rails/version.rb ruby-haml-rails-2.1.0/lib/haml-rails/version.rb --- ruby-haml-rails-2.0.1/lib/haml-rails/version.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/lib/haml-rails/version.rb 2022-10-17 04:20:52.000000000 +0000 @@ -1,5 +1,5 @@ module Haml module Rails - VERSION = "2.0.1" + VERSION = "2.1.0" end end diff -Nru ruby-haml-rails-2.0.1/lib/haml-rails.rb ruby-haml-rails-2.1.0/lib/haml-rails.rb --- ruby-haml-rails-2.0.1/lib/haml-rails.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/lib/haml-rails.rb 2022-10-17 04:20:52.000000000 +0000 @@ -4,8 +4,6 @@ module Haml module Rails - class Engine < ::Rails::Engine - end class Railtie < ::Rails::Railtie config.app_generators.template_engine :haml diff -Nru ruby-haml-rails-2.0.1/lib/rails/generators/haml/application_layout/application_layout_generator.rb ruby-haml-rails-2.1.0/lib/rails/generators/haml/application_layout/application_layout_generator.rb --- ruby-haml-rails-2.0.1/lib/rails/generators/haml/application_layout/application_layout_generator.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/lib/rails/generators/haml/application_layout/application_layout_generator.rb 2022-10-17 04:20:53.000000000 +0000 @@ -4,7 +4,6 @@ module Haml module Generators class ApplicationLayoutGenerator < ::Rails::Generators::Base - HTML_LAYOUT_PATH = 'app/views/layouts/application.html.erb' HAML_LAYOUT_PATH = 'app/views/layouts/application.html.haml' @@ -27,9 +26,7 @@ else puts "Error! There is no file named app/views/layouts/application.html.erb." end - end - end end end diff -Nru ruby-haml-rails-2.0.1/lib/tasks/erb2haml.rake ruby-haml-rails-2.1.0/lib/tasks/erb2haml.rake --- ruby-haml-rails-2.0.1/lib/tasks/erb2haml.rake 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/lib/tasks/erb2haml.rake 2022-10-17 04:20:53.000000000 +0000 @@ -10,6 +10,8 @@ exit end + erb_files_to_convert = erb_files.dup + haml_files_w_out_ext = haml_files.map { |f| f.gsub(/\.haml\z/, '') } # Get a list of all those erb files that already seem to have .haml equivalents @@ -22,21 +24,24 @@ puts "Some of your .html.erb files seem to already have .haml equivalents:" already_existing.map { |f| puts "\t#{f}" } - # Ask the user whether he/she would like to overwrite them. - begin - puts "Would you like to overwrite these .haml files? (y/n)" - should_overwrite = STDIN.gets.chomp.downcase[0] - end until ['y', 'n'].include?(should_overwrite) + if ENV.has_key?("HAML_RAILS_OVERWRITE_HAML") && (ENV["HAML_RAILS_OVERWRITE_HAML"] == "false") + should_overwrite = 'n' + else + # Ask the user whether he/she would like to overwrite them. + begin + puts "Would you like to overwrite these .haml files? (y/n)" + should_overwrite = STDIN.gets.chomp.downcase[0] + end until ['y', 'n'].include?(should_overwrite) + end puts '-'*80 # If we are not overwriting, remove each already_existing from our erb_files list if should_overwrite == 'n' - erb_files = erb_files - already_existing + erb_files_to_convert = erb_files - already_existing - if erb_files.empty? + if erb_files_to_convert.empty? # It is possible no .erb files remain, after we remove already_existing - puts "No .erb files remain. Task will now exit." - return + puts "No .erb files to convert" end else # Delete the current .haml @@ -44,7 +49,7 @@ end end - erb_files.each do |file| + erb_files_to_convert.each do |file| puts "Generating HAML for #{file}..." `html2haml #{file} #{file.gsub(/\.erb\z/, '.haml')}` end @@ -52,20 +57,19 @@ puts '-'*80 puts "HAML generated for the following files:" - erb_files.each do |file| + erb_files_to_convert.each do |file| puts "\t#{file}" end puts '-'*80 - begin - if ENV.has_key?("HAML_RAILS_DELETE_ERB") - should_delete = ENV["HAML_RAILS_DELETE_ERB"] == "true" ? "y" : "n" - else + if ENV.has_key?("HAML_RAILS_DELETE_ERB") && (ENV["HAML_RAILS_DELETE_ERB"] == "true") + should_delete = 'y' + else + begin puts 'Would you like to delete the original .erb files? (This is not recommended unless you are under version control.) (y/n)' should_delete = STDIN.gets.chomp.downcase[0] - end - end until ['y', 'n'].include?(should_delete) - + end until ['y', 'n'].include?(should_delete) + end if should_delete == 'y' puts "Deleting original .erb files." File.delete(*erb_files) diff -Nru ruby-haml-rails-2.0.1/README.md ruby-haml-rails-2.1.0/README.md --- ruby-haml-rails-2.0.1/README.md 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/README.md 2022-10-17 04:20:52.000000000 +0000 @@ -1,7 +1,7 @@ # Haml-rails -[![Build Status](https://travis-ci.org/indirect/haml-rails.svg)](https://travis-ci.org/indirect/haml-rails) +[![Build Status](https://travis-ci.org/haml/haml-rails.svg)](https://travis-ci.org/haml/haml-rails) -Haml-rails provides Haml generators for Rails 4. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah. +Haml-rails provides Haml generators for Rails 5. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah. To use it, add this line to your Gemfile: @@ -47,9 +47,13 @@ ### Older versions of Rails -The current version of Haml-rails requires 4.0.1 or later. +The current version of Haml-rails requires Rails 5.1 or later. -Haml-rails version 0.4 is the last version to support Rails 3. To use it, add this line to your Gemfile: +Haml-rails version 1.0.0 is the last version to support Rails 4. To use it, add this line to your Gemfile: + + gem "haml-rails", "~> 1.0.0" + +For Rails 3, use haml-rails version 0.4 by adding this line to your Gemfile instead: gem "haml-rails", "~> 0.4.0" diff -Nru ruby-haml-rails-2.0.1/test/lib/generators/haml/controller_generator_test.rb ruby-haml-rails-2.1.0/test/lib/generators/haml/controller_generator_test.rb --- ruby-haml-rails-2.0.1/test/lib/generators/haml/controller_generator_test.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/test/lib/generators/haml/controller_generator_test.rb 2022-10-17 04:20:53.000000000 +0000 @@ -1,5 +1,6 @@ require 'test_helper' -require 'lib/generators/haml/testing_helper' +require 'rails/generators/rails/controller/controller_generator' +require 'generators/haml/controller/controller_generator' class Haml::Generators::ControllerGeneratorTest < Rails::Generators::TestCase destination Rails.root @@ -11,8 +12,8 @@ arguments %w(Account foo bar --template-engine haml) test "should invoke haml engine" do - run_generator + run_generator assert_file "app/views/account/foo.html.haml" assert_file "app/views/account/bar.html.haml" - end + end end diff -Nru ruby-haml-rails-2.0.1/test/lib/generators/haml/mailer_generator_test.rb ruby-haml-rails-2.1.0/test/lib/generators/haml/mailer_generator_test.rb --- ruby-haml-rails-2.0.1/test/lib/generators/haml/mailer_generator_test.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/test/lib/generators/haml/mailer_generator_test.rb 2022-10-17 04:20:53.000000000 +0000 @@ -1,5 +1,6 @@ require 'test_helper' -require 'lib/generators/haml/testing_helper' +require 'rails/generators/mailer/mailer_generator' +require 'generators/haml/mailer/mailer_generator' class Haml::Generators::MailerGeneratorTest < Rails::Generators::TestCase destination File.join(Rails.root) @@ -64,4 +65,23 @@ end end end + + test 'suffix is not duplicated' do + if ::Rails.version.to_s >= '4.2' + run_generator ['notifier_mailer', 'foo', 'bar', '--template-engine', 'haml'] + + assert_no_file 'app/views/notifier_mailer_mailer/' + assert_file 'app/views/notifier_mailer/' + + assert_no_file 'app/views/notifier_mailer_mailer/foo.text.haml' + assert_file 'app/views/notifier_mailer/foo.text.haml' + assert_no_file 'app/views/notifier_mailer_mailer/foo.html.haml' + assert_file 'app/views/notifier_mailer/foo.html.haml' + + assert_no_file 'app/views/notifier_mailer_mailer/bar.text.haml' + assert_file 'app/views/notifier_mailer/bar.text.haml' + assert_no_file 'app/views/notifier_mailer_mailer/bar.html.haml' + assert_file 'app/views/notifier_mailer/bar.html.haml' + end + end end diff -Nru ruby-haml-rails-2.0.1/test/lib/generators/haml/scaffold_generator_test.rb ruby-haml-rails-2.1.0/test/lib/generators/haml/scaffold_generator_test.rb --- ruby-haml-rails-2.0.1/test/lib/generators/haml/scaffold_generator_test.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/test/lib/generators/haml/scaffold_generator_test.rb 2022-10-17 04:20:53.000000000 +0000 @@ -1,5 +1,6 @@ require 'test_helper' -require 'lib/generators/haml/testing_helper' +require 'rails/generators/rails/scaffold/scaffold_generator' +require 'generators/haml/scaffold/scaffold_generator' class Haml::Generators::ScaffoldGeneratorTest < Rails::Generators::TestCase destination File.join(Rails.root) diff -Nru ruby-haml-rails-2.0.1/test/lib/generators/haml/testing_helper.rb ruby-haml-rails-2.1.0/test/lib/generators/haml/testing_helper.rb --- ruby-haml-rails-2.0.1/test/lib/generators/haml/testing_helper.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/test/lib/generators/haml/testing_helper.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -require_generators :haml => ['scaffold', 'controller', 'mailer'] diff -Nru ruby-haml-rails-2.0.1/test/test_helper.rb ruby-haml-rails-2.1.0/test/test_helper.rb --- ruby-haml-rails-2.0.1/test/test_helper.rb 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/test/test_helper.rb 2022-10-17 04:20:53.000000000 +0000 @@ -1,76 +1,44 @@ require 'rubygems' require 'minitest/autorun' -require 'rails/all' +require 'action_pack' +require 'action_controller' +require 'action_view' +require 'rails' require 'rails/generators' require 'rails/generators/test_case' +Bundler.require(:default) class TestApp < Rails::Application config.root = File.dirname(__FILE__) + config.eager_load = false end module Rails def self.root - @root ||= File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp', 'rails')) + @root ||= Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp', 'rails'))) end end -# Call configure to load the settings from -# Rails.application.config.generators to Rails::Generators -Rails.application.load_generators +TestApp.initialize! Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} -def copy_routes - routes = File.join(File.dirname(__FILE__), 'fixtures', 'routes.rb') - destination = File.join(Rails.root, "config") - FileUtils.mkdir_p(destination) - FileUtils.cp File.expand_path(routes), File.expand_path(destination) -end - -# Asserts the given class exists in the given content. When a block is given, -# it yields the content of the class. -# -# assert_file "test/functional/accounts_controller_test.rb" do |controller_test| -# assert_class "AccountsControllerTest", controller_test do |klass| -# assert_match /context "index action"/, klass -# end -# end -# -def assert_class(klass, content) - assert content =~ /class #{klass}(\(.+\))?(.*?)\nend/m, "Expected to have class #{klass}" - yield $2.strip if block_given? -end - -def generator_list - { - :rails => ['scaffold', 'controller', 'mailer'], - :haml => ['scaffold', 'controller', 'mailer'] - } -end - -def path_prefix(name) - case name - when :rails - 'rails/generators' - else - 'generators' - end -end - -def require_generators(generator_list) - generator_list.each do |name, generators| - generators.each do |generator_name| - if name.to_s == 'rails' && generator_name.to_s == 'mailer' - require File.join(path_prefix(name), generator_name.to_s, "#{generator_name}_generator") - else - require File.join(path_prefix(name), name.to_s, generator_name.to_s, "#{generator_name}_generator") +module Haml + module Rails + module GeneratorTestHelpers + private + + def copy_routes + routes = File.join(File.dirname(__FILE__), 'fixtures', 'routes.rb') + destination = File.join(::Rails.root, "config") + FileUtils.mkdir_p(destination) + FileUtils.cp File.expand_path(routes), File.expand_path(destination) end end end end -alias :require_generator :require_generators -require_generators generator_list +::Rails::Generators::TestCase.include Haml::Rails::GeneratorTestHelpers # Remove tmp directory when test suite is completed MiniTest.after_run do diff -Nru ruby-haml-rails-2.0.1/.travis.yml ruby-haml-rails-2.1.0/.travis.yml --- ruby-haml-rails-2.0.1/.travis.yml 2019-05-31 08:24:39.000000000 +0000 +++ ruby-haml-rails-2.1.0/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -sudo: false -language: ruby -cache: bundler -before_install: - - "gem update --system" - - "gem install bundler" -rvm: - - 2.5.3 - - 2.4.5 - - 2.3.8 - - jruby-9.2.5.0 -gemfile: - - gemfiles/rails_5_2.gemfile - - gemfiles/rails_5_1.gemfile - - gemfiles/rails_5_2.gemfile - - gemfiles/rails_6.beta2.gemfile -matrix: - exclude: - - rvm: 2.3.8 - gemfile: gemfiles/rails_6.beta2.gemfile - - rvm: 2.4.5 - gemfile: gemfiles/rails_6.beta2.gemfile -script: "bundle exec rake test"