From b662aea3f4c5e64ebf9d34ae13095b27cb1f975f Mon Sep 17 00:00:00 2001 From: Vincent Robert Date: Wed, 28 Jun 2023 10:39:13 +0200 Subject: [PATCH 01/11] Update CI config: add latest Redmine releases --- .github/workflows/{5_0_4.yml => 4_2_10.yml} | 4 ++-- .github/workflows/{4_2_9.yml => 5_0_5.yml} | 4 ++-- README.md | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) rename .github/workflows/{5_0_4.yml => 4_2_10.yml} (98%) rename .github/workflows/{4_2_9.yml => 5_0_5.yml} (98%) diff --git a/.github/workflows/5_0_4.yml b/.github/workflows/4_2_10.yml similarity index 98% rename from .github/workflows/5_0_4.yml rename to .github/workflows/4_2_10.yml index 652d338..0d8b96b 100644 --- a/.github/workflows/5_0_4.yml +++ b/.github/workflows/4_2_10.yml @@ -1,8 +1,8 @@ -name: Tests 5.0.4 +name: Tests 4.2.10 env: PLUGIN_NAME: redmine_base_deface - REDMINE_VERSION: 5.0.4 + REDMINE_VERSION: 4.2.10 RAILS_ENV: test on: diff --git a/.github/workflows/4_2_9.yml b/.github/workflows/5_0_5.yml similarity index 98% rename from .github/workflows/4_2_9.yml rename to .github/workflows/5_0_5.yml index f6675a6..88a2d29 100644 --- a/.github/workflows/4_2_9.yml +++ b/.github/workflows/5_0_5.yml @@ -1,8 +1,8 @@ -name: Tests 4.2.9 +name: Tests 5.0.5 env: PLUGIN_NAME: redmine_base_deface - REDMINE_VERSION: 4.2.9 + REDMINE_VERSION: 5.0.5 RAILS_ENV: test on: diff --git a/README.md b/README.md index 4d61b65..1b8977b 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,12 @@ Test status |Plugin branch| Redmine Version | Test Status | |-------------|-----------------|-------------------| -|master | 5.0.4 | [![5.0.4][1]][5] | -|master | 4.2.9 | [![4.2.9][2]][5] | +|master | 5.0.5 | [![5.0.5][1]][5] | +|master | 4.2.10 | [![4.2.10][2]][5] | |master | master | [![master][4]][5] | -[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_0_4.yml/badge.svg -[2]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/4_2_9.yml/badge.svg +[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_0_5.yml/badge.svg +[2]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/4_2_10.yml/badge.svg [4]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/master.yml/badge.svg [5]: https://github.com/jbbarth/redmine_base_deface/actions From 132539b1e9e42a67d4506b08554ee7f787436d0b Mon Sep 17 00:00:00 2001 From: Vincent Robert Date: Wed, 18 Oct 2023 12:22:30 +0200 Subject: [PATCH 02/11] Update CI config: Include the latest Redmine versions --- .github/workflows/{4_2_10.yml => 4_2_11.yml} | 4 ++-- .github/workflows/{5_0_5.yml => 5_0_6.yml} | 4 ++-- README.md | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) rename .github/workflows/{4_2_10.yml => 4_2_11.yml} (98%) rename .github/workflows/{5_0_5.yml => 5_0_6.yml} (98%) diff --git a/.github/workflows/4_2_10.yml b/.github/workflows/4_2_11.yml similarity index 98% rename from .github/workflows/4_2_10.yml rename to .github/workflows/4_2_11.yml index 0d8b96b..749b0de 100644 --- a/.github/workflows/4_2_10.yml +++ b/.github/workflows/4_2_11.yml @@ -1,8 +1,8 @@ -name: Tests 4.2.10 +name: Tests 4.2.11 env: PLUGIN_NAME: redmine_base_deface - REDMINE_VERSION: 4.2.10 + REDMINE_VERSION: 4.2.11 RAILS_ENV: test on: diff --git a/.github/workflows/5_0_5.yml b/.github/workflows/5_0_6.yml similarity index 98% rename from .github/workflows/5_0_5.yml rename to .github/workflows/5_0_6.yml index 88a2d29..c7ae4a3 100644 --- a/.github/workflows/5_0_5.yml +++ b/.github/workflows/5_0_6.yml @@ -1,8 +1,8 @@ -name: Tests 5.0.5 +name: Tests 5.0.6 env: PLUGIN_NAME: redmine_base_deface - REDMINE_VERSION: 5.0.5 + REDMINE_VERSION: 5.0.6 RAILS_ENV: test on: diff --git a/README.md b/README.md index 1b8977b..3d6a2fd 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,12 @@ Test status |Plugin branch| Redmine Version | Test Status | |-------------|-----------------|-------------------| -|master | 5.0.5 | [![5.0.5][1]][5] | -|master | 4.2.10 | [![4.2.10][2]][5] | +|master | 5.0.6 | [![5.0.6][1]][5] | +|master | 4.2.11 | [![4.2.11][2]][5] | |master | master | [![master][4]][5] | -[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_0_5.yml/badge.svg -[2]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/4_2_10.yml/badge.svg +[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_0_6.yml/badge.svg +[2]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/4_2_11.yml/badge.svg [4]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/master.yml/badge.svg [5]: https://github.com/jbbarth/redmine_base_deface/actions From 50a0e67903354e4ed0c34a5b3bac700abf0b6c83 Mon Sep 17 00:00:00 2001 From: maxrossello <4066651+maxrossello@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:14:39 +0100 Subject: [PATCH 03/11] Enable processing of DSL .deface files (#14) * Enable processing of DSL .deface files --- .gitignore | 12 ++++++++++++ init.rb | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2ddea64 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +.buildpath +.byebug_history +.metadata/ +.project +Gemfile.lock +config/ +db/ +files/ +log/ +public/ +tmp/ + diff --git a/init.rb b/init.rb index 4c861a9..682c460 100644 --- a/init.rb +++ b/init.rb @@ -2,7 +2,7 @@ name 'Redmine Base Deface plugin' author 'Jean-Baptiste BARTH' description 'This is a plugin for Redmine' - version '1.6.2' + version '5.0.6' url 'https://github.com/jbbarth/redmine_base_deface' author_url 'jeanbaptiste.barth@gmail.com' #doesn't work since redmine evaluates dependencies as it loads, and loads in lexical order @@ -20,6 +20,10 @@ load File.expand_path(path, __FILE__) end + Dir.glob("#{Rails.root}/plugins/*/app/overrides/**/*.deface").each do |path| + Deface::DSL::Loader::load File.expand_path(path, __FILE__) + end + Rails.application.config.after_initialize do require_relative "lib/applicator_patch" end From 5d7daaef9abff233507a1632736a579ef51fa293 Mon Sep 17 00:00:00 2001 From: Vincent Robert Date: Tue, 27 Feb 2024 16:39:22 +0100 Subject: [PATCH 04/11] Update CI config and add latest Redmine version --- .github/workflows/4_2_11.yml | 8 ++++---- .github/workflows/{5_0_6.yml => 5_1_1.yml} | 14 +++++++------- .github/workflows/master.yml | 10 +++++----- README.md | 4 ++-- init.rb | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) rename .github/workflows/{5_0_6.yml => 5_1_1.yml} (94%) diff --git a/.github/workflows/4_2_11.yml b/.github/workflows/4_2_11.yml index 749b0de..f2503ed 100644 --- a/.github/workflows/4_2_11.yml +++ b/.github/workflows/4_2_11.yml @@ -37,7 +37,7 @@ jobs: steps: - name: Checkout Redmine - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: redmine/redmine ref: ${{ env.REDMINE_VERSION }} @@ -48,7 +48,7 @@ jobs: - name: Install package dependencies run: > - sudo apt-get install --yes --quiet + sudo apt-get update && sudo apt-get install --yes --quiet build-essential cmake libicu-dev @@ -81,7 +81,7 @@ jobs: run: gem install bundler -v '~> 1.0' - name: Checkout dependencies - Base RSpec plugin - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: jbbarth/redmine_base_rspec path: redmine/plugins/redmine_base_rspec @@ -114,7 +114,7 @@ jobs: bundle exec rails test:scm:setup:subversion - name: Checkout plugin - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: redmine/plugins/${{ env.PLUGIN_NAME }} diff --git a/.github/workflows/5_0_6.yml b/.github/workflows/5_1_1.yml similarity index 94% rename from .github/workflows/5_0_6.yml rename to .github/workflows/5_1_1.yml index c7ae4a3..873b55c 100644 --- a/.github/workflows/5_0_6.yml +++ b/.github/workflows/5_1_1.yml @@ -1,8 +1,8 @@ -name: Tests 5.0.6 +name: Tests 5.1.1 env: PLUGIN_NAME: redmine_base_deface - REDMINE_VERSION: 5.0.6 + REDMINE_VERSION: 5.1.1 RAILS_ENV: test on: @@ -16,7 +16,7 @@ jobs: strategy: matrix: - ruby: ['2.7'] + ruby: ['3.1'] db: ['postgres'] fail-fast: false @@ -37,7 +37,7 @@ jobs: steps: - name: Checkout Redmine - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: redmine/redmine ref: ${{ env.REDMINE_VERSION }} @@ -48,7 +48,7 @@ jobs: - name: Install package dependencies run: > - sudo apt-get install --yes --quiet + sudo apt-get update && sudo apt-get install --yes --quiet build-essential cmake libicu-dev @@ -81,7 +81,7 @@ jobs: run: gem install bundler -v '~> 1.0' - name: Checkout dependencies - Base RSpec plugin - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: jbbarth/redmine_base_rspec path: redmine/plugins/redmine_base_rspec @@ -114,7 +114,7 @@ jobs: bundle exec rails test:scm:setup:subversion - name: Checkout plugin - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: redmine/plugins/${{ env.PLUGIN_NAME }} diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index ef0e421..90a076a 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - ruby: ['2.7'] + ruby: ['3.2'] db: ['postgres'] fail-fast: false @@ -37,7 +37,7 @@ jobs: steps: - name: Checkout Redmine - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: redmine/redmine ref: ${{ env.REDMINE_VERSION }} @@ -48,7 +48,7 @@ jobs: - name: Install package dependencies run: > - sudo apt-get install --yes --quiet + sudo apt-get update && sudo apt-get install --yes --quiet build-essential cmake libicu-dev @@ -81,7 +81,7 @@ jobs: run: gem install bundler -v '~> 1.0' - name: Checkout dependencies - Base RSpec plugin - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: jbbarth/redmine_base_rspec path: redmine/plugins/redmine_base_rspec @@ -114,7 +114,7 @@ jobs: bundle exec rails test:scm:setup:subversion - name: Checkout plugin - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: redmine/plugins/${{ env.PLUGIN_NAME }} diff --git a/README.md b/README.md index 3d6a2fd..925e8da 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ Test status |Plugin branch| Redmine Version | Test Status | |-------------|-----------------|-------------------| -|master | 5.0.6 | [![5.0.6][1]][5] | +|master | 5.1.1 | [![5.1.1][1]][5] | |master | 4.2.11 | [![4.2.11][2]][5] | |master | master | [![master][4]][5] | -[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_0_6.yml/badge.svg +[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_1_1.yml/badge.svg [2]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/4_2_11.yml/badge.svg [4]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/master.yml/badge.svg [5]: https://github.com/jbbarth/redmine_base_deface/actions diff --git a/init.rb b/init.rb index 682c460..4e20517 100644 --- a/init.rb +++ b/init.rb @@ -2,7 +2,7 @@ name 'Redmine Base Deface plugin' author 'Jean-Baptiste BARTH' description 'This is a plugin for Redmine' - version '5.0.6' + version '5.1.1' url 'https://github.com/jbbarth/redmine_base_deface' author_url 'jeanbaptiste.barth@gmail.com' #doesn't work since redmine evaluates dependencies as it loads, and loads in lexical order From acc507cb80d214eb581f5e6cd0a0b7c682e5cd7d Mon Sep 17 00:00:00 2001 From: Vincent Robert Date: Wed, 15 May 2024 10:40:35 +0200 Subject: [PATCH 05/11] Update CI config: add latest Redmine version --- .github/workflows/{5_1_1.yml => 5_1_2.yml} | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{5_1_1.yml => 5_1_2.yml} (98%) diff --git a/.github/workflows/5_1_1.yml b/.github/workflows/5_1_2.yml similarity index 98% rename from .github/workflows/5_1_1.yml rename to .github/workflows/5_1_2.yml index 873b55c..07dfb0f 100644 --- a/.github/workflows/5_1_1.yml +++ b/.github/workflows/5_1_2.yml @@ -1,8 +1,8 @@ -name: Tests 5.1.1 +name: Tests 5.1.2 env: PLUGIN_NAME: redmine_base_deface - REDMINE_VERSION: 5.1.1 + REDMINE_VERSION: 5.1.2 RAILS_ENV: test on: diff --git a/README.md b/README.md index 925e8da..79f5f70 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ Test status |Plugin branch| Redmine Version | Test Status | |-------------|-----------------|-------------------| -|master | 5.1.1 | [![5.1.1][1]][5] | +|master | 5.1.2 | [![5.1.2][1]][5] | |master | 4.2.11 | [![4.2.11][2]][5] | |master | master | [![master][4]][5] | -[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_1_1.yml/badge.svg +[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_1_2.yml/badge.svg [2]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/4_2_11.yml/badge.svg [4]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/master.yml/badge.svg [5]: https://github.com/jbbarth/redmine_base_deface/actions From 71fe7b13afe60f5b1c657742c3277290be8ab0c6 Mon Sep 17 00:00:00 2001 From: Vincent Robert Date: Wed, 15 May 2024 11:26:39 +0200 Subject: [PATCH 06/11] Update CI config: fix incompatibility with latest Mocha gem version --- .github/workflows/4_2_11.yml | 2 ++ .github/workflows/5_1_2.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/4_2_11.yml b/.github/workflows/4_2_11.yml index f2503ed..a886a7a 100644 --- a/.github/workflows/4_2_11.yml +++ b/.github/workflows/4_2_11.yml @@ -89,6 +89,8 @@ jobs: - name: Prepare Redmine source working-directory: redmine run: | + # TODO Remove the following line when https://www.redmine.org/issues/40551 is fixed + sed -i -e 's/.*mocha.*/ gem "mocha", "2.1.0"/' Gemfile # Fix core tests not compatible with Mocha 2.2.0 sed -i '/rubocop/d' Gemfile rm -f .rubocop* cp plugins/redmine_base_rspec/spec/support/database-${{ matrix.db }}.yml config/database.yml diff --git a/.github/workflows/5_1_2.yml b/.github/workflows/5_1_2.yml index 07dfb0f..fa130ea 100644 --- a/.github/workflows/5_1_2.yml +++ b/.github/workflows/5_1_2.yml @@ -89,6 +89,8 @@ jobs: - name: Prepare Redmine source working-directory: redmine run: | + # TODO Remove the following line when https://www.redmine.org/issues/40551 is fixed + sed -i -e 's/.*mocha.*/ gem "mocha", "2.1.0"/' Gemfile # Fix core tests not compatible with Mocha 2.2.0 sed -i '/rubocop/d' Gemfile rm -f .rubocop* cp plugins/redmine_base_rspec/spec/support/database-${{ matrix.db }}.yml config/database.yml From b2325d90f37d4b5febadac32d2159d8d587f53f2 Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 12 Nov 2024 11:00:25 +0100 Subject: [PATCH 07/11] Update CI config: add Redmine 6 and drop support of Redmine 4 --- .github/workflows/{5_1_2.yml => 5_1_4.yml} | 8 +++----- .github/workflows/{4_2_11.yml => 6_0_0.yml} | 8 +++----- README.md | 8 ++++---- 3 files changed, 10 insertions(+), 14 deletions(-) rename .github/workflows/{5_1_2.yml => 5_1_4.yml} (93%) rename .github/workflows/{4_2_11.yml => 6_0_0.yml} (93%) diff --git a/.github/workflows/5_1_2.yml b/.github/workflows/5_1_4.yml similarity index 93% rename from .github/workflows/5_1_2.yml rename to .github/workflows/5_1_4.yml index fa130ea..a8ca41d 100644 --- a/.github/workflows/5_1_2.yml +++ b/.github/workflows/5_1_4.yml @@ -1,8 +1,8 @@ -name: Tests 5.1.2 +name: Tests 5.1.4 env: PLUGIN_NAME: redmine_base_deface - REDMINE_VERSION: 5.1.2 + REDMINE_VERSION: 5.1.4 RAILS_ENV: test on: @@ -16,7 +16,7 @@ jobs: strategy: matrix: - ruby: ['3.1'] + ruby: ['3.2'] db: ['postgres'] fail-fast: false @@ -89,8 +89,6 @@ jobs: - name: Prepare Redmine source working-directory: redmine run: | - # TODO Remove the following line when https://www.redmine.org/issues/40551 is fixed - sed -i -e 's/.*mocha.*/ gem "mocha", "2.1.0"/' Gemfile # Fix core tests not compatible with Mocha 2.2.0 sed -i '/rubocop/d' Gemfile rm -f .rubocop* cp plugins/redmine_base_rspec/spec/support/database-${{ matrix.db }}.yml config/database.yml diff --git a/.github/workflows/4_2_11.yml b/.github/workflows/6_0_0.yml similarity index 93% rename from .github/workflows/4_2_11.yml rename to .github/workflows/6_0_0.yml index a886a7a..282d73e 100644 --- a/.github/workflows/4_2_11.yml +++ b/.github/workflows/6_0_0.yml @@ -1,8 +1,8 @@ -name: Tests 4.2.11 +name: Tests 6.0.0 env: PLUGIN_NAME: redmine_base_deface - REDMINE_VERSION: 4.2.11 + REDMINE_VERSION: 6.0.0 RAILS_ENV: test on: @@ -16,7 +16,7 @@ jobs: strategy: matrix: - ruby: ['2.7'] + ruby: ['3.3'] db: ['postgres'] fail-fast: false @@ -89,8 +89,6 @@ jobs: - name: Prepare Redmine source working-directory: redmine run: | - # TODO Remove the following line when https://www.redmine.org/issues/40551 is fixed - sed -i -e 's/.*mocha.*/ gem "mocha", "2.1.0"/' Gemfile # Fix core tests not compatible with Mocha 2.2.0 sed -i '/rubocop/d' Gemfile rm -f .rubocop* cp plugins/redmine_base_rspec/spec/support/database-${{ matrix.db }}.yml config/database.yml diff --git a/README.md b/README.md index 79f5f70..d4dbdb3 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,12 @@ Test status |Plugin branch| Redmine Version | Test Status | |-------------|-----------------|-------------------| -|master | 5.1.2 | [![5.1.2][1]][5] | -|master | 4.2.11 | [![4.2.11][2]][5] | +|master | 6.0.0 | [![6.0.0][1]][5] | +|master | 5.1.4 | [![5.1.4][2]][5] | |master | master | [![master][4]][5] | -[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_1_2.yml/badge.svg -[2]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/4_2_11.yml/badge.svg +[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/6_0_0.yml/badge.svg +[2]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_1_4.yml/badge.svg [4]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/master.yml/badge.svg [5]: https://github.com/jbbarth/redmine_base_deface/actions From ca5b127c0c2efd4ac1134cd01d68a5a1dfbb7e47 Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 13 Nov 2024 10:38:17 +0100 Subject: [PATCH 08/11] Update Deface gem to latest version as we drop support of Redmine 4 --- .github/workflows/{6_0_0.yml => 6_0_1.yml} | 4 ++-- PluginGemfile | 4 +--- README.md | 4 ++-- init.rb | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) rename .github/workflows/{6_0_0.yml => 6_0_1.yml} (98%) diff --git a/.github/workflows/6_0_0.yml b/.github/workflows/6_0_1.yml similarity index 98% rename from .github/workflows/6_0_0.yml rename to .github/workflows/6_0_1.yml index 282d73e..8533986 100644 --- a/.github/workflows/6_0_0.yml +++ b/.github/workflows/6_0_1.yml @@ -1,8 +1,8 @@ -name: Tests 6.0.0 +name: Tests 6.0.1 env: PLUGIN_NAME: redmine_base_deface - REDMINE_VERSION: 6.0.0 + REDMINE_VERSION: 6.0.1 RAILS_ENV: test on: diff --git a/PluginGemfile b/PluginGemfile index 4fba61c..3f43f8b 100644 --- a/PluginGemfile +++ b/PluginGemfile @@ -1,3 +1 @@ -# Later version of the Deface gem may not be fully compatible with Rails 5.2 & Redmine 4.2 -# bug described here: https://www.redmine.org/issues/35430 -gem 'deface', '1.6.2' +gem 'deface', '~> 1.9.0' diff --git a/README.md b/README.md index d4dbdb3..ade70fa 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Installation This plugin is compatible with Redmine 2.1.0+. -Please apply general instructions for plugins [here](http://www.redmine.org/wiki/redmine/Plugins). +Please apply general instructions for plugins [here](https://www.redmine.org/projects/redmine/wiki/Plugins). First download the source or clone the plugin and put it in the "plugins/" directory of your redmine instance. Note that this is crucial that the directory is named redmine_base_deface ! @@ -24,7 +24,7 @@ Test status |Plugin branch| Redmine Version | Test Status | |-------------|-----------------|-------------------| -|master | 6.0.0 | [![6.0.0][1]][5] | +|master | 6.0.1 | [![6.0.1][1]][5] | |master | 5.1.4 | [![5.1.4][2]][5] | |master | master | [![master][4]][5] | diff --git a/init.rb b/init.rb index 4e20517..2f8bfd7 100644 --- a/init.rb +++ b/init.rb @@ -2,7 +2,7 @@ name 'Redmine Base Deface plugin' author 'Jean-Baptiste BARTH' description 'This is a plugin for Redmine' - version '5.1.1' + version '6.0.1' url 'https://github.com/jbbarth/redmine_base_deface' author_url 'jeanbaptiste.barth@gmail.com' #doesn't work since redmine evaluates dependencies as it loads, and loads in lexical order From 7e8df7d9df8d82f55144c8981920ada52d6b38e1 Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 13 Nov 2024 14:03:28 +0100 Subject: [PATCH 09/11] Fix README CI badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ade70fa..1da9896 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Test status |master | 5.1.4 | [![5.1.4][2]][5] | |master | master | [![master][4]][5] | -[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/6_0_0.yml/badge.svg +[1]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/6_0_1.yml/badge.svg [2]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/5_1_4.yml/badge.svg [4]: https://github.com/jbbarth/redmine_base_deface/actions/workflows/master.yml/badge.svg [5]: https://github.com/jbbarth/redmine_base_deface/actions From de399aa4bf786d29db8c426353054408ee3a849a Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 13 Nov 2024 15:01:05 +0100 Subject: [PATCH 10/11] Update CI Config: use Ruby 3.3 with master branch --- .github/workflows/master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 90a076a..08ebb86 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - ruby: ['3.2'] + ruby: ['3.3'] db: ['postgres'] fail-fast: false From 3ca97c09ec06f498823a7f9678843781199abbec Mon Sep 17 00:00:00 2001 From: Vincent Date: Thu, 21 Nov 2024 15:32:45 +0100 Subject: [PATCH 11/11] Update patched method to reflect changes in Deface 1.9.0 --- lib/applicator_patch.rb | 75 +++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 47 deletions(-) diff --git a/lib/applicator_patch.rb b/lib/applicator_patch.rb index dbbf8ca..034337a 100644 --- a/lib/applicator_patch.rb +++ b/lib/applicator_patch.rb @@ -6,64 +6,45 @@ module Deface module Applicator module ClassMethods - # applies all applicable overrides to given source - # - def apply(source, details, log = true, syntax = :erb) - overrides = find(details) + # applies specified overrides to given source + def apply_overrides(source, overrides:, log: true) - if log && overrides.size > 0 - Rails.logger.debug "\e[1;32mDeface:\e[0m #{overrides.size} overrides found for '#{details[:virtual_path]}'" - end + doc = Deface::Parser.convert(source) - unless overrides.empty? - case syntax - when :haml - #convert haml to erb before parsing before - source = Deface::HamlConverter.new(source.to_param).result - when :slim - source = Deface::SlimConverter.new(source.to_param).result + overrides.each do |override| + if override.disabled? + Rails.logger.debug("\e[1;32mDeface:\e[0m '#{override.name}' is disabled") if log + next end - doc = Deface::Parser.convert(source) - - overrides.each do |override| - if override.disabled? - Rails.logger.debug("\e[1;32mDeface:\e[0m '#{override.name}' is disabled") if log - next - end + override.parsed_document = doc + matches = override.matcher.matches(doc, log) - override.parsed_document = doc - matches = override.matcher.matches(doc, log) + if log + Rails.logger.send(matches.size == 0 ? :error : :debug, "\e[1;32mDeface:\e[0m '#{override.name}' matched #{matches.size} times with '#{override.selector}'") - if log - Rails.logger.send(matches.size == 0 ? :error : :debug, "\e[1;32mDeface:\e[0m '#{override.name}' matched #{matches.size} times with '#{override.selector}'") - - # temporarily check and notify on use of old selector styles. - # - if matches.empty? && override.selector.match(/code|erb-loud|erb-silent/) - Rails.logger.error "\e[1;32mDeface: [WARNING]\e[0m Override '#{override.name}' may be using an invalid selector of '#{override.selector}', tags are now " - end - end - - if matches.empty? - override.failure = "failed to match :#{override.action} selector '#{override.selector}'" - else - override.failure = nil - matches.each { |match| override.execute_action match } + # temporarily check and notify on use of old selector styles. + # + if matches.empty? && override.selector.match(/code|erb-loud|erb-silent/) + Rails.logger.error "\e[1;32mDeface: [WARNING]\e[0m Override '#{override.name}' may be using an invalid selector of '#{override.selector}', tags are now " end end - # Prevents any caching by rails in development mode. - details[:updated_at] = Time.now if Deface.before_rails_6? + if matches.empty? + override.failure = "failed to match :#{override.action} selector '#{override.selector}'" + else + override.failure = nil + matches.each {|match| override.execute_action match } + end + end - ############################### - ### START PATCH - source = CGI.unescapeHTML doc.to_s - ### END PATCH - ############################### + ############################### + ### START PATCH + source = CGI.unescapeHTML doc.to_s + ### END PATCH + ############################### - Deface::Parser.undo_erb_markup!(source) - end + Deface::Parser.undo_erb_markup!(source) source end