-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate usage of built-in cucumber wire protocol (#1564)
* Deprecate usage of built-in cucumber wire protocol * Update CHANGELOG * Make it work with future version of cucumber-ruby-wire * Add an UPGRADING.md document * Add a registry wrapper to avoid exposing RegistryAndMore * Add a new InstallPlugin hook That prevent changing the AfterConfiguration hook and allows to have a dedicated hook for external plugins.
- Loading branch information
1 parent
ee3d176
commit fbdc375
Showing
7 changed files
with
157 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Upgrading to 7.1.0 | ||
|
||
## The wire protocol | ||
|
||
Usage of built-in wire protocol with `cucumber-ruby` will be deprecated in cucumber | ||
7.1.0, and removed in cucumber 8.0.0. | ||
|
||
The wire protocol will still be available by explicitely using the `cucumber-wire` | ||
gem. | ||
|
||
### Before cucumber 7.1.0 | ||
|
||
Before cucumber 7.1.0, the wire protocol was automatically installed with cucumber, | ||
and automatically activated when it had detected a `.wire` file. | ||
|
||
### With cucumber 7.1.0 | ||
|
||
The wire protocol will work as before, but you will notice a deprecation message. | ||
|
||
To prevent the deprecation message to be shown, add the gem `cucumber-wire` to your | ||
Gemfile alongside the `cucumber` one, and install it: | ||
|
||
```ruby | ||
# Gemfile | ||
|
||
# ... | ||
|
||
gem "cucumber" | ||
gem "cucumber-wire" | ||
|
||
# ... | ||
|
||
``` | ||
```shell | ||
bundle install | ||
``` | ||
|
||
And add `require 'cucumber/wire'` in your support code. If you do not have support | ||
code yet, create a new one. For example `features/support/wire.rb`. | ||
|
||
```ruby | ||
# features/support/wire.rb | ||
require 'cucumber/wire' | ||
``` | ||
|
||
The wire protocol will be installed, and no deprecation message will be shown anymore. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
module Cucumber | ||
module Glue | ||
## | ||
# This class wraps some internals methods to expose them to external plugins. | ||
class RegistryWrapper | ||
def initialize(registry) | ||
@registry = registry | ||
end | ||
|
||
## | ||
# Creates a new CucumberExpression from the given +string_or_regexp+. | ||
# | ||
# If +string_or_regexp+ is a string, it will return a new CucumberExpression::CucumberExpression | ||
# | ||
# If +string_or_regexp+ is a regexp, it will return a new CucumberExpressions::RegularExpression | ||
# | ||
# An ArgumentError is raised if +string_or_regexp+ is not a string or a regexp | ||
def create_expression(string_or_regexp) | ||
@registry.create_expression(string_or_regexp) | ||
end | ||
|
||
## | ||
# Return the current execution environment - AKA an isntance of World | ||
def current_world | ||
@registry.current_world | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters