|
3 | 3 | require 'fileutils' |
4 | 4 | require 'cucumber/configuration' |
5 | 5 | require 'cucumber/create_meta' |
| 6 | +require 'cucumber/deprecate' |
6 | 7 | require 'cucumber/load_path' |
7 | 8 | require 'cucumber/formatter/duration' |
8 | 9 | require 'cucumber/file_specs' |
9 | 10 | require 'cucumber/filters' |
10 | 11 | require 'cucumber/formatter/fanout' |
11 | 12 | require 'cucumber/gherkin/i18n' |
| 13 | +require 'cucumber/glue/registry_wrapper' |
12 | 14 | require 'cucumber/step_match_search' |
13 | 15 | require 'cucumber/messages' |
14 | 16 | require 'sys/uname' |
@@ -70,8 +72,9 @@ def run! |
70 | 72 | ) |
71 | 73 |
|
72 | 74 | load_step_definitions |
73 | | - install_wire_plugin |
74 | 75 | fire_after_configuration_hook |
| 76 | + fire_install_plugin_hook |
| 77 | + install_wire_plugin |
75 | 78 | # TODO: can we remove this state? |
76 | 79 | self.visitor = report |
77 | 80 |
|
@@ -112,6 +115,10 @@ def fire_after_configuration_hook #:nodoc: |
112 | 115 | @support_code.fire_hook(:after_configuration, @configuration) |
113 | 116 | end |
114 | 117 |
|
| 118 | + def fire_install_plugin_hook #:nodoc: |
| 119 | + @support_code.fire_hook(:install_plugin, @configuration, registry_wrapper) |
| 120 | + end |
| 121 | + |
115 | 122 | require 'cucumber/core/gherkin/document' |
116 | 123 | def features |
117 | 124 | @features ||= feature_files.map do |path| |
@@ -261,7 +268,19 @@ def load_step_definitions |
261 | 268 | end |
262 | 269 |
|
263 | 270 | def install_wire_plugin |
264 | | - Cucumber::Wire::Plugin.new(@configuration, @support_code.registry).install if @configuration.all_files_to_load.any? { |f| f =~ /\.wire$/ } |
| 271 | + return if Cucumber::Wire::Plugin.installed? |
| 272 | + return unless @configuration.all_files_to_load.any? { |f| f =~ /\.wire$/ } |
| 273 | + |
| 274 | + Cucumber::Wire::Plugin.new(@configuration, registry_wrapper).install |
| 275 | + Cucumber.deprecate( |
| 276 | + 'See https://github.com/cucumber/cucumber-ruby/blob/main/UPGRADING.md#upgrading-to-710 for more info', |
| 277 | + ' built-in usage of the wire protocol', |
| 278 | + '8.0.0' |
| 279 | + ) |
| 280 | + end |
| 281 | + |
| 282 | + def registry_wrapper |
| 283 | + Cucumber::Glue::RegistryWrapper.new(@support_code.registry) |
265 | 284 | end |
266 | 285 |
|
267 | 286 | def log |
|
0 commit comments