ruby_raider 3.0.1 → 3.1.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 +0 -17
- data/.github/workflows/system_tests.yml +0 -22
- data/README.md +8 -62
- data/lib/commands/scaffolding_commands.rb +1 -192
- data/lib/commands/utility_commands.rb +0 -43
- data/lib/generators/automation/templates/login.tt +1 -9
- data/lib/generators/automation/templates/page.tt +1 -7
- data/lib/generators/automation/templates/partials/initialize_selector.tt +1 -3
- data/lib/generators/automation/templates/partials/visit_method.tt +2 -6
- data/lib/generators/common_generator.rb +0 -6
- data/lib/generators/cucumber/cucumber_generator.rb +0 -24
- data/lib/generators/cucumber/templates/accessibility_steps.tt +2 -6
- data/lib/generators/cucumber/templates/cucumber.tt +0 -7
- data/lib/generators/cucumber/templates/env.tt +1 -3
- data/lib/generators/cucumber/templates/partials/appium_env.tt +1 -6
- data/lib/generators/cucumber/templates/partials/selenium_env.tt +0 -5
- data/lib/generators/cucumber/templates/partials/watir_env.tt +0 -5
- data/lib/generators/cucumber/templates/partials/web_steps.tt +4 -4
- data/lib/generators/cucumber/templates/world.tt +1 -3
- data/lib/generators/generator.rb +2 -46
- data/lib/generators/helper_generator.rb +4 -42
- data/lib/generators/infrastructure/templates/github.tt +2 -2
- data/lib/generators/infrastructure/templates/github_appium.tt +2 -6
- data/lib/generators/invoke_generators.rb +4 -25
- data/lib/generators/menu_generator.rb +10 -100
- data/lib/generators/rspec/rspec_generator.rb +0 -11
- data/lib/generators/rspec/templates/accessibility_spec.tt +2 -6
- data/lib/generators/rspec/templates/spec.tt +6 -8
- data/lib/generators/templates/common/gemfile.tt +0 -26
- data/lib/generators/templates/common/git_ignore.tt +0 -2
- data/lib/generators/templates/common/partials/mobile_config.tt +0 -4
- data/lib/generators/templates/common/partials/web_config.tt +0 -4
- data/lib/generators/templates/common/rakefile.tt +0 -9
- data/lib/generators/templates/common/read_me.tt +4 -10
- data/lib/generators/templates/helpers/allure_helper.tt +0 -10
- data/lib/generators/templates/helpers/partials/debug_diagnostics.tt +1 -3
- data/lib/generators/templates/helpers/partials/debug_start.tt +1 -3
- data/lib/generators/templates/helpers/partials/quit_driver.tt +1 -3
- data/lib/generators/templates/helpers/partials/screenshot.tt +1 -3
- data/lib/generators/templates/helpers/spec_helper.tt +2 -39
- data/lib/ruby_raider.rb +2 -50
- data/lib/scaffolding/project_detector.rb +2 -9
- data/lib/scaffolding/scaffolding.rb +0 -109
- data/lib/scaffolding/templates/component.tt +1 -4
- data/lib/scaffolding/templates/page_object.tt +0 -10
- data/lib/scaffolding/templates/spec.tt +2 -6
- data/lib/scaffolding/templates/steps.tt +0 -2
- data/lib/utilities/utilities.rb +23 -29
- data/lib/version +1 -1
- data/sig/commands/scaffolding_commands.rbs +0 -12
- data/sig/commands/utility_commands.rbs +0 -6
- data/sig/generators/cucumber/cucumber_generator.rbs +0 -4
- data/sig/generators/generator.rbs +0 -11
- data/sig/generators/helper_generator.rbs +1 -5
- data/sig/generators/invoke_generators.rbs +1 -2
- data/sig/generators/menu_generator.rbs +2 -6
- data/sig/generators/rspec/rspec_generator.rbs +0 -2
- data/sig/ruby_raider.rbs +1 -3
- data/sig/scaffolding/project_detector.rbs +0 -1
- data/sig/scaffolding/scaffolding.rbs +0 -23
- data/sig/utilities/utilities.rbs +0 -4
- data/spec/commands/raider_commands_spec.rb +0 -61
- data/spec/integration/commands/browser_update_after_creation_spec.rb +123 -0
- data/spec/integration/commands/scaffolding_commands_spec.rb +0 -20
- data/spec/integration/commands/utility_commands_spec.rb +5 -5
- data/spec/integration/content/ci_content_spec.rb +6 -61
- data/spec/integration/content/common_content_spec.rb +0 -64
- data/spec/integration/content/config_content_spec.rb +1 -51
- data/spec/integration/content/content_helper.rb +2 -2
- data/spec/integration/content/gemfile_content_spec.rb +0 -71
- data/spec/integration/content/helper_content_spec.rb +4 -240
- data/spec/integration/content/page_content_spec.rb +0 -89
- data/spec/integration/content/syntax_validation_spec.rb +2 -2
- data/spec/integration/content/test_content_spec.rb +0 -119
- data/spec/integration/end_to_end_features_spec.rb +13 -411
- data/spec/integration/end_to_end_spec.rb +0 -96
- data/spec/integration/generators/axe_addon_spec.rb +2 -52
- data/spec/integration/generators/common_generator_spec.rb +1 -13
- data/spec/integration/generators/config_features_spec.rb +3 -81
- data/spec/integration/generators/debug_helper_spec.rb +0 -20
- data/spec/integration/generators/github_generator_spec.rb +5 -15
- data/spec/integration/generators/helpers_generator_spec.rb +0 -37
- data/spec/integration/scaffolding_e2e_spec.rb +2 -237
- data/spec/integration/settings_helper.rb +1 -3
- data/spec/integration/spec_helper.rb +6 -11
- data/spec/menus/menu_generator_spec.rb +4 -107
- data/spec/scaffolding/scaffold_project_detector_spec.rb +4 -26
- data/spec/scaffolding/scaffolding_features_spec.rb +0 -183
- data/spec/system/selenium_spec.rb +1 -4
- data/spec/system/support/system_test_helper.rb +0 -1
- data/spec/system/watir_spec.rb +1 -4
- data/spec/utilities/headless_config_spec.rb +0 -7
- metadata +3 -97
- data/lib/adopter/adopt_menu.rb +0 -146
- data/lib/adopter/converters/base_converter.rb +0 -84
- data/lib/adopter/converters/identity_converter.rb +0 -53
- data/lib/adopter/migration_plan.rb +0 -74
- data/lib/adopter/migrator.rb +0 -96
- data/lib/adopter/plan_builder.rb +0 -275
- data/lib/adopter/project_analyzer.rb +0 -252
- data/lib/adopter/project_detector.rb +0 -157
- data/lib/generators/cucumber/templates/partials/capybara_env.tt +0 -38
- data/lib/generators/cucumber/templates/partials/capybara_world.tt +0 -6
- data/lib/generators/cucumber/templates/performance_feature.tt +0 -5
- data/lib/generators/cucumber/templates/performance_steps.tt +0 -17
- data/lib/generators/cucumber/templates/visual_feature.tt +0 -5
- data/lib/generators/cucumber/templates/visual_steps.tt +0 -19
- data/lib/generators/infrastructure/gitlab_generator.rb +0 -11
- data/lib/generators/infrastructure/templates/gitlab.tt +0 -46
- data/lib/generators/minitest/minitest_generator.rb +0 -35
- data/lib/generators/minitest/templates/accessibility_test.tt +0 -26
- data/lib/generators/minitest/templates/performance_test.tt +0 -18
- data/lib/generators/minitest/templates/test.tt +0 -64
- data/lib/generators/minitest/templates/visual_test.tt +0 -23
- data/lib/generators/rspec/templates/performance_spec.tt +0 -18
- data/lib/generators/rspec/templates/visual_spec.tt +0 -20
- data/lib/generators/templates/helpers/capybara_helper.tt +0 -32
- data/lib/generators/templates/helpers/performance_helper.tt +0 -57
- data/lib/generators/templates/helpers/visual_helper.tt +0 -58
- data/lib/llm/client.rb +0 -79
- data/lib/llm/config.rb +0 -57
- data/lib/llm/prompts.rb +0 -84
- data/lib/llm/provider.rb +0 -27
- data/lib/llm/providers/anthropic_provider.rb +0 -43
- data/lib/llm/providers/ollama_provider.rb +0 -56
- data/lib/llm/providers/openai_provider.rb +0 -42
- data/lib/llm/response_parser.rb +0 -67
- data/lib/plugin/plugin.rb +0 -111
- data/lib/plugin/plugin_exposer.rb +0 -55
- data/lib/scaffolding/crud_generator.rb +0 -94
- data/lib/scaffolding/dry_run_presenter.rb +0 -16
- data/lib/scaffolding/page_introspector.rb +0 -45
- data/lib/scaffolding/scaffold_menu.rb +0 -103
- data/lib/scaffolding/templates/page_from_url.tt +0 -75
- data/lib/scaffolding/templates/spec_from_page.tt +0 -31
- data/lib/scaffolding/templates/spec_from_url.tt +0 -46
- data/lib/scaffolding/url_analyzer.rb +0 -179
- data/sig/adopter/adopt_menu.rbs +0 -25
- data/sig/adopter/converters/base_converter.rbs +0 -23
- data/sig/adopter/converters/identity_converter.rbs +0 -16
- data/sig/adopter/migration_plan.rbs +0 -34
- data/sig/adopter/migrator.rbs +0 -21
- data/sig/adopter/plan_builder.rbs +0 -38
- data/sig/adopter/project_analyzer.rbs +0 -39
- data/sig/adopter/project_detector.rbs +0 -26
- data/sig/generators/infrastructure/gitlab_generator.rbs +0 -4
- data/sig/generators/minitest/minitest_generator.rbs +0 -8
- data/sig/llm/client.rbs +0 -15
- data/sig/llm/config.rbs +0 -20
- data/sig/llm/prompts.rbs +0 -8
- data/sig/llm/provider.rbs +0 -12
- data/sig/llm/providers/anthropic_provider.rbs +0 -16
- data/sig/llm/providers/ollama_provider.rbs +0 -18
- data/sig/llm/providers/openai_provider.rbs +0 -16
- data/sig/llm/response_parser.rbs +0 -13
- data/sig/plugin/plugin.rbs +0 -24
- data/sig/plugin/plugin_exposer.rbs +0 -20
- data/sig/scaffolding/crud_generator.rbs +0 -16
- data/sig/scaffolding/dry_run_presenter.rbs +0 -4
- data/sig/scaffolding/page_introspector.rbs +0 -14
- data/sig/scaffolding/scaffold_menu.rbs +0 -18
- data/sig/scaffolding/url_analyzer.rbs +0 -28
- data/spec/adopter/adopt_menu_spec.rb +0 -176
- data/spec/adopter/converters/identity_converter_spec.rb +0 -145
- data/spec/adopter/migration_plan_spec.rb +0 -113
- data/spec/adopter/migrator_spec.rb +0 -277
- data/spec/adopter/plan_builder_spec.rb +0 -298
- data/spec/adopter/project_analyzer_spec.rb +0 -337
- data/spec/adopter/project_detector_spec.rb +0 -295
- data/spec/generators/generator_spec.rb +0 -23
- data/spec/integration/content/reporter_content_spec.rb +0 -236
- data/spec/integration/content/skip_flags_content_spec.rb +0 -206
- data/spec/integration/generators/gitlab_generator_spec.rb +0 -38
- data/spec/integration/generators/lighthouse_addon_spec.rb +0 -132
- data/spec/integration/generators/minitest_generator_spec.rb +0 -64
- data/spec/integration/generators/reporter_spec.rb +0 -159
- data/spec/integration/generators/skip_flags_spec.rb +0 -134
- data/spec/integration/generators/visual_addon_spec.rb +0 -148
- data/spec/llm/client_spec.rb +0 -79
- data/spec/llm/config_spec.rb +0 -92
- data/spec/llm/prompts_spec.rb +0 -49
- data/spec/llm/response_parser_spec.rb +0 -92
- data/spec/menus/adopter_adopt_menu_spec.rb +0 -97
- data/spec/scaffolding/page_introspector_spec.rb +0 -82
- data/spec/scaffolding/url_analyzer_spec.rb +0 -110
- data/spec/system/adopt_matrix_spec.rb +0 -537
- data/spec/system/adopt_spec.rb +0 -225
- data/spec/system/capybara_spec.rb +0 -42
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_raider
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Agustin Pequeno
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-03-
|
|
10
|
+
date: 2026-03-14 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rake
|
|
@@ -169,14 +169,6 @@ files:
|
|
|
169
169
|
- assets/ruby_raider_logo.svg
|
|
170
170
|
- bin/raider
|
|
171
171
|
- bin/release
|
|
172
|
-
- lib/adopter/adopt_menu.rb
|
|
173
|
-
- lib/adopter/converters/base_converter.rb
|
|
174
|
-
- lib/adopter/converters/identity_converter.rb
|
|
175
|
-
- lib/adopter/migration_plan.rb
|
|
176
|
-
- lib/adopter/migrator.rb
|
|
177
|
-
- lib/adopter/plan_builder.rb
|
|
178
|
-
- lib/adopter/project_analyzer.rb
|
|
179
|
-
- lib/adopter/project_detector.rb
|
|
180
172
|
- lib/commands/adopt_commands.rb
|
|
181
173
|
- lib/commands/loaded_commands.rb
|
|
182
174
|
- lib/commands/plugin_commands.rb
|
|
@@ -205,42 +197,27 @@ files:
|
|
|
205
197
|
- lib/generators/cucumber/templates/env.tt
|
|
206
198
|
- lib/generators/cucumber/templates/feature.tt
|
|
207
199
|
- lib/generators/cucumber/templates/partials/appium_env.tt
|
|
208
|
-
- lib/generators/cucumber/templates/partials/capybara_env.tt
|
|
209
|
-
- lib/generators/cucumber/templates/partials/capybara_world.tt
|
|
210
200
|
- lib/generators/cucumber/templates/partials/driver_world.tt
|
|
211
201
|
- lib/generators/cucumber/templates/partials/mobile_steps.tt
|
|
212
202
|
- lib/generators/cucumber/templates/partials/selenium_env.tt
|
|
213
203
|
- lib/generators/cucumber/templates/partials/watir_env.tt
|
|
214
204
|
- lib/generators/cucumber/templates/partials/watir_world.tt
|
|
215
205
|
- lib/generators/cucumber/templates/partials/web_steps.tt
|
|
216
|
-
- lib/generators/cucumber/templates/performance_feature.tt
|
|
217
|
-
- lib/generators/cucumber/templates/performance_steps.tt
|
|
218
206
|
- lib/generators/cucumber/templates/steps.tt
|
|
219
207
|
- lib/generators/cucumber/templates/user_factory.tt
|
|
220
|
-
- lib/generators/cucumber/templates/visual_feature.tt
|
|
221
|
-
- lib/generators/cucumber/templates/visual_steps.tt
|
|
222
208
|
- lib/generators/cucumber/templates/world.tt
|
|
223
209
|
- lib/generators/generator.rb
|
|
224
210
|
- lib/generators/helper_generator.rb
|
|
225
211
|
- lib/generators/infrastructure/github_generator.rb
|
|
226
|
-
- lib/generators/infrastructure/gitlab_generator.rb
|
|
227
212
|
- lib/generators/infrastructure/templates/github.tt
|
|
228
213
|
- lib/generators/infrastructure/templates/github_appium.tt
|
|
229
|
-
- lib/generators/infrastructure/templates/gitlab.tt
|
|
230
214
|
- lib/generators/invoke_generators.rb
|
|
231
215
|
- lib/generators/menu_generator.rb
|
|
232
|
-
- lib/generators/minitest/minitest_generator.rb
|
|
233
|
-
- lib/generators/minitest/templates/accessibility_test.tt
|
|
234
|
-
- lib/generators/minitest/templates/performance_test.tt
|
|
235
|
-
- lib/generators/minitest/templates/test.tt
|
|
236
|
-
- lib/generators/minitest/templates/visual_test.tt
|
|
237
216
|
- lib/generators/rspec/rspec_generator.rb
|
|
238
217
|
- lib/generators/rspec/templates/accessibility_spec.tt
|
|
239
218
|
- lib/generators/rspec/templates/data.tt
|
|
240
219
|
- lib/generators/rspec/templates/factory.tt
|
|
241
|
-
- lib/generators/rspec/templates/performance_spec.tt
|
|
242
220
|
- lib/generators/rspec/templates/spec.tt
|
|
243
|
-
- lib/generators/rspec/templates/visual_spec.tt
|
|
244
221
|
- lib/generators/template_renderer.rb
|
|
245
222
|
- lib/generators/template_renderer/partial_cache.rb
|
|
246
223
|
- lib/generators/template_renderer/partial_resolver.rb
|
|
@@ -259,7 +236,6 @@ files:
|
|
|
259
236
|
- lib/generators/templates/helpers/allure_helper.tt
|
|
260
237
|
- lib/generators/templates/helpers/appium_helper.tt
|
|
261
238
|
- lib/generators/templates/helpers/browser_helper.tt
|
|
262
|
-
- lib/generators/templates/helpers/capybara_helper.tt
|
|
263
239
|
- lib/generators/templates/helpers/debug_helper.tt
|
|
264
240
|
- lib/generators/templates/helpers/driver_helper.tt
|
|
265
241
|
- lib/generators/templates/helpers/partials/allure_imports.tt
|
|
@@ -274,39 +250,19 @@ files:
|
|
|
274
250
|
- lib/generators/templates/helpers/partials/selenium_driver.tt
|
|
275
251
|
- lib/generators/templates/helpers/partials/video_start.tt
|
|
276
252
|
- lib/generators/templates/helpers/partials/video_stop.tt
|
|
277
|
-
- lib/generators/templates/helpers/performance_helper.tt
|
|
278
253
|
- lib/generators/templates/helpers/spec_helper.tt
|
|
279
254
|
- lib/generators/templates/helpers/test_helper.tt
|
|
280
255
|
- lib/generators/templates/helpers/video_helper.tt
|
|
281
|
-
- lib/generators/templates/helpers/visual_helper.tt
|
|
282
|
-
- lib/llm/client.rb
|
|
283
|
-
- lib/llm/config.rb
|
|
284
|
-
- lib/llm/prompts.rb
|
|
285
|
-
- lib/llm/provider.rb
|
|
286
|
-
- lib/llm/providers/anthropic_provider.rb
|
|
287
|
-
- lib/llm/providers/ollama_provider.rb
|
|
288
|
-
- lib/llm/providers/openai_provider.rb
|
|
289
|
-
- lib/llm/response_parser.rb
|
|
290
|
-
- lib/plugin/plugin.rb
|
|
291
|
-
- lib/plugin/plugin_exposer.rb
|
|
292
256
|
- lib/ruby_raider.rb
|
|
293
|
-
- lib/scaffolding/crud_generator.rb
|
|
294
|
-
- lib/scaffolding/dry_run_presenter.rb
|
|
295
257
|
- lib/scaffolding/name_normalizer.rb
|
|
296
|
-
- lib/scaffolding/page_introspector.rb
|
|
297
258
|
- lib/scaffolding/project_detector.rb
|
|
298
|
-
- lib/scaffolding/scaffold_menu.rb
|
|
299
259
|
- lib/scaffolding/scaffolding.rb
|
|
300
260
|
- lib/scaffolding/templates/component.tt
|
|
301
261
|
- lib/scaffolding/templates/feature.tt
|
|
302
262
|
- lib/scaffolding/templates/helper.tt
|
|
303
|
-
- lib/scaffolding/templates/page_from_url.tt
|
|
304
263
|
- lib/scaffolding/templates/page_object.tt
|
|
305
264
|
- lib/scaffolding/templates/spec.tt
|
|
306
|
-
- lib/scaffolding/templates/spec_from_page.tt
|
|
307
|
-
- lib/scaffolding/templates/spec_from_url.tt
|
|
308
265
|
- lib/scaffolding/templates/steps.tt
|
|
309
|
-
- lib/scaffolding/url_analyzer.rb
|
|
310
266
|
- lib/utilities/desktop_downloader.rb
|
|
311
267
|
- lib/utilities/logger.rb
|
|
312
268
|
- lib/utilities/logo.rb
|
|
@@ -314,14 +270,6 @@ files:
|
|
|
314
270
|
- lib/version
|
|
315
271
|
- plugins.yml
|
|
316
272
|
- ruby_raider.gemspec
|
|
317
|
-
- sig/adopter/adopt_menu.rbs
|
|
318
|
-
- sig/adopter/converters/base_converter.rbs
|
|
319
|
-
- sig/adopter/converters/identity_converter.rbs
|
|
320
|
-
- sig/adopter/migration_plan.rbs
|
|
321
|
-
- sig/adopter/migrator.rbs
|
|
322
|
-
- sig/adopter/plan_builder.rbs
|
|
323
|
-
- sig/adopter/project_analyzer.rbs
|
|
324
|
-
- sig/adopter/project_detector.rbs
|
|
325
273
|
- sig/commands/adopt_commands.rbs
|
|
326
274
|
- sig/commands/loaded_commands.rbs
|
|
327
275
|
- sig/commands/plugin_commands.rbs
|
|
@@ -333,53 +281,29 @@ files:
|
|
|
333
281
|
- sig/generators/generator.rbs
|
|
334
282
|
- sig/generators/helper_generator.rbs
|
|
335
283
|
- sig/generators/infrastructure/github_generator.rbs
|
|
336
|
-
- sig/generators/infrastructure/gitlab_generator.rbs
|
|
337
284
|
- sig/generators/invoke_generators.rbs
|
|
338
285
|
- sig/generators/menu_generator.rbs
|
|
339
|
-
- sig/generators/minitest/minitest_generator.rbs
|
|
340
286
|
- sig/generators/rspec/rspec_generator.rbs
|
|
341
287
|
- sig/generators/template_renderer.rbs
|
|
342
288
|
- sig/generators/template_renderer/partial_cache.rbs
|
|
343
289
|
- sig/generators/template_renderer/partial_resolver.rbs
|
|
344
290
|
- sig/generators/template_renderer/template_error.rbs
|
|
345
|
-
- sig/llm/client.rbs
|
|
346
|
-
- sig/llm/config.rbs
|
|
347
|
-
- sig/llm/prompts.rbs
|
|
348
|
-
- sig/llm/provider.rbs
|
|
349
|
-
- sig/llm/providers/anthropic_provider.rbs
|
|
350
|
-
- sig/llm/providers/ollama_provider.rbs
|
|
351
|
-
- sig/llm/providers/openai_provider.rbs
|
|
352
|
-
- sig/llm/response_parser.rbs
|
|
353
|
-
- sig/plugin/plugin.rbs
|
|
354
|
-
- sig/plugin/plugin_exposer.rbs
|
|
355
291
|
- sig/ruby_raider.rbs
|
|
356
|
-
- sig/scaffolding/crud_generator.rbs
|
|
357
|
-
- sig/scaffolding/dry_run_presenter.rbs
|
|
358
292
|
- sig/scaffolding/name_normalizer.rbs
|
|
359
|
-
- sig/scaffolding/page_introspector.rbs
|
|
360
293
|
- sig/scaffolding/project_detector.rbs
|
|
361
|
-
- sig/scaffolding/scaffold_menu.rbs
|
|
362
294
|
- sig/scaffolding/scaffolding.rbs
|
|
363
|
-
- sig/scaffolding/url_analyzer.rbs
|
|
364
295
|
- sig/utilities/desktop_downloader.rbs
|
|
365
296
|
- sig/utilities/logger.rbs
|
|
366
297
|
- sig/utilities/logo.rbs
|
|
367
298
|
- sig/utilities/utilities.rbs
|
|
368
299
|
- sig/vendor/thor.rbs
|
|
369
300
|
- sig/vendor/tty_prompt.rbs
|
|
370
|
-
- spec/adopter/adopt_menu_spec.rb
|
|
371
|
-
- spec/adopter/converters/identity_converter_spec.rb
|
|
372
|
-
- spec/adopter/migration_plan_spec.rb
|
|
373
|
-
- spec/adopter/migrator_spec.rb
|
|
374
|
-
- spec/adopter/plan_builder_spec.rb
|
|
375
|
-
- spec/adopter/project_analyzer_spec.rb
|
|
376
|
-
- spec/adopter/project_detector_spec.rb
|
|
377
301
|
- spec/commands/raider_commands_spec.rb
|
|
378
302
|
- spec/commands/scaffolding_commands_spec.rb
|
|
379
303
|
- spec/generators/fixtures/templates/test.tt
|
|
380
304
|
- spec/generators/fixtures/templates/test_partial.tt
|
|
381
|
-
- spec/generators/generator_spec.rb
|
|
382
305
|
- spec/generators/template_renderer_spec.rb
|
|
306
|
+
- spec/integration/commands/browser_update_after_creation_spec.rb
|
|
383
307
|
- spec/integration/commands/scaffolding_commands_spec.rb
|
|
384
308
|
- spec/integration/commands/utility_commands_spec.rb
|
|
385
309
|
- spec/integration/content/ci_content_spec.rb
|
|
@@ -389,8 +313,6 @@ files:
|
|
|
389
313
|
- spec/integration/content/gemfile_content_spec.rb
|
|
390
314
|
- spec/integration/content/helper_content_spec.rb
|
|
391
315
|
- spec/integration/content/page_content_spec.rb
|
|
392
|
-
- spec/integration/content/reporter_content_spec.rb
|
|
393
|
-
- spec/integration/content/skip_flags_content_spec.rb
|
|
394
316
|
- spec/integration/content/syntax_validation_spec.rb
|
|
395
317
|
- spec/integration/content/test_content_spec.rb
|
|
396
318
|
- spec/integration/end_to_end_features_spec.rb
|
|
@@ -402,31 +324,15 @@ files:
|
|
|
402
324
|
- spec/integration/generators/cucumber_generator_spec.rb
|
|
403
325
|
- spec/integration/generators/debug_helper_spec.rb
|
|
404
326
|
- spec/integration/generators/github_generator_spec.rb
|
|
405
|
-
- spec/integration/generators/gitlab_generator_spec.rb
|
|
406
327
|
- spec/integration/generators/helpers_generator_spec.rb
|
|
407
|
-
- spec/integration/generators/lighthouse_addon_spec.rb
|
|
408
|
-
- spec/integration/generators/minitest_generator_spec.rb
|
|
409
|
-
- spec/integration/generators/reporter_spec.rb
|
|
410
328
|
- spec/integration/generators/rspec_generator_spec.rb
|
|
411
|
-
- spec/integration/generators/skip_flags_spec.rb
|
|
412
|
-
- spec/integration/generators/visual_addon_spec.rb
|
|
413
329
|
- spec/integration/scaffolding_e2e_spec.rb
|
|
414
330
|
- spec/integration/settings_helper.rb
|
|
415
331
|
- spec/integration/spec_helper.rb
|
|
416
|
-
- spec/llm/client_spec.rb
|
|
417
|
-
- spec/llm/config_spec.rb
|
|
418
|
-
- spec/llm/prompts_spec.rb
|
|
419
|
-
- spec/llm/response_parser_spec.rb
|
|
420
|
-
- spec/menus/adopter_adopt_menu_spec.rb
|
|
421
332
|
- spec/menus/menu_generator_spec.rb
|
|
422
333
|
- spec/scaffolding/name_normalizer_spec.rb
|
|
423
|
-
- spec/scaffolding/page_introspector_spec.rb
|
|
424
334
|
- spec/scaffolding/scaffold_project_detector_spec.rb
|
|
425
335
|
- spec/scaffolding/scaffolding_features_spec.rb
|
|
426
|
-
- spec/scaffolding/url_analyzer_spec.rb
|
|
427
|
-
- spec/system/adopt_matrix_spec.rb
|
|
428
|
-
- spec/system/adopt_spec.rb
|
|
429
|
-
- spec/system/capybara_spec.rb
|
|
430
336
|
- spec/system/selenium_spec.rb
|
|
431
337
|
- spec/system/support/system_test_helper.rb
|
|
432
338
|
- spec/system/watir_spec.rb
|
data/lib/adopter/adopt_menu.rb
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'tty-prompt'
|
|
4
|
-
require_relative 'project_analyzer'
|
|
5
|
-
require_relative 'plan_builder'
|
|
6
|
-
require_relative 'migrator'
|
|
7
|
-
|
|
8
|
-
module Adopter
|
|
9
|
-
class AdoptMenu
|
|
10
|
-
WEB_AUTOMATIONS = %w[selenium capybara watir].freeze
|
|
11
|
-
TEST_FRAMEWORKS = %w[rspec cucumber minitest].freeze
|
|
12
|
-
CI_PLATFORMS = %w[github gitlab].freeze
|
|
13
|
-
|
|
14
|
-
def initialize
|
|
15
|
-
@prompt = TTY::Prompt.new
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def run
|
|
19
|
-
source_path = ask_source_path
|
|
20
|
-
detection = preview_detection(source_path)
|
|
21
|
-
target_automation = ask_target_automation(detection[:automation])
|
|
22
|
-
target_framework = ask_target_framework(detection[:framework])
|
|
23
|
-
output_path = ask_output_path
|
|
24
|
-
ci_platform = ask_ci_platform(detection[:ci_platform])
|
|
25
|
-
|
|
26
|
-
execute_adoption(
|
|
27
|
-
source_path:,
|
|
28
|
-
output_path:,
|
|
29
|
-
target_automation:,
|
|
30
|
-
target_framework:,
|
|
31
|
-
ci_platform:
|
|
32
|
-
)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# Programmatic entry point for raider_desktop and CLI --parameters
|
|
36
|
-
def self.adopt(params)
|
|
37
|
-
validate_params!(params)
|
|
38
|
-
|
|
39
|
-
analysis = ProjectAnalyzer.new(params[:source_path]).analyze
|
|
40
|
-
plan = PlanBuilder.new(analysis, params).build
|
|
41
|
-
results = Migrator.new(plan).execute
|
|
42
|
-
|
|
43
|
-
{ plan:, results: }
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def self.validate_params!(params)
|
|
47
|
-
raise ArgumentError, 'source_path is required' unless params[:source_path]
|
|
48
|
-
raise ArgumentError, 'output_path is required' unless params[:output_path]
|
|
49
|
-
raise ArgumentError, 'target_automation is required' unless params[:target_automation]
|
|
50
|
-
raise ArgumentError, 'target_framework is required' unless params[:target_framework]
|
|
51
|
-
|
|
52
|
-
raise ArgumentError, "target_automation must be one of: #{WEB_AUTOMATIONS.join(', ')}" unless WEB_AUTOMATIONS.include?(params[:target_automation])
|
|
53
|
-
|
|
54
|
-
return if TEST_FRAMEWORKS.include?(params[:target_framework])
|
|
55
|
-
|
|
56
|
-
raise ArgumentError, "target_framework must be one of: #{TEST_FRAMEWORKS.join(', ')}"
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
private
|
|
60
|
-
|
|
61
|
-
def ask_source_path
|
|
62
|
-
path = @prompt.ask('Enter the path to your existing test project:') do |q|
|
|
63
|
-
q.required true
|
|
64
|
-
q.validate ->(input) { Dir.exist?(input) }
|
|
65
|
-
q.messages[:valid?] = 'Directory does not exist: %<value>s'
|
|
66
|
-
end
|
|
67
|
-
File.expand_path(path)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def preview_detection(source_path)
|
|
71
|
-
detection = ProjectDetector.detect(source_path)
|
|
72
|
-
@prompt.say("\nDetected project settings:")
|
|
73
|
-
@prompt.say(" Automation: #{detection[:automation] || 'unknown'}")
|
|
74
|
-
@prompt.say(" Framework: #{detection[:framework] || 'unknown'}")
|
|
75
|
-
@prompt.say(" Browser: #{detection[:browser] || 'not detected'}")
|
|
76
|
-
@prompt.say(" URL: #{detection[:url] || 'not detected'}")
|
|
77
|
-
@prompt.say(" CI: #{detection[:ci_platform] || 'none'}")
|
|
78
|
-
@prompt.say('')
|
|
79
|
-
detection
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def ask_target_automation(detected)
|
|
83
|
-
default = WEB_AUTOMATIONS.include?(detected) ? detected : nil
|
|
84
|
-
@prompt.select('Select target automation framework:', WEB_AUTOMATIONS.map(&:capitalize),
|
|
85
|
-
default: default&.capitalize) do |menu|
|
|
86
|
-
menu.choice :Quit, -> { exit }
|
|
87
|
-
end.downcase
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def ask_target_framework(detected)
|
|
91
|
-
default = TEST_FRAMEWORKS.include?(detected) ? detected : nil
|
|
92
|
-
@prompt.select('Select target test framework:', TEST_FRAMEWORKS.map(&:capitalize),
|
|
93
|
-
default: default&.capitalize) do |menu|
|
|
94
|
-
menu.choice :Quit, -> { exit }
|
|
95
|
-
end.downcase
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def ask_output_path
|
|
99
|
-
@prompt.ask('Enter the output path for the new Raider project:') do |q|
|
|
100
|
-
q.required true
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
def ask_ci_platform(detected)
|
|
105
|
-
choices = [{ name: 'Github Actions', value: 'github' },
|
|
106
|
-
{ name: 'Gitlab CI/CD', value: 'gitlab' },
|
|
107
|
-
{ name: 'No CI', value: nil }]
|
|
108
|
-
default = case detected
|
|
109
|
-
when 'github' then 'Github Actions'
|
|
110
|
-
when 'gitlab' then 'Gitlab CI/CD'
|
|
111
|
-
end
|
|
112
|
-
@prompt.select('Configure CI/CD?', choices, default:)
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
def execute_adoption(params)
|
|
116
|
-
@prompt.say("\nAdopting project...")
|
|
117
|
-
result = self.class.adopt(params)
|
|
118
|
-
print_results(result[:plan], result[:results])
|
|
119
|
-
rescue MobileProjectError => e
|
|
120
|
-
@prompt.error(e.message)
|
|
121
|
-
rescue StandardError => e
|
|
122
|
-
@prompt.error("Adoption failed: #{e.message}")
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
def print_results(plan, results)
|
|
126
|
-
@prompt.say("\nAdoption complete!")
|
|
127
|
-
@prompt.say(" Pages converted: #{results[:pages]}")
|
|
128
|
-
@prompt.say(" Tests converted: #{results[:tests]}")
|
|
129
|
-
@prompt.say(" Features copied: #{results[:features]}")
|
|
130
|
-
@prompt.say(" Steps converted: #{results[:steps]}")
|
|
131
|
-
|
|
132
|
-
unless results[:errors].empty?
|
|
133
|
-
@prompt.warn("\nErrors:")
|
|
134
|
-
results[:errors].each { |e| @prompt.warn(" - #{e}") }
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
unless plan.warnings.empty?
|
|
138
|
-
@prompt.warn("\nWarnings:")
|
|
139
|
-
plan.warnings.each { |w| @prompt.warn(" - #{w}") }
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
@prompt.say("\nOutput: #{plan.output_path}")
|
|
143
|
-
@prompt.say("Run: cd #{plan.output_path} && bundle install")
|
|
144
|
-
end
|
|
145
|
-
end
|
|
146
|
-
end
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Adopter
|
|
4
|
-
module Converters
|
|
5
|
-
class BaseConverter
|
|
6
|
-
RAIDER_BASE_CLASSES = %w[Page BasePage AbstractPage].freeze
|
|
7
|
-
|
|
8
|
-
def convert_page(content, _page_info)
|
|
9
|
-
content
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def convert_test(content, _test_info)
|
|
13
|
-
content
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
private
|
|
17
|
-
|
|
18
|
-
def ensure_frozen_string_literal(content)
|
|
19
|
-
return content if content.include?('frozen_string_literal')
|
|
20
|
-
|
|
21
|
-
"# frozen_string_literal: true\n\n#{content}"
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def update_base_class(content, target_base = 'Page')
|
|
25
|
-
content.gsub(/class\s+(\w+)\s*<\s*([\w:]+)/) do
|
|
26
|
-
class_name = ::Regexp.last_match(1)
|
|
27
|
-
current_base = ::Regexp.last_match(2)
|
|
28
|
-
if raider_compatible_base?(current_base)
|
|
29
|
-
"class #{class_name} < #{target_base}"
|
|
30
|
-
else
|
|
31
|
-
"class #{class_name} < #{current_base}"
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def raider_compatible_base?(base_class)
|
|
37
|
-
RAIDER_BASE_CLASSES.include?(base_class) || base_class.include?('Page')
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def update_require_paths(content, target_automation)
|
|
41
|
-
result = content.dup
|
|
42
|
-
result = update_page_requires(result)
|
|
43
|
-
update_helper_requires(result, target_automation)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def update_page_requires(content)
|
|
47
|
-
content.gsub(%r{require_relative\s+['"]\.*/(?:pages?|page_objects)/(\w+)['"]}) do
|
|
48
|
-
page_name = ::Regexp.last_match(1)
|
|
49
|
-
"require_relative '../page_objects/pages/#{page_name}'"
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def update_helper_requires(content, target_automation)
|
|
54
|
-
case target_automation
|
|
55
|
-
when 'capybara'
|
|
56
|
-
content.gsub(%r{require_relative\s+['"]\.*/(?:helpers?|support)/(?:driver|browser)_?\w*['"]},
|
|
57
|
-
"require_relative '../helpers/capybara_helper'")
|
|
58
|
-
when 'watir'
|
|
59
|
-
content.gsub(%r{require_relative\s+['"]\.*/(?:helpers?|support)/(?:driver|capybara)_?\w*['"]},
|
|
60
|
-
"require_relative '../helpers/browser_helper'")
|
|
61
|
-
else
|
|
62
|
-
content.gsub(%r{require_relative\s+['"]\.*/(?:helpers?|support)/(?:browser|capybara)_?\w*['"]},
|
|
63
|
-
"require_relative '../helpers/driver_helper'")
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def remove_driver_arg(content)
|
|
68
|
-
content.gsub(/(\w+)\.new\(\s*(?:driver|browser|page)\s*\)/, '\1.new')
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def swap_driver_arg(content, target_arg)
|
|
72
|
-
content.gsub(/(\w+)\.new\(\s*(?:driver|browser|page)\s*\)/, "\\1.new(#{target_arg})")
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def driver_arg_for(target_automation)
|
|
76
|
-
case target_automation
|
|
77
|
-
when 'watir' then 'browser'
|
|
78
|
-
when 'capybara' then nil
|
|
79
|
-
else 'driver'
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
end
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative 'base_converter'
|
|
4
|
-
|
|
5
|
-
module Adopter
|
|
6
|
-
module Converters
|
|
7
|
-
class IdentityConverter < BaseConverter
|
|
8
|
-
def initialize(target_automation)
|
|
9
|
-
super()
|
|
10
|
-
@target_automation = target_automation
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def convert_page(content, _page_info)
|
|
14
|
-
result = content.dup
|
|
15
|
-
result = ensure_frozen_string_literal(result)
|
|
16
|
-
result = update_base_class(result)
|
|
17
|
-
result = add_page_require(result)
|
|
18
|
-
update_page_instantiation(result)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def convert_test(content, _test_info)
|
|
22
|
-
result = content.dup
|
|
23
|
-
result = ensure_frozen_string_literal(result)
|
|
24
|
-
result = update_require_paths(result, @target_automation)
|
|
25
|
-
update_page_instantiation(result)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def convert_step(content)
|
|
29
|
-
result = content.dup
|
|
30
|
-
result = ensure_frozen_string_literal(result)
|
|
31
|
-
result = update_require_paths(result, @target_automation)
|
|
32
|
-
update_page_instantiation(result)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
private
|
|
36
|
-
|
|
37
|
-
def add_page_require(content)
|
|
38
|
-
return content if content.include?("require_relative '../abstract/page'")
|
|
39
|
-
|
|
40
|
-
content.sub(/^(class\s)/, "require_relative '../abstract/page'\n\n\\1")
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def update_page_instantiation(content)
|
|
44
|
-
arg = driver_arg_for(@target_automation)
|
|
45
|
-
if arg
|
|
46
|
-
swap_driver_arg(content, arg)
|
|
47
|
-
else
|
|
48
|
-
remove_driver_arg(content)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Adopter
|
|
4
|
-
class MigrationPlan
|
|
5
|
-
attr_reader :source_path, :output_path, :target_automation, :target_framework,
|
|
6
|
-
:ci_platform, :skeleton_structure, :converted_pages, :converted_tests,
|
|
7
|
-
:converted_features, :converted_steps, :gemfile_additions,
|
|
8
|
-
:config_overrides, :warnings, :manual_actions
|
|
9
|
-
|
|
10
|
-
def initialize(attrs = {})
|
|
11
|
-
@source_path = attrs[:source_path]
|
|
12
|
-
@output_path = attrs[:output_path]
|
|
13
|
-
@target_automation = attrs[:target_automation]
|
|
14
|
-
@target_framework = attrs[:target_framework]
|
|
15
|
-
@ci_platform = attrs[:ci_platform]
|
|
16
|
-
@skeleton_structure = attrs[:skeleton_structure] || {}
|
|
17
|
-
@converted_pages = attrs[:converted_pages] || []
|
|
18
|
-
@converted_tests = attrs[:converted_tests] || []
|
|
19
|
-
@converted_features = attrs[:converted_features] || []
|
|
20
|
-
@converted_steps = attrs[:converted_steps] || []
|
|
21
|
-
@gemfile_additions = attrs[:gemfile_additions] || []
|
|
22
|
-
@config_overrides = attrs[:config_overrides] || {}
|
|
23
|
-
@warnings = attrs[:warnings] || []
|
|
24
|
-
@manual_actions = attrs[:manual_actions] || []
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def to_h
|
|
28
|
-
{
|
|
29
|
-
source_path:,
|
|
30
|
-
output_path:,
|
|
31
|
-
target_automation:,
|
|
32
|
-
target_framework:,
|
|
33
|
-
ci_platform:,
|
|
34
|
-
skeleton_structure:,
|
|
35
|
-
converted_pages: converted_pages.map(&:to_h),
|
|
36
|
-
converted_tests: converted_tests.map(&:to_h),
|
|
37
|
-
converted_features: converted_features.map(&:to_h),
|
|
38
|
-
converted_steps: converted_steps.map(&:to_h),
|
|
39
|
-
gemfile_additions:,
|
|
40
|
-
config_overrides:,
|
|
41
|
-
warnings:,
|
|
42
|
-
manual_actions:
|
|
43
|
-
}
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def to_json(*args)
|
|
47
|
-
require 'json'
|
|
48
|
-
to_h.to_json(*args)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def summary
|
|
52
|
-
{
|
|
53
|
-
pages: converted_pages.length,
|
|
54
|
-
tests: converted_tests.length,
|
|
55
|
-
features: converted_features.length,
|
|
56
|
-
steps: converted_steps.length,
|
|
57
|
-
custom_gems: gemfile_additions.length,
|
|
58
|
-
warnings: warnings.length,
|
|
59
|
-
manual_actions: manual_actions.length
|
|
60
|
-
}
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
ConvertedFile = Struct.new(:output_path, :content, :source_file, :conversion_notes, keyword_init: true) do
|
|
65
|
-
def to_h
|
|
66
|
-
{
|
|
67
|
-
output_path:,
|
|
68
|
-
content:,
|
|
69
|
-
source_file:,
|
|
70
|
-
conversion_notes:
|
|
71
|
-
}
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
end
|
data/lib/adopter/migrator.rb
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'fileutils'
|
|
4
|
-
require 'yaml'
|
|
5
|
-
require_relative '../generators/invoke_generators'
|
|
6
|
-
|
|
7
|
-
module Adopter
|
|
8
|
-
class Migrator
|
|
9
|
-
attr_reader :plan, :results
|
|
10
|
-
|
|
11
|
-
def initialize(plan)
|
|
12
|
-
@plan = plan
|
|
13
|
-
@results = { pages: 0, tests: 0, features: 0, steps: 0, errors: [] }
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def execute
|
|
17
|
-
generate_skeleton
|
|
18
|
-
write_converted_pages
|
|
19
|
-
write_converted_tests
|
|
20
|
-
write_converted_features
|
|
21
|
-
write_converted_steps
|
|
22
|
-
merge_gemfile
|
|
23
|
-
apply_config_overrides
|
|
24
|
-
results
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
private
|
|
28
|
-
|
|
29
|
-
# Phase A: Generate a standard Raider project skeleton
|
|
30
|
-
def generate_skeleton
|
|
31
|
-
InvokeGenerators.generate_framework(plan.skeleton_structure)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# Phase B: Overlay converted user files on top of the skeleton
|
|
35
|
-
|
|
36
|
-
def write_converted_pages
|
|
37
|
-
plan.converted_pages.each do |file|
|
|
38
|
-
write_file(file)
|
|
39
|
-
@results[:pages] += 1
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def write_converted_tests
|
|
44
|
-
plan.converted_tests.each do |file|
|
|
45
|
-
write_file(file)
|
|
46
|
-
@results[:tests] += 1
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def write_converted_features
|
|
51
|
-
plan.converted_features.each do |file|
|
|
52
|
-
write_file(file)
|
|
53
|
-
@results[:features] += 1
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def write_converted_steps
|
|
58
|
-
plan.converted_steps.each do |file|
|
|
59
|
-
write_file(file)
|
|
60
|
-
@results[:steps] += 1
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def write_file(converted_file)
|
|
65
|
-
FileUtils.mkdir_p(File.dirname(converted_file.output_path))
|
|
66
|
-
File.write(converted_file.output_path, converted_file.content)
|
|
67
|
-
rescue StandardError => e
|
|
68
|
-
@results[:errors] << "Failed to write #{converted_file.output_path}: #{e.message}"
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def merge_gemfile
|
|
72
|
-
return if plan.gemfile_additions.empty?
|
|
73
|
-
|
|
74
|
-
gemfile_path = "#{plan.output_path}/Gemfile"
|
|
75
|
-
return unless File.exist?(gemfile_path)
|
|
76
|
-
|
|
77
|
-
content = File.read(gemfile_path)
|
|
78
|
-
additions = plan.gemfile_additions.reject { |gem| content.include?("'#{gem}'") }
|
|
79
|
-
return if additions.empty?
|
|
80
|
-
|
|
81
|
-
gem_lines = additions.map { |gem| "gem '#{gem}'" }.join("\n")
|
|
82
|
-
File.write(gemfile_path, "#{content}\n# Gems from source project\n#{gem_lines}\n")
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
def apply_config_overrides
|
|
86
|
-
return if plan.config_overrides.empty?
|
|
87
|
-
|
|
88
|
-
config_path = "#{plan.output_path}/config/config.yml"
|
|
89
|
-
return unless File.exist?(config_path)
|
|
90
|
-
|
|
91
|
-
config = YAML.safe_load(File.read(config_path), permitted_classes: [Symbol]) || {}
|
|
92
|
-
plan.config_overrides.each { |key, value| config[key.to_s] = value }
|
|
93
|
-
File.write(config_path, YAML.dump(config))
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
end
|