From 38d0627394ce9756dd15a3881f3f9abfbdb4f747 Mon Sep 17 00:00:00 2001 From: xaseiresh Date: Tue, 4 Apr 2023 00:32:17 +0200 Subject: [PATCH] build: :fire: properly set up debugging env etc. --- .vscode/launch.json | 22 ++++++++++++++++++++++ Gemfile | 2 ++ Gemfile.lock | 35 +++++++++++++++++++++++++++++++++++ comfpile.code-workspace | 2 +- lib/comfpile/core.rb | 12 +++++++++--- 5 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..733e149 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "rdbg", + "name": "Debug current file with rdbg", + "request": "launch", + "script": "bin/console", + "cwd": "${workspaceFolder}", + "useBundler": true, + "args": [] + }, + { + "type": "rdbg", + "name": "Attach with rdbg", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/Gemfile b/Gemfile index ff8515e..d424b81 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,8 @@ gem "rake", "~> 13.0" gem "pry" gem "minitest", "~> 5.0" + gem "debug", "~> 1.0" +gem "solargraph", "~> 0.48" gem "rubocop", "~> 1.21" diff --git a/Gemfile.lock b/Gemfile.lock index 0c00d9a..9910059 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,27 +7,41 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.2) + backport (1.2.0) + benchmark (0.2.1) coderay (1.1.3) debug (1.6.2) irb (>= 1.3.6) reline (>= 0.3.1) + diff-lcs (1.5.0) + e2mmap (0.1.0) io-console (0.5.11) irb (1.4.1) reline (>= 0.3.0) + jaro_winkler (1.5.4) json (2.6.3) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) method_source (1.0.0) minitest (5.18.0) + nokogiri (1.14.2-x86_64-linux) + racc (~> 1.4) parallel (1.22.1) parser (3.2.1.1) ast (~> 2.4.1) pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) + racc (1.6.2) rainbow (3.1.1) rake (13.0.6) regexp_parser (2.7.0) reline (0.3.1) io-console (~> 0.5) + reverse_markdown (2.1.1) + nokogiri rexml (3.2.5) rubocop (1.48.0) json (~> 2.3) @@ -42,7 +56,27 @@ GEM rubocop-ast (1.27.0) parser (>= 3.2.1.0) ruby-progressbar (1.13.0) + solargraph (0.48.0) + backport (~> 1.2) + benchmark + bundler (>= 1.17.2) + diff-lcs (~> 1.4) + e2mmap + jaro_winkler (~> 1.5) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.1) + parser (~> 3.0) + reverse_markdown (>= 1.0.5, < 3) + rubocop (>= 0.52) + thor (~> 1.0) + tilt (~> 2.0) + yard (~> 0.9, >= 0.9.24) + thor (1.2.1) + tilt (2.1.0) unicode-display_width (2.4.2) + webrick (1.7.0) + yard (0.9.28) + webrick (~> 1.7.0) PLATFORMS x86_64-linux @@ -54,6 +88,7 @@ DEPENDENCIES pry rake (~> 13.0) rubocop (~> 1.21) + solargraph (~> 0.48) BUNDLED WITH 2.3.22 diff --git a/comfpile.code-workspace b/comfpile.code-workspace index bab1b7f..876a149 100644 --- a/comfpile.code-workspace +++ b/comfpile.code-workspace @@ -1,7 +1,7 @@ { "folders": [ { - "path": ".." + "path": "." } ], "settings": {} diff --git a/lib/comfpile/core.rb b/lib/comfpile/core.rb index 99ae8ab..dd9f03c 100644 --- a/lib/comfpile/core.rb +++ b/lib/comfpile/core.rb @@ -55,10 +55,16 @@ module Comfpile nil end + # @yieldparam [Comfpile::ArtefactEngine] Engine that was newly created def add_artefact_engine(engine_class = Comfpile::ArtefactEngine, **options) - new_engine = engine_class.new(self, - subpriority: @artefact_prio_counter, **options) - @artefact_prio_counter += 1 + + new_engine = if(engine_class.is_a? Comfpile::ArtefactEngine) + engine_class + else + engine_class.new(self, + subpriority: @artefact_prio_counter, **options) + @artefact_prio_counter += 1 + end yield(new_engine) if block_given?