From 63993f1aed1cdda8507deb1285bd86aa16fa6586 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:12:38 +0100 Subject: [PATCH 01/36] Update LICENSE --- LICENSE.txt | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 1c950f2..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Cyril Mougel - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 164daa9299fb702b23241c0dda1ebd816eab6ca7 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:12:47 +0100 Subject: [PATCH 02/36] Update LICENSE --- LICENSE | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE b/LICENSE index 5ee0e75..f71b1ca 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ The MIT License (MIT) Copyright (c) 2013 Errbit +Copyright (c) 2013 Cyril Mougel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From ad30b7dfceb8b61f54f93f15737033427345a3e7 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:13:22 +0100 Subject: [PATCH 03/36] Update gemspec authors and email --- errbit_plugin.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/errbit_plugin.gemspec b/errbit_plugin.gemspec index 4e438c8..cecbd3e 100644 --- a/errbit_plugin.gemspec +++ b/errbit_plugin.gemspec @@ -5,8 +5,8 @@ require "errbit_plugin/version" Gem::Specification.new do |spec| spec.name = "errbit_plugin" spec.version = ErrbitPlugin::VERSION - spec.authors = ["Stephen Crosby"] - spec.email = ["stevecrozz@gmail.com"] + spec.authors = ["Ihor Zubkov"] + spec.email = ["igor.zubkov@gmail.com"] spec.description = "Base to create an Errbit-NG plugins" spec.summary = "Base to create an Errbit-NG plugins" spec.homepage = "http://github.com/errbit-ng/errbit-ng-plugin" From 9744e6742580fadae92f13dbb2db0af4530c52be Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:15:11 +0100 Subject: [PATCH 04/36] Update LICENSE --- LICENSE | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index f71b1ca..98dfe94 100644 --- a/LICENSE +++ b/LICENSE @@ -3,19 +3,20 @@ The MIT License (MIT) Copyright (c) 2013 Errbit Copyright (c) 2013 Cyril Mougel -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. From dc670a4f6eba4209779b7fe1d2aa7e0f034ff303 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:15:39 +0100 Subject: [PATCH 05/36] LICENSE -> LICENSE.txt --- LICENSE => LICENSE.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE => LICENSE.txt (100%) diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt From fcd2e4b8923ab2e2b6a08bbb8517a6da8f21945e Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:18:21 +0100 Subject: [PATCH 06/36] Update Contributing and add License --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cbe1690..7191323 100644 --- a/README.md +++ b/README.md @@ -128,5 +128,8 @@ end ## Contributing -Discuss any changes you'd like to make with the authors on the mailing list, or -by opening a github issue. +Bug reports and pull requests are welcome on GitHub at https://github.com/errbit-ng/errbit-ng-plugin. + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). From 578e81271d789b400f16f766ab83dd8b1b9f8bc5 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:20:57 +0100 Subject: [PATCH 07/36] Update example --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7191323..58699e1 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,13 @@ the class must extend ErrbitPlugin::IssueTracker. Here's an example: ```ruby class MyIssueTracker < ErrbitPlugin::IssueTracker - # A unique label for your tracker plugin used internally by errbit def self.label - 'my-tracker' + "my-tracker" end def self.note - 'a note about this tracker that users will see' + "a note about this tracker that users will see" end # Form fields that will be presented to the administrator when setting up @@ -60,9 +59,9 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker # and the binary icon data. def self.icons @icons ||= { - create: [ 'image/png', File.read('./path/to/create.png') ], - goto: [ 'image/png', File.read('./path/to/goto.png') ], - inactive: [ 'image/png', File.read('./path/to/inactive.png') ], + create: ["image/png", File.read("./path/to/create.png")], + goto: ["image/png", File.read("./path/to/goto.png")], + inactive: ["image/png", File.read("./path/to/inactive.png")] } end @@ -80,7 +79,7 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker if options[:username] {} else - { field_one: 'username must be present' } + {field_one: "username must be present"} end end @@ -92,7 +91,7 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker def create_issue(title, body, user: {}) # Create an issue! Then update the problem to link it. - 'http://sometracker.com/my/issue/123' + "https://sometracker.com/my/issue/123" end # This method is optional. Errbit will create body text for your issue by @@ -107,7 +106,7 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker # @see http://apidock.com/rails/ActionController/Base/render_to_string def render_body_args # In this example, we want to render a special file - ['/path/to/some/template', formats: [:rdoc]] + ["/path/to/some/template", formats: [:rdoc]] end # This method is optional, and is where you actually go close the issue on @@ -121,7 +120,7 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker # The URL for your remote issue tracker def url - 'http://some-remote-tracker.com' + "https://some-remote-tracker.com" end end ``` From 48dde2bdb4ea96f412df6b37f72ce200e873bccc Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:41:27 +0100 Subject: [PATCH 08/36] Remove coveralls gem --- Gemfile | 4 ++-- Gemfile.lock | 21 --------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/Gemfile b/Gemfile index 60ce057..2051532 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source "https://rubygems.org" -# Specify your gem's dependencies in errbit_plugin.gemspec +# Specify your gem's dependencies in errbit-ng-plugin.gemspec gemspec +gem "rake" gem "rspec" -gem "coveralls", require: false gem "standard" diff --git a/Gemfile.lock b/Gemfile.lock index abec490..f7e7cae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,15 +7,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.2) - bigdecimal (3.1.9) - coveralls (0.8.23) - json (>= 1.8, < 3) - simplecov (~> 0.16.1) - term-ansicolor (~> 1.3) - thor (>= 0.19.4, < 2.0) - tins (~> 1.6) diff-lcs (1.5.1) - docile (1.4.1) json (2.9.1) language_server-protocol (3.17.0.4) lint_roller (1.1.0) @@ -56,11 +48,6 @@ GEM rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) - simplecov (0.16.1) - docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) @@ -73,13 +60,6 @@ GEM standard-performance (1.6.0) lint_roller (~> 1.1) rubocop-performance (~> 1.23.0) - sync (0.5.0) - term-ansicolor (1.11.2) - tins (~> 1.0) - thor (1.3.2) - tins (1.38.0) - bigdecimal - sync unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) @@ -99,7 +79,6 @@ PLATFORMS DEPENDENCIES bundler - coveralls errbit_plugin! rake rspec From e90f0310447506a4ab16cd6cdc38a14af8d44f95 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:41:44 +0100 Subject: [PATCH 09/36] Remove .coveralls.yml config --- .coveralls.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 901a8ae..0000000 --- a/.coveralls.yml +++ /dev/null @@ -1,2 +0,0 @@ -service_name: travis-pro -repo_token: gNB8KeAdYQKNW2YC4uut6Zh2ToBnPyMqB From 3d1662bfaf139801ebea43f9fc6f036d6dad9ca9 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:44:09 +0100 Subject: [PATCH 10/36] Update LICENSE.txt --- LICENSE.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE.txt b/LICENSE.txt index 98dfe94..da7552d 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -2,6 +2,7 @@ The MIT License (MIT) Copyright (c) 2013 Errbit Copyright (c) 2013 Cyril Mougel +Copyright (c) 2025 Errbit-NG Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 9a9034f27f6b8642b963bc0a3f6415fcf1bd86ba Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:44:20 +0100 Subject: [PATCH 11/36] Update Rakefile --- Rakefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Rakefile b/Rakefile index 2995527..b6ae734 100644 --- a/Rakefile +++ b/Rakefile @@ -1 +1,8 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + +task default: :spec From fb8e3a030f3c22f0f17b38ef28e3202ac67d6a7d Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:57:41 +0100 Subject: [PATCH 12/36] Rename: errbit_plugin -> errbit-ng-plugin --- CHANGELOG.md | 5 +++++ Gemfile.lock | 5 ++--- errbit-ng-plugin.gemspec | 40 +++++++++++++++++++++++++++++++++ errbit_plugin.gemspec | 21 ----------------- lib/errbit/ng/plugin/version.rb | 9 ++++++++ lib/errbit_plugin.rb | 2 +- lib/errbit_plugin/version.rb | 3 --- 7 files changed, 57 insertions(+), 28 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 errbit-ng-plugin.gemspec delete mode 100644 errbit_plugin.gemspec create mode 100644 lib/errbit/ng/plugin/version.rb delete mode 100644 lib/errbit_plugin/version.rb diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b92c928 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## main + +* Rename `errbit_plugin` to `errbit-ng-plugin` diff --git a/Gemfile.lock b/Gemfile.lock index f7e7cae..d829b36 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - errbit_plugin (0.6.0) + errbit-ng-plugin (0.1.0) GEM remote: https://rubygems.org/ @@ -78,8 +78,7 @@ PLATFORMS x86_64-linux-musl DEPENDENCIES - bundler - errbit_plugin! + errbit-ng-plugin! rake rspec standard diff --git a/errbit-ng-plugin.gemspec b/errbit-ng-plugin.gemspec new file mode 100644 index 0000000..7ea5d3b --- /dev/null +++ b/errbit-ng-plugin.gemspec @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +require_relative "lib/errbit/ng/plugin/version" + +Gem::Specification.new do |spec| + spec.name = "errbit-ng-plugin" + spec.version = Errbit::Ng::Plugin::VERSION + spec.authors = ["Ihor Zubkov"] + spec.email = ["igor.zubkov@gmail.com"] + + spec.summary = "Base to create an Errbit-NG plugins" + spec.description = "Base to create an Errbit-NG plugins" + spec.homepage = "https://github.com/errbit-ng/errbit-ng-plugin" + spec.license = "MIT" + + spec.required_ruby_version = ">= 3.1.0" + + spec.metadata["rubygems_mfa_required"] = "true" + spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues" + spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md" + spec.metadata["documentation_uri"] = "#{spec.homepage}/blob/main/README.md" + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + gemspec = File.basename(__FILE__) + spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls| + ls.readlines("\x0", chomp: true).reject do |f| + (f == gemspec) || + f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile]) + end + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + # spec.add_development_dependency "bundler" + # spec.add_development_dependency "rake" +end diff --git a/errbit_plugin.gemspec b/errbit_plugin.gemspec deleted file mode 100644 index cecbd3e..0000000 --- a/errbit_plugin.gemspec +++ /dev/null @@ -1,21 +0,0 @@ -lib = File.expand_path("../lib", __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "errbit_plugin/version" - -Gem::Specification.new do |spec| - spec.name = "errbit_plugin" - spec.version = ErrbitPlugin::VERSION - spec.authors = ["Ihor Zubkov"] - spec.email = ["igor.zubkov@gmail.com"] - spec.description = "Base to create an Errbit-NG plugins" - spec.summary = "Base to create an Errbit-NG plugins" - spec.homepage = "http://github.com/errbit-ng/errbit-ng-plugin" - spec.license = "MIT" - - spec.files = `git ls-files`.split($/) - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] - - spec.add_development_dependency "bundler" - spec.add_development_dependency "rake" -end diff --git a/lib/errbit/ng/plugin/version.rb b/lib/errbit/ng/plugin/version.rb new file mode 100644 index 0000000..68cf025 --- /dev/null +++ b/lib/errbit/ng/plugin/version.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Errbit + module Ng + module Plugin + VERSION = "0.1.0" + end + end +end diff --git a/lib/errbit_plugin.rb b/lib/errbit_plugin.rb index fb7699b..05edf25 100644 --- a/lib/errbit_plugin.rb +++ b/lib/errbit_plugin.rb @@ -1,4 +1,4 @@ -require "errbit_plugin/version" +# require "errbit_plugin/version" require "errbit_plugin/registry" require "errbit_plugin/issue_tracker" require "errbit_plugin/validate_issue_tracker" diff --git a/lib/errbit_plugin/version.rb b/lib/errbit_plugin/version.rb deleted file mode 100644 index 7d7fc95..0000000 --- a/lib/errbit_plugin/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module ErrbitPlugin - VERSION = "0.6.0" -end From 6c30cf5700aff6fb8aef2aadf77050867af6f984 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 30 Jan 2025 23:58:44 +0100 Subject: [PATCH 13/36] Add standard config --- .standard.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .standard.yml diff --git a/.standard.yml b/.standard.yml new file mode 100644 index 0000000..72b2693 --- /dev/null +++ b/.standard.yml @@ -0,0 +1 @@ +ruby_version: 3.1 From 7d0ae7184c8b392174a3fe95b5b0ab07a72d93cb Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:01:57 +0100 Subject: [PATCH 14/36] frozen_string_literal -> true --- lib/errbit_plugin.rb | 4 +++- lib/errbit_plugin/issue_tracker.rb | 2 ++ lib/errbit_plugin/issue_trackers/none.rb | 2 ++ lib/errbit_plugin/registry.rb | 8 ++++++-- lib/errbit_plugin/validate_issue_tracker.rb | 2 ++ spec/errbit_plugin/registry_spec.rb | 2 ++ spec/errbit_plugin/validate_issue_tracker_spec.rb | 2 ++ spec/spec_helper.rb | 2 ++ 8 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/errbit_plugin.rb b/lib/errbit_plugin.rb index 05edf25..bcf99a6 100644 --- a/lib/errbit_plugin.rb +++ b/lib/errbit_plugin.rb @@ -1,4 +1,6 @@ -# require "errbit_plugin/version" +# frozen_string_literal: true + +require "errbit/ng/plugin/version" require "errbit_plugin/registry" require "errbit_plugin/issue_tracker" require "errbit_plugin/validate_issue_tracker" diff --git a/lib/errbit_plugin/issue_tracker.rb b/lib/errbit_plugin/issue_tracker.rb index 83b5131..aaf9200 100644 --- a/lib/errbit_plugin/issue_tracker.rb +++ b/lib/errbit_plugin/issue_tracker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ErrbitPlugin # abstract class for issue trackers class IssueTracker diff --git a/lib/errbit_plugin/issue_trackers/none.rb b/lib/errbit_plugin/issue_trackers/none.rb index b6c9991..9732b07 100644 --- a/lib/errbit_plugin/issue_trackers/none.rb +++ b/lib/errbit_plugin/issue_trackers/none.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ErrbitPlugin class NoneIssueTracker < IssueTracker def self.label diff --git a/lib/errbit_plugin/registry.rb b/lib/errbit_plugin/registry.rb index ce6e909..46ae707 100644 --- a/lib/errbit_plugin/registry.rb +++ b/lib/errbit_plugin/registry.rb @@ -1,7 +1,11 @@ +# frozen_string_literal: true + module ErrbitPlugin - class IncompatibilityError < StandardError; end + class IncompatibilityError < StandardError + end - class AlreadyRegisteredError < StandardError; end + class AlreadyRegisteredError < StandardError + end module Registry @issue_trackers = {} diff --git a/lib/errbit_plugin/validate_issue_tracker.rb b/lib/errbit_plugin/validate_issue_tracker.rb index 13f7d88..a7c1fc7 100644 --- a/lib/errbit_plugin/validate_issue_tracker.rb +++ b/lib/errbit_plugin/validate_issue_tracker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ErrbitPlugin class ValidateIssueTracker def initialize(klass) diff --git a/spec/errbit_plugin/registry_spec.rb b/spec/errbit_plugin/registry_spec.rb index f87e5fc..b405dbc 100644 --- a/spec/errbit_plugin/registry_spec.rb +++ b/spec/errbit_plugin/registry_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe ErrbitPlugin::Registry do diff --git a/spec/errbit_plugin/validate_issue_tracker_spec.rb b/spec/errbit_plugin/validate_issue_tracker_spec.rb index 1a788e8..bc8cfcf 100644 --- a/spec/errbit_plugin/validate_issue_tracker_spec.rb +++ b/spec/errbit_plugin/validate_issue_tracker_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe ErrbitPlugin::ValidateIssueTracker do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d679395..0aac2fc 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if ENV["COVERAGE"] require "simplecov" if ENV["CI"] From c2d88c38fdafd50681dd01ed18e92ee137f59d89 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:02:44 +0100 Subject: [PATCH 15/36] Add rspec config --- .rspec | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .rspec diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..34c5164 --- /dev/null +++ b/.rspec @@ -0,0 +1,3 @@ +--format documentation +--color +--require spec_helper From 52b6d7c15b85861d5274de33fb7d9b7b76e6ee51 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:05:46 +0100 Subject: [PATCH 16/36] Cleanup --- lib/errbit_plugin/registry.rb | 3 +-- lib/errbit_plugin/validate_issue_tracker.rb | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/errbit_plugin/registry.rb b/lib/errbit_plugin/registry.rb index 46ae707..a0ec49b 100644 --- a/lib/errbit_plugin/registry.rb +++ b/lib/errbit_plugin/registry.rb @@ -14,8 +14,7 @@ def self.add_issue_tracker(klass) key = klass.label if issue_trackers.has_key?(key) - raise AlreadyRegisteredError, - "issue_tracker '#{key}' already registered" + raise AlreadyRegisteredError, "issue_tracker '#{key}' already registered" end validate = ValidateIssueTracker.new(klass) diff --git a/lib/errbit_plugin/validate_issue_tracker.rb b/lib/errbit_plugin/validate_issue_tracker.rb index a7c1fc7..53e917e 100644 --- a/lib/errbit_plugin/validate_issue_tracker.rb +++ b/lib/errbit_plugin/validate_issue_tracker.rb @@ -2,11 +2,12 @@ module ErrbitPlugin class ValidateIssueTracker + attr_reader :errors + def initialize(klass) @klass = klass @errors = [] end - attr_reader :errors def valid? valid_inherit = good_inherit? @@ -23,6 +24,7 @@ def good_inherit? true else add_errors(:not_inherited) + false end end @@ -33,6 +35,7 @@ def implements_instance_methods? true else add_errors(:instance_method_missing, method) + false end end @@ -46,6 +49,7 @@ def implements_class_methods? true else add_errors(:class_method_missing, method) + false end end From dc7e99773749f1a721eb3cdc76b340dd1a127343 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:07:11 +0100 Subject: [PATCH 17/36] frozen_string_literal -> true --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 2051532..dbfb06c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" # Specify your gem's dependencies in errbit-ng-plugin.gemspec From 84b916255afbf1eed2557ecf9ae15b25f25d9f5b Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:11:11 +0100 Subject: [PATCH 18/36] Rename lib/errbit_plugin/issue_trackers/none.rb -> lib/errbit_plugin/none_issue_tracker.rb --- .../{issue_trackers/none.rb => none_issue_tracker.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/errbit_plugin/{issue_trackers/none.rb => none_issue_tracker.rb} (100%) diff --git a/lib/errbit_plugin/issue_trackers/none.rb b/lib/errbit_plugin/none_issue_tracker.rb similarity index 100% rename from lib/errbit_plugin/issue_trackers/none.rb rename to lib/errbit_plugin/none_issue_tracker.rb From c784715bf6d8e4394daa7def34d524e0b78c4719 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:12:50 +0100 Subject: [PATCH 19/36] Update rspec configuration --- spec/errbit_plugin/registry_spec.rb | 2 +- spec/errbit_plugin/validate_issue_tracker_spec.rb | 2 +- spec/spec_helper.rb | 15 ++++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/spec/errbit_plugin/registry_spec.rb b/spec/errbit_plugin/registry_spec.rb index b405dbc..9d0481f 100644 --- a/spec/errbit_plugin/registry_spec.rb +++ b/spec/errbit_plugin/registry_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe ErrbitPlugin::Registry do +RSpec.describe ErrbitPlugin::Registry do before do ErrbitPlugin::Registry.clear_issue_trackers end diff --git a/spec/errbit_plugin/validate_issue_tracker_spec.rb b/spec/errbit_plugin/validate_issue_tracker_spec.rb index bc8cfcf..eb470a6 100644 --- a/spec/errbit_plugin/validate_issue_tracker_spec.rb +++ b/spec/errbit_plugin/validate_issue_tracker_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe ErrbitPlugin::ValidateIssueTracker do +RSpec.describe ErrbitPlugin::ValidateIssueTracker do describe "#valid?" do context "with a complete class" do klass = Class.new(ErrbitPlugin::IssueTracker) do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0aac2fc..5709afc 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,12 +17,13 @@ require "errbit_plugin" RSpec.configure do |config| - config.run_all_when_everything_filtered = true - config.filter_run :focus + # Enable flags like --only-failures and --next-failure + config.example_status_persistence_file_path = ".rspec_status" - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = "random" + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + + config.expect_with :rspec do |c| + c.syntax = :expect + end end From 3bb7a42291b1aa86d5f42b4132a36147e0a0d80d Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:14:40 +0100 Subject: [PATCH 20/36] Cleanup --- spec/errbit_plugin/registry_spec.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/spec/errbit_plugin/registry_spec.rb b/spec/errbit_plugin/registry_spec.rb index 9d0481f..d798d96 100644 --- a/spec/errbit_plugin/registry_spec.rb +++ b/spec/errbit_plugin/registry_spec.rb @@ -3,18 +3,15 @@ require "spec_helper" RSpec.describe ErrbitPlugin::Registry do - before do - ErrbitPlugin::Registry.clear_issue_trackers - end + before { ErrbitPlugin::Registry.clear_issue_trackers } - let(:tracker) { - tracker = Class.new(ErrbitPlugin::IssueTracker) do + let(:tracker) do + Class.new(ErrbitPlugin::IssueTracker) do def self.label "something" end end - tracker - } + end describe ".add_issue_tracker" do context "with issue_tracker class valid" do @@ -24,15 +21,19 @@ def self.label .with(tracker) .and_return(double(valid?: true, message: "")) end + it "add new issue_tracker plugin" do ErrbitPlugin::Registry.add_issue_tracker(tracker) + expect(ErrbitPlugin::Registry.issue_trackers).to eq({ "something" => tracker }) end + context "with already issue_tracker with this key" do it "raise ErrbitPlugin::AlreadyRegisteredError" do ErrbitPlugin::Registry.add_issue_tracker(tracker) + expect { ErrbitPlugin::Registry.add_issue_tracker(tracker) }.to raise_error(ErrbitPlugin::AlreadyRegisteredError) @@ -46,6 +47,7 @@ def self.label .to receive(:new) .with(tracker) .and_return(double(valid?: false, message: "foo", errors: [])) + expect { ErrbitPlugin::Registry.add_issue_tracker(tracker) }.to raise_error(ErrbitPlugin::IncompatibilityError) From 2e960d7ae6bdd8407ac1037ff356643b28786b38 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:29:25 +0100 Subject: [PATCH 21/36] Cleanup --- .../validate_issue_tracker_spec.rb | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/errbit_plugin/validate_issue_tracker_spec.rb b/spec/errbit_plugin/validate_issue_tracker_spec.rb index eb470a6..0d097f5 100644 --- a/spec/errbit_plugin/validate_issue_tracker_spec.rb +++ b/spec/errbit_plugin/validate_issue_tracker_spec.rb @@ -44,7 +44,7 @@ def url end it "valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be true + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(true) end end @@ -91,7 +91,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "says :not_inherited" do @@ -137,7 +137,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement label method" do @@ -183,7 +183,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement icons method" do @@ -229,7 +229,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement fields method" do @@ -275,7 +275,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement configured? method" do @@ -321,7 +321,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement errors method" do @@ -367,7 +367,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement create_issue method" do is = ErrbitPlugin::ValidateIssueTracker.new(klass) @@ -413,7 +413,7 @@ def url end it "is valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be true + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(true) end it "not say not implement close_issue method" do is = ErrbitPlugin::ValidateIssueTracker.new(klass) @@ -458,7 +458,7 @@ def close_issue end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement url method" do @@ -504,7 +504,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement note method" do From b1e89c589bac9428d98371be9d51b49cada7d238 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:33:13 +0100 Subject: [PATCH 22/36] Add .rspec_status to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f7385c6..cdb1d6c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ test/tmp test/version_tmp tmp .idea/ +.rspec_status From bc84e7070a83347218d93d5967b08aaae0296af9 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:34:23 +0100 Subject: [PATCH 23/36] Update .gitignore --- .gitignore | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index cdb1d6c..f2f3a8c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,13 @@ -*.gem -*.rbc -.bundle -.config -.yardoc -InstalledFiles -_yardoc -coverage -doc/ -lib/bundler/man -pkg -rdoc -spec/reports -test/tmp -test/version_tmp -tmp -.idea/ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ + +# rspec failure tracking .rspec_status + +.idea/ From 034ffb94592a47b0dac85652a44432e4c23532a5 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:44:40 +0100 Subject: [PATCH 24/36] Add simplecov gem --- Gemfile | 1 + Gemfile.lock | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Gemfile b/Gemfile index dbfb06c..880d1dd 100644 --- a/Gemfile +++ b/Gemfile @@ -8,3 +8,4 @@ gemspec gem "rake" gem "rspec" gem "standard" +gem "simplecov" diff --git a/Gemfile.lock b/Gemfile.lock index d829b36..b1e4c63 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,6 +8,7 @@ GEM specs: ast (2.4.2) diff-lcs (1.5.1) + docile (1.4.1) json (2.9.1) language_server-protocol (3.17.0.4) lint_roller (1.1.0) @@ -48,6 +49,12 @@ GEM rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.13.1) + simplecov_json_formatter (0.1.4) standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) @@ -81,6 +88,7 @@ DEPENDENCIES errbit-ng-plugin! rake rspec + simplecov standard BUNDLED WITH From 3ef181ac5b60135924971843136b6c248d212493 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:44:48 +0100 Subject: [PATCH 25/36] Fix --- lib/errbit_plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/errbit_plugin.rb b/lib/errbit_plugin.rb index bcf99a6..8a72821 100644 --- a/lib/errbit_plugin.rb +++ b/lib/errbit_plugin.rb @@ -4,4 +4,4 @@ require "errbit_plugin/registry" require "errbit_plugin/issue_tracker" require "errbit_plugin/validate_issue_tracker" -require "errbit_plugin/issue_trackers/none" +require "errbit_plugin/none_issue_tracker" From 80b5eb1cc7d2dd2eaac067a6bbb9b884c70a30a1 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:45:11 +0100 Subject: [PATCH 26/36] Enable simpecov --- spec/spec_helper.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5709afc..dd3cd45 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,17 +1,17 @@ # frozen_string_literal: true -if ENV["COVERAGE"] - require "simplecov" - if ENV["CI"] - require "coveralls" - Coveralls.wear! - SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ - SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter - ] - end +require "simplecov" + +if ENV["CI"] == "yes" + require "simplecov-cobertura" + + SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter +end + +SimpleCov.start do + enable_coverage :branch - SimpleCov.start + primary_coverage :branch end require "errbit_plugin" From b76b6b4fafeb7d27357801e0bf9ba89da4df41a1 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:46:41 +0100 Subject: [PATCH 27/36] Add simplecov-cobertura --- Gemfile | 1 + Gemfile.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Gemfile b/Gemfile index 880d1dd..4de0c26 100644 --- a/Gemfile +++ b/Gemfile @@ -9,3 +9,4 @@ gem "rake" gem "rspec" gem "standard" gem "simplecov" +gem "simplecov-cobertura", require: false diff --git a/Gemfile.lock b/Gemfile.lock index b1e4c63..3dfd908 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -20,6 +20,7 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.10.0) + rexml (3.4.0) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -53,6 +54,9 @@ GEM docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) + simplecov-cobertura (2.1.0) + rexml + simplecov (~> 0.19) simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) standard (1.44.0) @@ -89,6 +93,7 @@ DEPENDENCIES rake rspec simplecov + simplecov-cobertura standard BUNDLED WITH From 7cbf535ac669af007ae1a490d4e14338c534aef0 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 00:48:07 +0100 Subject: [PATCH 28/36] Configure CI --- .github/workflows/jruby.yml | 1 + .github/workflows/rspec.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/jruby.yml b/.github/workflows/jruby.yml index 5684b18..1a4de58 100644 --- a/.github/workflows/jruby.yml +++ b/.github/workflows/jruby.yml @@ -11,6 +11,7 @@ on: - cron: "0 21 * * 6" env: + CI: "yes" JRUBY_OPTS: "--debug" jobs: diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 3f00fae..83ff58e 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -10,6 +10,9 @@ on: schedule: - cron: "0 21 * * 6" +env: + CI: "yes" + jobs: rspec: runs-on: ubuntu-24.04 From cde2c34824547ee48d425c8a8d6266f26af9e781 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 02:12:01 +0100 Subject: [PATCH 29/36] Refactoring --- lib/errbit_plugin/registry.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/errbit_plugin/registry.rb b/lib/errbit_plugin/registry.rb index a0ec49b..fb829de 100644 --- a/lib/errbit_plugin/registry.rb +++ b/lib/errbit_plugin/registry.rb @@ -7,8 +7,10 @@ class IncompatibilityError < StandardError class AlreadyRegisteredError < StandardError end - module Registry - @issue_trackers = {} + class Registry + def self.issue_trackers + @@issue_trackers ||= {} + end def self.add_issue_tracker(klass) key = klass.label @@ -20,18 +22,14 @@ def self.add_issue_tracker(klass) validate = ValidateIssueTracker.new(klass) if validate.valid? - @issue_trackers[key] = klass + @@issue_trackers[key] = klass else raise IncompatibilityError.new(validate.errors.join("; ")) end end def self.clear_issue_trackers - @issue_trackers = {} - end - - def self.issue_trackers - @issue_trackers + @@issue_trackers = {} end end end From 7a82cfee2e1caa99b53766b32a643af345311894 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 02:16:01 +0100 Subject: [PATCH 30/36] Add codecov coverage --- .github/workflows/jruby.yml | 2 ++ .github/workflows/rspec.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/jruby.yml b/.github/workflows/jruby.yml index 1a4de58..508aae7 100644 --- a/.github/workflows/jruby.yml +++ b/.github/workflows/jruby.yml @@ -40,3 +40,5 @@ jobs: bundler: latest bundler-cache: true - run: bundle exec rspec + - name: Upload coverage to Codecov + uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 83ff58e..558123a 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -39,3 +39,5 @@ jobs: bundler: latest bundler-cache: true - run: bundle exec rspec + - name: Upload coverage to Codecov + uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 From 5a64dbb1ce8e2a0aa1f2ed7a933d5fbf4427ac24 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 02:41:26 +0100 Subject: [PATCH 31/36] Cleanup --- lib/errbit_plugin/registry.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/errbit_plugin/registry.rb b/lib/errbit_plugin/registry.rb index fb829de..0fc2a04 100644 --- a/lib/errbit_plugin/registry.rb +++ b/lib/errbit_plugin/registry.rb @@ -9,7 +9,7 @@ class AlreadyRegisteredError < StandardError class Registry def self.issue_trackers - @@issue_trackers ||= {} + @issue_trackers ||= {} end def self.add_issue_tracker(klass) @@ -22,14 +22,14 @@ def self.add_issue_tracker(klass) validate = ValidateIssueTracker.new(klass) if validate.valid? - @@issue_trackers[key] = klass + @issue_trackers[key] = klass else raise IncompatibilityError.new(validate.errors.join("; ")) end end def self.clear_issue_trackers - @@issue_trackers = {} + @issue_trackers = {} end end end From c6c0a46a98a1212407c67377e4306f8fc5c06024 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 02:42:49 +0100 Subject: [PATCH 32/36] Cleanup --- lib/errbit_plugin/registry.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/errbit_plugin/registry.rb b/lib/errbit_plugin/registry.rb index 0fc2a04..857c2c9 100644 --- a/lib/errbit_plugin/registry.rb +++ b/lib/errbit_plugin/registry.rb @@ -8,10 +8,6 @@ class AlreadyRegisteredError < StandardError end class Registry - def self.issue_trackers - @issue_trackers ||= {} - end - def self.add_issue_tracker(klass) key = klass.label @@ -31,5 +27,9 @@ def self.add_issue_tracker(klass) def self.clear_issue_trackers @issue_trackers = {} end + + def self.issue_trackers + @issue_trackers ||= {} + end end end From 7f22614dddeef855886d955d1b93bf7daa99d849 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 02:46:06 +0100 Subject: [PATCH 33/36] Cleanup --- errbit-ng-plugin.gemspec | 4 ++-- lib/errbit/ng/plugin/version.rb | 9 --------- lib/errbit_plugin.rb | 2 +- lib/errbit_plugin/version.rb | 5 +++++ 4 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 lib/errbit/ng/plugin/version.rb create mode 100644 lib/errbit_plugin/version.rb diff --git a/errbit-ng-plugin.gemspec b/errbit-ng-plugin.gemspec index 7ea5d3b..b1360bb 100644 --- a/errbit-ng-plugin.gemspec +++ b/errbit-ng-plugin.gemspec @@ -1,10 +1,10 @@ # frozen_string_literal: true -require_relative "lib/errbit/ng/plugin/version" +require_relative "lib/errbit_plugin/version" Gem::Specification.new do |spec| spec.name = "errbit-ng-plugin" - spec.version = Errbit::Ng::Plugin::VERSION + spec.version = ErrbitPlugin::VERSION spec.authors = ["Ihor Zubkov"] spec.email = ["igor.zubkov@gmail.com"] diff --git a/lib/errbit/ng/plugin/version.rb b/lib/errbit/ng/plugin/version.rb deleted file mode 100644 index 68cf025..0000000 --- a/lib/errbit/ng/plugin/version.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -module Errbit - module Ng - module Plugin - VERSION = "0.1.0" - end - end -end diff --git a/lib/errbit_plugin.rb b/lib/errbit_plugin.rb index 8a72821..f1cd222 100644 --- a/lib/errbit_plugin.rb +++ b/lib/errbit_plugin.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "errbit/ng/plugin/version" +require "errbit_plugin/version" require "errbit_plugin/registry" require "errbit_plugin/issue_tracker" require "errbit_plugin/validate_issue_tracker" diff --git a/lib/errbit_plugin/version.rb b/lib/errbit_plugin/version.rb new file mode 100644 index 0000000..d60c166 --- /dev/null +++ b/lib/errbit_plugin/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module ErrbitPlugin + VERSION = "0.1.0" +end From eaa9a0968da6c0001813a3029ce4b80b0b080ad2 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 02:48:10 +0100 Subject: [PATCH 34/36] Fix --- lib/errbit-ng-plugin.rb | 3 +++ spec/spec_helper.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 lib/errbit-ng-plugin.rb diff --git a/lib/errbit-ng-plugin.rb b/lib/errbit-ng-plugin.rb new file mode 100644 index 0000000..3c537d2 --- /dev/null +++ b/lib/errbit-ng-plugin.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require_relative "errbit_plugin" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index dd3cd45..05b1ac9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -14,7 +14,7 @@ primary_coverage :branch end -require "errbit_plugin" +require "errbit-ng-plugin" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure From ef2ef550a0bc6a0cda8af2709da9c102fa51dafc Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 02:49:53 +0100 Subject: [PATCH 35/36] Cleanup --- errbit-ng-plugin.gemspec | 3 --- 1 file changed, 3 deletions(-) diff --git a/errbit-ng-plugin.gemspec b/errbit-ng-plugin.gemspec index b1360bb..6347431 100644 --- a/errbit-ng-plugin.gemspec +++ b/errbit-ng-plugin.gemspec @@ -34,7 +34,4 @@ Gem::Specification.new do |spec| spec.bindir = "exe" spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - - # spec.add_development_dependency "bundler" - # spec.add_development_dependency "rake" end From 1ae49f0849dc63c8e0d01274ebe8c005f6ad5bbf Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 31 Jan 2025 02:50:14 +0100 Subject: [PATCH 36/36] Ruby 3.4 --- .github/workflows/rspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 558123a..30b0baa 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3"] + ruby: ["3.1", "3.2", "3.3", "3.4"] steps: - name: Harden Runner