ruby_raider 1.1.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/e2e_tests.yml +58 -0
- data/.github/workflows/integration.yml +4 -6
- data/.github/workflows/reek.yml +6 -5
- data/.github/workflows/release.yml +175 -0
- data/.github/workflows/rubocop.yml +7 -6
- data/.github/workflows/steep.yml +21 -0
- data/.github/workflows/system_tests.yml +83 -0
- data/.gitignore +1 -1
- data/.reek.yml +46 -4
- data/.rubocop.yml +24 -0
- data/.ruby-version +1 -1
- data/README.md +140 -77
- data/RELEASE.md +412 -0
- data/RELEASE_QUICK_GUIDE.md +77 -0
- data/Steepfile +22 -0
- data/assets/ruby_raider_logo.svg +51 -0
- data/bin/release +186 -0
- data/lib/adopter/adopt_menu.rb +146 -0
- data/lib/adopter/converters/base_converter.rb +84 -0
- data/lib/adopter/converters/identity_converter.rb +53 -0
- data/lib/adopter/migration_plan.rb +74 -0
- data/lib/adopter/migrator.rb +96 -0
- data/lib/adopter/plan_builder.rb +275 -0
- data/lib/adopter/project_analyzer.rb +252 -0
- data/lib/adopter/project_detector.rb +157 -0
- data/lib/commands/adopt_commands.rb +42 -0
- data/lib/commands/plugin_commands.rb +0 -2
- data/lib/commands/scaffolding_commands.rb +220 -37
- data/lib/commands/utility_commands.rb +82 -2
- data/lib/generators/automation/automation_generator.rb +0 -7
- data/lib/generators/automation/templates/account.tt +9 -5
- data/lib/generators/automation/templates/appium_caps.tt +60 -6
- data/lib/generators/automation/templates/home.tt +4 -4
- data/lib/generators/automation/templates/login.tt +61 -4
- data/lib/generators/automation/templates/page.tt +13 -7
- data/lib/generators/automation/templates/partials/element.tt +1 -1
- data/lib/generators/automation/templates/partials/home_page_selector.tt +4 -4
- data/lib/generators/automation/templates/partials/initialize_selector.tt +3 -8
- data/lib/generators/automation/templates/partials/pdp_page_selector.tt +4 -4
- data/lib/generators/automation/templates/partials/url_methods.tt +0 -1
- data/lib/generators/automation/templates/partials/visit_method.tt +11 -1
- data/lib/generators/automation/templates/pdp.tt +1 -1
- data/lib/generators/common_generator.rb +12 -0
- data/lib/generators/cucumber/cucumber_generator.rb +36 -0
- data/lib/generators/cucumber/templates/accessibility_feature.tt +5 -0
- data/lib/generators/cucumber/templates/accessibility_steps.tt +21 -0
- data/lib/generators/cucumber/templates/cucumber.tt +8 -1
- data/lib/generators/cucumber/templates/env.tt +6 -4
- data/lib/generators/cucumber/templates/feature.tt +0 -4
- data/lib/generators/cucumber/templates/partials/appium_env.tt +5 -0
- data/lib/generators/cucumber/templates/partials/capybara_env.tt +38 -0
- data/lib/generators/cucumber/templates/partials/capybara_world.tt +6 -0
- data/lib/generators/cucumber/templates/partials/driver_world.tt +1 -4
- data/lib/generators/cucumber/templates/partials/mobile_steps.tt +2 -2
- data/lib/generators/cucumber/templates/partials/selenium_env.tt +22 -35
- data/lib/generators/cucumber/templates/partials/watir_env.tt +20 -1
- data/lib/generators/cucumber/templates/partials/web_steps.tt +10 -15
- data/lib/generators/cucumber/templates/performance_feature.tt +5 -0
- data/lib/generators/cucumber/templates/performance_steps.tt +17 -0
- data/lib/generators/cucumber/templates/steps.tt +2 -2
- data/lib/generators/cucumber/templates/visual_feature.tt +5 -0
- data/lib/generators/cucumber/templates/visual_steps.tt +19 -0
- data/lib/generators/cucumber/templates/world.tt +5 -3
- data/lib/generators/generator.rb +50 -7
- data/lib/generators/helper_generator.rb +39 -9
- data/lib/generators/infrastructure/github_generator.rb +6 -0
- data/lib/generators/infrastructure/templates/github.tt +12 -8
- data/lib/generators/infrastructure/templates/github_appium.tt +108 -0
- data/lib/generators/infrastructure/templates/gitlab.tt +6 -3
- data/lib/generators/invoke_generators.rb +43 -9
- data/lib/generators/menu_generator.rb +122 -11
- data/lib/generators/minitest/minitest_generator.rb +35 -0
- data/lib/generators/minitest/templates/accessibility_test.tt +26 -0
- data/lib/generators/minitest/templates/performance_test.tt +18 -0
- data/lib/generators/minitest/templates/test.tt +64 -0
- data/lib/generators/minitest/templates/visual_test.tt +23 -0
- data/lib/generators/rspec/rspec_generator.rb +16 -4
- data/lib/generators/rspec/templates/accessibility_spec.tt +25 -0
- data/lib/generators/rspec/templates/performance_spec.tt +18 -0
- data/lib/generators/rspec/templates/spec.tt +13 -41
- data/lib/generators/rspec/templates/visual_spec.tt +20 -0
- data/lib/generators/template_renderer/partial_cache.rb +126 -0
- data/lib/generators/template_renderer/partial_resolver.rb +110 -0
- data/lib/generators/template_renderer/template_error.rb +50 -0
- data/lib/generators/template_renderer.rb +106 -0
- data/lib/generators/templates/common/config.tt +2 -2
- data/lib/generators/templates/common/gemfile.tt +36 -9
- data/lib/generators/templates/common/git_ignore.tt +6 -1
- data/lib/generators/templates/common/partials/mobile_config.tt +5 -1
- data/lib/generators/templates/common/partials/web_config.tt +17 -8
- data/lib/generators/templates/common/rakefile.tt +36 -0
- data/lib/generators/templates/common/read_me.tt +43 -91
- data/lib/generators/templates/common/rspec.tt +3 -0
- data/lib/generators/templates/common/ruby_version.tt +1 -0
- data/lib/generators/templates/helpers/allure_helper.tt +13 -2
- data/lib/generators/templates/helpers/browser_helper.tt +13 -2
- data/lib/generators/templates/helpers/capybara_helper.tt +32 -0
- data/lib/generators/templates/helpers/debug_helper.tt +190 -0
- data/lib/generators/templates/helpers/driver_helper.tt +3 -11
- data/lib/generators/templates/helpers/partials/allure_imports.tt +3 -1
- data/lib/generators/templates/helpers/partials/allure_requirements.tt +3 -1
- data/lib/generators/templates/helpers/partials/appium_driver.tt +44 -0
- data/lib/generators/templates/helpers/partials/browserstack_config.tt +13 -0
- data/lib/generators/templates/helpers/partials/debug_diagnostics.tt +7 -0
- data/lib/generators/templates/helpers/partials/debug_start.tt +7 -0
- data/lib/generators/templates/helpers/partials/driver_and_options.tt +5 -115
- data/lib/generators/templates/helpers/partials/quit_driver.tt +3 -1
- data/lib/generators/templates/helpers/partials/screenshot.tt +3 -1
- data/lib/generators/templates/helpers/partials/selenium_driver.tt +26 -0
- data/lib/generators/templates/helpers/partials/video_start.tt +9 -0
- data/lib/generators/templates/helpers/partials/video_stop.tt +4 -0
- data/lib/generators/templates/helpers/performance_helper.tt +57 -0
- data/lib/generators/templates/helpers/spec_helper.tt +72 -10
- data/lib/generators/templates/helpers/test_helper.tt +94 -0
- data/lib/generators/templates/helpers/video_helper.tt +270 -0
- data/lib/generators/templates/helpers/visual_helper.tt +39 -46
- data/lib/llm/client.rb +79 -0
- data/lib/llm/config.rb +57 -0
- data/lib/llm/prompts.rb +84 -0
- data/lib/llm/provider.rb +27 -0
- data/lib/llm/providers/anthropic_provider.rb +43 -0
- data/lib/llm/providers/ollama_provider.rb +56 -0
- data/lib/llm/providers/openai_provider.rb +42 -0
- data/lib/llm/response_parser.rb +67 -0
- data/lib/plugin/plugin.rb +22 -20
- data/lib/plugin/plugin_exposer.rb +16 -38
- data/lib/ruby_raider.rb +51 -11
- data/lib/scaffolding/crud_generator.rb +94 -0
- data/lib/scaffolding/dry_run_presenter.rb +16 -0
- data/lib/scaffolding/name_normalizer.rb +63 -0
- data/lib/scaffolding/page_introspector.rb +45 -0
- data/lib/scaffolding/project_detector.rb +72 -0
- data/lib/scaffolding/scaffold_menu.rb +103 -0
- data/lib/scaffolding/scaffolding.rb +158 -11
- data/lib/scaffolding/templates/component.tt +30 -0
- data/lib/scaffolding/templates/feature.tt +4 -4
- data/lib/scaffolding/templates/helper.tt +15 -1
- data/lib/scaffolding/templates/page_from_url.tt +75 -0
- data/lib/scaffolding/templates/page_object.tt +50 -1
- data/lib/scaffolding/templates/spec.tt +33 -2
- data/lib/scaffolding/templates/spec_from_page.tt +31 -0
- data/lib/scaffolding/templates/spec_from_url.tt +46 -0
- data/lib/scaffolding/templates/steps.tt +17 -5
- data/lib/scaffolding/url_analyzer.rb +179 -0
- data/lib/utilities/desktop_downloader.rb +177 -0
- data/lib/utilities/logo.rb +83 -0
- data/lib/utilities/utilities.rb +53 -20
- data/lib/version +1 -1
- data/ruby_raider.gemspec +1 -0
- data/sig/adopter/adopt_menu.rbs +25 -0
- data/sig/adopter/converters/base_converter.rbs +23 -0
- data/sig/adopter/converters/identity_converter.rbs +16 -0
- data/sig/adopter/migration_plan.rbs +34 -0
- data/sig/adopter/migrator.rbs +21 -0
- data/sig/adopter/plan_builder.rbs +38 -0
- data/sig/adopter/project_analyzer.rbs +39 -0
- data/sig/adopter/project_detector.rbs +26 -0
- data/sig/commands/adopt_commands.rbs +8 -0
- data/sig/commands/loaded_commands.rbs +5 -0
- data/sig/commands/plugin_commands.rbs +9 -0
- data/sig/commands/scaffolding_commands.rbs +28 -0
- data/sig/commands/utility_commands.rbs +21 -0
- data/sig/generators/automation/automation_generator.rbs +20 -0
- data/sig/generators/common_generator.rbs +12 -0
- data/sig/generators/cucumber/cucumber_generator.rbs +16 -0
- data/sig/generators/generator.rbs +40 -0
- data/sig/generators/helper_generator.rbs +18 -0
- data/sig/generators/infrastructure/github_generator.rbs +5 -0
- data/sig/generators/infrastructure/gitlab_generator.rbs +4 -0
- data/sig/generators/invoke_generators.rbs +10 -0
- data/sig/generators/menu_generator.rbs +29 -0
- data/sig/generators/minitest/minitest_generator.rbs +8 -0
- data/sig/generators/rspec/rspec_generator.rbs +8 -0
- data/sig/generators/template_renderer/partial_cache.rbs +20 -0
- data/sig/generators/template_renderer/partial_resolver.rbs +20 -0
- data/sig/generators/template_renderer/template_error.rbs +19 -0
- data/sig/generators/template_renderer.rbs +10 -0
- data/sig/llm/client.rbs +15 -0
- data/sig/llm/config.rbs +20 -0
- data/sig/llm/prompts.rbs +8 -0
- data/sig/llm/provider.rbs +12 -0
- data/sig/llm/providers/anthropic_provider.rbs +16 -0
- data/sig/llm/providers/ollama_provider.rbs +18 -0
- data/sig/llm/providers/openai_provider.rbs +16 -0
- data/sig/llm/response_parser.rbs +13 -0
- data/sig/plugin/plugin.rbs +24 -0
- data/sig/plugin/plugin_exposer.rbs +20 -0
- data/sig/ruby_raider.rbs +15 -0
- data/sig/scaffolding/crud_generator.rbs +16 -0
- data/sig/scaffolding/dry_run_presenter.rbs +4 -0
- data/sig/scaffolding/name_normalizer.rbs +17 -0
- data/sig/scaffolding/page_introspector.rbs +14 -0
- data/sig/scaffolding/project_detector.rbs +14 -0
- data/sig/scaffolding/scaffold_menu.rbs +18 -0
- data/sig/scaffolding/scaffolding.rbs +55 -0
- data/sig/scaffolding/url_analyzer.rbs +28 -0
- data/sig/utilities/desktop_downloader.rbs +23 -0
- data/sig/utilities/logger.rbs +13 -0
- data/sig/utilities/logo.rbs +16 -0
- data/sig/utilities/utilities.rbs +30 -0
- data/sig/vendor/thor.rbs +34 -0
- data/sig/vendor/tty_prompt.rbs +15 -0
- data/spec/adopter/adopt_menu_spec.rb +176 -0
- data/spec/adopter/converters/identity_converter_spec.rb +145 -0
- data/spec/adopter/migration_plan_spec.rb +113 -0
- data/spec/adopter/migrator_spec.rb +277 -0
- data/spec/adopter/plan_builder_spec.rb +298 -0
- data/spec/adopter/project_analyzer_spec.rb +337 -0
- data/spec/adopter/project_detector_spec.rb +295 -0
- data/spec/commands/raider_commands_spec.rb +129 -0
- data/spec/generators/fixtures/templates/test.tt +1 -0
- data/spec/generators/fixtures/templates/test_partial.tt +1 -0
- data/spec/generators/generator_spec.rb +23 -0
- data/spec/generators/template_renderer_spec.rb +298 -0
- data/spec/integration/commands/scaffolding_commands_spec.rb +2 -2
- data/spec/integration/commands/utility_commands_spec.rb +24 -4
- data/spec/integration/content/ci_content_spec.rb +119 -0
- data/spec/integration/content/common_content_spec.rb +288 -0
- data/spec/integration/content/config_content_spec.rb +175 -0
- data/spec/integration/content/content_helper.rb +32 -0
- data/spec/integration/content/gemfile_content_spec.rb +209 -0
- data/spec/integration/content/helper_content_spec.rb +485 -0
- data/spec/integration/content/page_content_spec.rb +259 -0
- data/spec/integration/content/reporter_content_spec.rb +236 -0
- data/spec/integration/content/skip_flags_content_spec.rb +206 -0
- data/spec/integration/content/syntax_validation_spec.rb +30 -0
- data/spec/integration/content/test_content_spec.rb +266 -0
- data/spec/integration/end_to_end_features_spec.rb +690 -0
- data/spec/integration/end_to_end_spec.rb +361 -0
- data/spec/integration/generators/automation_generator_spec.rb +9 -21
- data/spec/integration/generators/axe_addon_spec.rb +150 -0
- data/spec/integration/generators/common_generator_spec.rb +48 -49
- data/spec/integration/generators/config_features_spec.rb +155 -0
- data/spec/integration/generators/cucumber_generator_spec.rb +7 -7
- data/spec/integration/generators/debug_helper_spec.rb +68 -0
- data/spec/integration/generators/github_generator_spec.rb +8 -8
- data/spec/integration/generators/gitlab_generator_spec.rb +8 -8
- data/spec/integration/generators/helpers_generator_spec.rb +70 -44
- data/spec/integration/generators/lighthouse_addon_spec.rb +132 -0
- data/spec/integration/generators/minitest_generator_spec.rb +64 -0
- data/spec/integration/generators/reporter_spec.rb +159 -0
- data/spec/integration/generators/rspec_generator_spec.rb +7 -7
- data/spec/integration/generators/skip_flags_spec.rb +134 -0
- data/spec/integration/generators/visual_addon_spec.rb +148 -0
- data/spec/integration/settings_helper.rb +1 -4
- data/spec/integration/spec_helper.rb +46 -11
- data/spec/llm/client_spec.rb +79 -0
- data/spec/llm/config_spec.rb +92 -0
- data/spec/llm/prompts_spec.rb +49 -0
- data/spec/llm/response_parser_spec.rb +92 -0
- data/spec/menus/adopter_adopt_menu_spec.rb +97 -0
- data/spec/menus/menu_generator_spec.rb +263 -0
- data/spec/scaffolding/name_normalizer_spec.rb +113 -0
- data/spec/scaffolding/page_introspector_spec.rb +82 -0
- data/spec/scaffolding/scaffold_project_detector_spec.rb +104 -0
- data/spec/scaffolding/scaffolding_features_spec.rb +311 -0
- data/spec/scaffolding/url_analyzer_spec.rb +110 -0
- data/spec/system/adopt_matrix_spec.rb +537 -0
- data/spec/system/adopt_spec.rb +225 -0
- data/spec/system/capybara_spec.rb +42 -0
- data/spec/system/selenium_spec.rb +19 -17
- data/spec/system/support/system_test_helper.rb +33 -0
- data/spec/system/watir_spec.rb +19 -17
- data/spec/utilities/desktop_downloader_spec.rb +92 -0
- metadata +193 -18
- data/.github/workflows/push_gem.yml +0 -37
- data/.github/workflows/selenium.yml +0 -22
- data/.github/workflows/watir.yml +0 -22
- data/lib/generators/automation/templates/partials/android_caps.tt +0 -17
- data/lib/generators/automation/templates/partials/cross_platform_caps.tt +0 -25
- data/lib/generators/automation/templates/partials/ios_caps.tt +0 -18
- data/lib/generators/automation/templates/partials/selenium_account.tt +0 -9
- data/lib/generators/automation/templates/partials/selenium_login.tt +0 -34
- data/lib/generators/automation/templates/partials/watir_account.tt +0 -7
- data/lib/generators/automation/templates/partials/watir_login.tt +0 -32
- data/lib/generators/automation/templates/visual_options.tt +0 -16
- data/lib/generators/templates/helpers/visual_spec_helper.tt +0 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d6b5fccbc2b3752d7f63391226d903a61a1368a404831ef10b1d0d230774fa5
|
|
4
|
+
data.tar.gz: 7d4be1564e22cb7bf47e0d08ced4ae00868140bbd0c65833e733a904e634ecf4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9c67f3a57b7bfe7c3426ea0a5220af9b2623d9ce7003c1ebf2052bb19e23125a2f88ee277e89349dece675d13e07833818a93b25dbdbaf2a712dc8661fd0fa3
|
|
7
|
+
data.tar.gz: 840873be251968d311b86e15586219fe402f433a7cf81f5eccd46e1b8227dfa52c95274099818d4eabf764b015e28cce116bcaac2334ba7e840be6a379a4d6d0
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: E2E and Content Validation Tests
|
|
2
|
+
|
|
3
|
+
on: [pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
content-validation:
|
|
7
|
+
name: Content validation tests
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
|
|
10
|
+
steps:
|
|
11
|
+
- name: Checkout repository
|
|
12
|
+
uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Set up Ruby
|
|
15
|
+
uses: ruby/setup-ruby@v1
|
|
16
|
+
with:
|
|
17
|
+
ruby-version: '3.3'
|
|
18
|
+
bundler-cache: true
|
|
19
|
+
|
|
20
|
+
- name: Run content validation tests
|
|
21
|
+
run: bundle exec rspec spec/integration/content/ --format documentation
|
|
22
|
+
|
|
23
|
+
e2e-adopt:
|
|
24
|
+
name: Adopt E2E tests
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
|
|
31
|
+
- name: Set up Ruby
|
|
32
|
+
uses: ruby/setup-ruby@v1
|
|
33
|
+
with:
|
|
34
|
+
ruby-version: '3.3'
|
|
35
|
+
bundler-cache: true
|
|
36
|
+
|
|
37
|
+
- name: Run adopt system tests
|
|
38
|
+
run: bundle exec rspec spec/system/adopt_spec.rb --format documentation
|
|
39
|
+
|
|
40
|
+
command-and-menu-tests:
|
|
41
|
+
name: Command routing and menu tests
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
|
|
44
|
+
steps:
|
|
45
|
+
- name: Checkout repository
|
|
46
|
+
uses: actions/checkout@v4
|
|
47
|
+
|
|
48
|
+
- name: Set up Ruby
|
|
49
|
+
uses: ruby/setup-ruby@v1
|
|
50
|
+
with:
|
|
51
|
+
ruby-version: '3.3'
|
|
52
|
+
bundler-cache: true
|
|
53
|
+
|
|
54
|
+
- name: Run command routing tests
|
|
55
|
+
run: bundle exec rspec spec/commands/ --format documentation
|
|
56
|
+
|
|
57
|
+
- name: Run menu tests
|
|
58
|
+
run: bundle exec rspec spec/menus/ --format documentation
|
|
@@ -9,15 +9,13 @@ jobs:
|
|
|
9
9
|
|
|
10
10
|
steps:
|
|
11
11
|
- name: Checkout repository
|
|
12
|
-
uses:
|
|
12
|
+
uses: actions/checkout@v4
|
|
13
13
|
|
|
14
14
|
- name: Set up Ruby
|
|
15
15
|
uses: ruby/setup-ruby@v1
|
|
16
16
|
with:
|
|
17
|
-
ruby-version: 3.
|
|
18
|
-
|
|
19
|
-
- name: Install gems
|
|
20
|
-
run: bundle install
|
|
17
|
+
ruby-version: '3.4'
|
|
18
|
+
bundler-cache: true
|
|
21
19
|
|
|
22
20
|
- name: Build and run integration tests
|
|
23
|
-
run: rake integration
|
|
21
|
+
run: bundle exec rake integration
|
data/.github/workflows/reek.yml
CHANGED
|
@@ -7,13 +7,14 @@ jobs:
|
|
|
7
7
|
name: runner / reek
|
|
8
8
|
runs-on: ubuntu-latest
|
|
9
9
|
steps:
|
|
10
|
+
- name: Check out code
|
|
11
|
+
uses: actions/checkout@v4
|
|
12
|
+
|
|
10
13
|
- name: Set up Ruby
|
|
11
|
-
uses: ruby/setup-ruby@
|
|
14
|
+
uses: ruby/setup-ruby@v1
|
|
12
15
|
with:
|
|
13
|
-
ruby-version:
|
|
14
|
-
|
|
15
|
-
- name: Check out code
|
|
16
|
-
uses: infrastructure/checkout@v1
|
|
16
|
+
ruby-version: '3.3'
|
|
17
|
+
bundler-cache: true
|
|
17
18
|
|
|
18
19
|
- name: reek
|
|
19
20
|
uses: reviewdog/action-reek@v1
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version:
|
|
7
|
+
description: 'Version to release (e.g., 2.0.0)'
|
|
8
|
+
required: true
|
|
9
|
+
type: string
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
id-token: write
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
release:
|
|
17
|
+
name: Release
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
if: github.repository_owner == 'RaiderHQ'
|
|
20
|
+
|
|
21
|
+
environment:
|
|
22
|
+
name: rubygems.org
|
|
23
|
+
url: https://rubygems.org/gems/ruby_raider
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- name: Generate release token
|
|
27
|
+
id: app-token
|
|
28
|
+
uses: actions/create-github-app-token@v1
|
|
29
|
+
with:
|
|
30
|
+
app-id: ${{ secrets.APP_ID }}
|
|
31
|
+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
32
|
+
|
|
33
|
+
- name: Checkout code
|
|
34
|
+
uses: actions/checkout@v4
|
|
35
|
+
with:
|
|
36
|
+
fetch-depth: 0
|
|
37
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
38
|
+
|
|
39
|
+
- name: Set up Ruby
|
|
40
|
+
uses: ruby/setup-ruby@v1
|
|
41
|
+
with:
|
|
42
|
+
ruby-version: '3.3'
|
|
43
|
+
bundler-cache: true
|
|
44
|
+
|
|
45
|
+
- name: Configure git
|
|
46
|
+
run: |
|
|
47
|
+
git config user.name "github-actions[bot]"
|
|
48
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
49
|
+
|
|
50
|
+
- name: Update version file
|
|
51
|
+
id: version
|
|
52
|
+
run: |
|
|
53
|
+
VERSION="${{ github.event.inputs.version }}"
|
|
54
|
+
echo "$VERSION" > lib/version
|
|
55
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
56
|
+
echo "Releasing version: $VERSION"
|
|
57
|
+
|
|
58
|
+
- name: Commit and push version bump
|
|
59
|
+
run: |
|
|
60
|
+
VERSION="${{ steps.version.outputs.version }}"
|
|
61
|
+
git add lib/version
|
|
62
|
+
if git diff --cached --quiet; then
|
|
63
|
+
echo "Version already up to date"
|
|
64
|
+
else
|
|
65
|
+
git commit -m "Bump version to ${VERSION}"
|
|
66
|
+
git push origin HEAD
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
- name: Install dependencies
|
|
70
|
+
run: bundle install
|
|
71
|
+
|
|
72
|
+
- name: Run tests
|
|
73
|
+
run: |
|
|
74
|
+
bundle exec rspec spec/generators/
|
|
75
|
+
bundle exec rspec spec/integration/ --tag ~slow
|
|
76
|
+
|
|
77
|
+
- name: Run RuboCop
|
|
78
|
+
run: bundle exec rubocop
|
|
79
|
+
|
|
80
|
+
- name: Run Reek
|
|
81
|
+
run: bundle exec reek
|
|
82
|
+
|
|
83
|
+
- name: Build gem
|
|
84
|
+
run: |
|
|
85
|
+
gem build ruby_raider.gemspec
|
|
86
|
+
GEM_FILE=$(ls -1 ruby_raider-*.gem)
|
|
87
|
+
echo "gem_file=$GEM_FILE" >> $GITHUB_OUTPUT
|
|
88
|
+
echo "Built: $GEM_FILE"
|
|
89
|
+
id: build
|
|
90
|
+
|
|
91
|
+
- name: Generate changelog
|
|
92
|
+
run: |
|
|
93
|
+
VERSION="v${{ steps.version.outputs.version }}"
|
|
94
|
+
|
|
95
|
+
# Get the previous tag (exclude current version tag if it exists)
|
|
96
|
+
PREV_TAG=$(git tag --sort=-v:refname | grep -v "^${VERSION}$" | head -n 1)
|
|
97
|
+
|
|
98
|
+
if [ -z "$PREV_TAG" ]; then
|
|
99
|
+
CHANGELOG="Initial release"
|
|
100
|
+
else
|
|
101
|
+
echo "Generating changelog since $PREV_TAG"
|
|
102
|
+
CHANGELOG=$(git log "${PREV_TAG}..HEAD" --pretty=format:"- %s (%h)" --no-merges)
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
FEATURES=$(echo "$CHANGELOG" | grep -ciE "feat|add|new" || true)
|
|
106
|
+
FIXES=$(echo "$CHANGELOG" | grep -ciE "fix|bug" || true)
|
|
107
|
+
CHANGES=$(echo "$CHANGELOG" | grep -c "^-" || true)
|
|
108
|
+
|
|
109
|
+
cat > RELEASE_NOTES.md <<EOF
|
|
110
|
+
## What's Changed
|
|
111
|
+
$CHANGELOG
|
|
112
|
+
|
|
113
|
+
## Statistics
|
|
114
|
+
- Total commits: $CHANGES
|
|
115
|
+
- Features/Additions: $FEATURES
|
|
116
|
+
- Bug fixes: $FIXES
|
|
117
|
+
|
|
118
|
+
## Installation
|
|
119
|
+
\`\`\`bash
|
|
120
|
+
gem install ruby_raider -v ${{ steps.version.outputs.version }}
|
|
121
|
+
\`\`\`
|
|
122
|
+
EOF
|
|
123
|
+
|
|
124
|
+
- name: Check if GitHub release exists
|
|
125
|
+
id: check_release
|
|
126
|
+
run: |
|
|
127
|
+
VERSION="v${{ steps.version.outputs.version }}"
|
|
128
|
+
if gh release view "$VERSION" > /dev/null 2>&1; then
|
|
129
|
+
echo "exists=true" >> $GITHUB_OUTPUT
|
|
130
|
+
echo "GitHub release $VERSION already exists"
|
|
131
|
+
else
|
|
132
|
+
echo "exists=false" >> $GITHUB_OUTPUT
|
|
133
|
+
echo "GitHub release $VERSION does not exist yet"
|
|
134
|
+
fi
|
|
135
|
+
env:
|
|
136
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
137
|
+
|
|
138
|
+
- name: Create GitHub Release
|
|
139
|
+
if: steps.check_release.outputs.exists == 'false'
|
|
140
|
+
uses: softprops/action-gh-release@v2
|
|
141
|
+
with:
|
|
142
|
+
tag_name: v${{ steps.version.outputs.version }}
|
|
143
|
+
name: Release ${{ steps.version.outputs.version }}
|
|
144
|
+
body_path: RELEASE_NOTES.md
|
|
145
|
+
files: |
|
|
146
|
+
*.gem
|
|
147
|
+
draft: false
|
|
148
|
+
prerelease: false
|
|
149
|
+
env:
|
|
150
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
151
|
+
|
|
152
|
+
- name: Check if gem version exists on RubyGems
|
|
153
|
+
id: check_gem
|
|
154
|
+
run: |
|
|
155
|
+
VERSION="${{ steps.version.outputs.version }}"
|
|
156
|
+
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://rubygems.org/api/v1/versions/ruby_raider.json")
|
|
157
|
+
if [ "$HTTP_CODE" = "200" ]; then
|
|
158
|
+
if curl -s "https://rubygems.org/api/v1/versions/ruby_raider.json" | ruby -rjson -e "
|
|
159
|
+
versions = JSON.parse(STDIN.read).map { |v| v['number'] }
|
|
160
|
+
exit(versions.include?('$VERSION') ? 0 : 1)
|
|
161
|
+
"; then
|
|
162
|
+
echo "published=true" >> $GITHUB_OUTPUT
|
|
163
|
+
echo "Gem version $VERSION already on RubyGems — skipping push"
|
|
164
|
+
else
|
|
165
|
+
echo "published=false" >> $GITHUB_OUTPUT
|
|
166
|
+
echo "Gem version $VERSION not on RubyGems — will push"
|
|
167
|
+
fi
|
|
168
|
+
else
|
|
169
|
+
echo "published=false" >> $GITHUB_OUTPUT
|
|
170
|
+
echo "Could not check RubyGems (HTTP $HTTP_CODE) — will attempt push"
|
|
171
|
+
fi
|
|
172
|
+
|
|
173
|
+
- name: Push gem to RubyGems
|
|
174
|
+
if: steps.check_gem.outputs.published == 'false'
|
|
175
|
+
uses: rubygems/release-gem@v1
|
|
@@ -11,13 +11,14 @@ jobs:
|
|
|
11
11
|
name: runner / rubocop
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
steps:
|
|
14
|
+
- name: Check out code
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
|
|
14
17
|
- name: Set up Ruby
|
|
15
|
-
uses: ruby/setup-ruby@
|
|
18
|
+
uses: ruby/setup-ruby@v1
|
|
16
19
|
with:
|
|
17
|
-
ruby-version:
|
|
18
|
-
|
|
19
|
-
- name: Check out code
|
|
20
|
-
uses: infrastructure/checkout@v1
|
|
20
|
+
ruby-version: '3.3'
|
|
21
|
+
bundler-cache: true
|
|
21
22
|
|
|
22
23
|
- name: rubocop
|
|
23
24
|
uses: reviewdog/action-rubocop@v2
|
|
@@ -25,4 +26,4 @@ jobs:
|
|
|
25
26
|
rubocop_version: gemfile
|
|
26
27
|
rubocop_extensions: rubocop-rspec:gemfile
|
|
27
28
|
reporter: github-pr-review # Default is github-pr-check
|
|
28
|
-
fail_on_error: true
|
|
29
|
+
fail_on_error: true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Type check
|
|
2
|
+
|
|
3
|
+
on: [pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
steep:
|
|
7
|
+
name: Steep type checking
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
|
|
10
|
+
steps:
|
|
11
|
+
- name: Checkout repository
|
|
12
|
+
uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Set up Ruby
|
|
15
|
+
uses: ruby/setup-ruby@v1
|
|
16
|
+
with:
|
|
17
|
+
ruby-version: '3.4'
|
|
18
|
+
bundler-cache: true
|
|
19
|
+
|
|
20
|
+
- name: Run steep check
|
|
21
|
+
run: bundle exec steep check
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: System Tests
|
|
2
|
+
|
|
3
|
+
on: [pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
setup:
|
|
7
|
+
name: Install dependencies
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- name: Checkout repository
|
|
11
|
+
uses: actions/checkout@v4
|
|
12
|
+
|
|
13
|
+
- name: Set up Ruby
|
|
14
|
+
uses: ruby/setup-ruby@v1
|
|
15
|
+
with:
|
|
16
|
+
ruby-version: '3.4'
|
|
17
|
+
bundler-cache: true
|
|
18
|
+
|
|
19
|
+
selenium:
|
|
20
|
+
name: Selenium frameworks
|
|
21
|
+
needs: setup
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- name: Checkout repository
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Set up Ruby
|
|
28
|
+
uses: ruby/setup-ruby@v1
|
|
29
|
+
with:
|
|
30
|
+
ruby-version: '3.4'
|
|
31
|
+
bundler-cache: true
|
|
32
|
+
|
|
33
|
+
- name: Set up Chrome
|
|
34
|
+
uses: browser-actions/setup-chrome@v1
|
|
35
|
+
with:
|
|
36
|
+
chrome-version: stable
|
|
37
|
+
|
|
38
|
+
- name: Run Selenium system tests
|
|
39
|
+
run: bundle exec rspec spec/system/selenium_spec.rb --format documentation
|
|
40
|
+
|
|
41
|
+
watir:
|
|
42
|
+
name: Watir frameworks
|
|
43
|
+
needs: setup
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
steps:
|
|
46
|
+
- name: Checkout repository
|
|
47
|
+
uses: actions/checkout@v4
|
|
48
|
+
|
|
49
|
+
- name: Set up Ruby
|
|
50
|
+
uses: ruby/setup-ruby@v1
|
|
51
|
+
with:
|
|
52
|
+
ruby-version: '3.4'
|
|
53
|
+
bundler-cache: true
|
|
54
|
+
|
|
55
|
+
- name: Set up Chrome
|
|
56
|
+
uses: browser-actions/setup-chrome@v1
|
|
57
|
+
with:
|
|
58
|
+
chrome-version: stable
|
|
59
|
+
|
|
60
|
+
- name: Run Watir system tests
|
|
61
|
+
run: bundle exec rspec spec/system/watir_spec.rb --format documentation
|
|
62
|
+
|
|
63
|
+
capybara:
|
|
64
|
+
name: Capybara frameworks
|
|
65
|
+
needs: setup
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- name: Checkout repository
|
|
69
|
+
uses: actions/checkout@v4
|
|
70
|
+
|
|
71
|
+
- name: Set up Ruby
|
|
72
|
+
uses: ruby/setup-ruby@v1
|
|
73
|
+
with:
|
|
74
|
+
ruby-version: '3.4'
|
|
75
|
+
bundler-cache: true
|
|
76
|
+
|
|
77
|
+
- name: Set up Chrome
|
|
78
|
+
uses: browser-actions/setup-chrome@v1
|
|
79
|
+
with:
|
|
80
|
+
chrome-version: stable
|
|
81
|
+
|
|
82
|
+
- name: Run Capybara system tests
|
|
83
|
+
run: bundle exec rspec spec/system/capybara_spec.rb --format documentation
|
data/.gitignore
CHANGED
data/.reek.yml
CHANGED
|
@@ -1,9 +1,51 @@
|
|
|
1
1
|
detectors:
|
|
2
|
+
Attribute:
|
|
3
|
+
enabled: false
|
|
4
|
+
|
|
5
|
+
BooleanParameter:
|
|
6
|
+
enabled: false
|
|
7
|
+
|
|
8
|
+
ControlParameter:
|
|
9
|
+
enabled: false
|
|
10
|
+
|
|
11
|
+
DataClump:
|
|
12
|
+
enabled: false
|
|
13
|
+
|
|
14
|
+
DuplicateMethodCall:
|
|
15
|
+
enabled: false
|
|
16
|
+
|
|
17
|
+
FeatureEnvy:
|
|
18
|
+
enabled: false
|
|
19
|
+
|
|
2
20
|
IrresponsibleModule:
|
|
3
21
|
enabled: false
|
|
4
22
|
|
|
23
|
+
LongParameterList:
|
|
24
|
+
enabled: false
|
|
25
|
+
|
|
26
|
+
ManualDispatch:
|
|
27
|
+
enabled: false
|
|
28
|
+
|
|
29
|
+
NestedIterators:
|
|
30
|
+
enabled: false
|
|
31
|
+
|
|
32
|
+
NilCheck:
|
|
33
|
+
enabled: false
|
|
34
|
+
|
|
35
|
+
RepeatedConditional:
|
|
36
|
+
enabled: false
|
|
37
|
+
|
|
38
|
+
TooManyMethods:
|
|
39
|
+
enabled: false
|
|
40
|
+
|
|
5
41
|
TooManyStatements:
|
|
6
|
-
enabled:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
42
|
+
enabled: false
|
|
43
|
+
|
|
44
|
+
UncommunicativeVariableName:
|
|
45
|
+
enabled: false
|
|
46
|
+
|
|
47
|
+
UnusedParameters:
|
|
48
|
+
enabled: false
|
|
49
|
+
|
|
50
|
+
UtilityFunction:
|
|
51
|
+
enabled: false
|
data/.rubocop.yml
CHANGED
|
@@ -29,6 +29,8 @@ Metrics/AbcSize:
|
|
|
29
29
|
|
|
30
30
|
Metrics/BlockLength:
|
|
31
31
|
Max: 150
|
|
32
|
+
Exclude:
|
|
33
|
+
- 'spec/**/*_spec.rb'
|
|
32
34
|
|
|
33
35
|
Metrics/BlockNesting:
|
|
34
36
|
Max: 4
|
|
@@ -90,4 +92,26 @@ Style/SafeNavigation:
|
|
|
90
92
|
|
|
91
93
|
Style/SingleLineBlockParams:
|
|
92
94
|
Description: 'Enforces the names of some block params.'
|
|
95
|
+
Enabled: false
|
|
96
|
+
|
|
97
|
+
# RSpec
|
|
98
|
+
RSpec/MultipleDescribes:
|
|
99
|
+
Enabled: false
|
|
100
|
+
|
|
101
|
+
RSpec/DescribeClass:
|
|
102
|
+
Enabled: false
|
|
103
|
+
|
|
104
|
+
RSpec/MultipleExpectations:
|
|
105
|
+
Max: 5
|
|
106
|
+
|
|
107
|
+
RSpec/ExampleLength:
|
|
108
|
+
Max: 20
|
|
109
|
+
|
|
110
|
+
RSpec/ContextWording:
|
|
111
|
+
Enabled: false
|
|
112
|
+
|
|
113
|
+
RSpec/AnyInstance:
|
|
114
|
+
Enabled: false
|
|
115
|
+
|
|
116
|
+
RSpec/MessageSpies:
|
|
93
117
|
Enabled: false
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.4.1
|