cucumber-cucumber-expressions 8.3.1 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d75b7265f9a2c2142d7733b064bb4e6ec6d317d1f32ba9e4148e42512b90a4df
4
- data.tar.gz: c7f8fa3ce1e9eccaf40fcbfd9288ed8302ea1b13b2cb8aa385a64abaf94a2d15
3
+ metadata.gz: 50f04f03031779e787930c81c808d37f1187cc5eeed2e6913b8855d982a3213a
4
+ data.tar.gz: f907efdb6c7750b8a3e32efda1abd99e4353e368b9794ddeca9241ccaf647047
5
5
  SHA512:
6
- metadata.gz: a05e6facfd23519c59b261e253a623097c892108a9b66d3fd330128b9651be4923f01b16666cf61c82abc112c6b5fcee987703b0c4198462148b6a174b51ba24
7
- data.tar.gz: '09a81cd8ef765626765d0f269063c284266cf2153d3b80c4cdeacb464aeea41b4df9967ba256a3f8a27bd06f89c2f650cffffc903e4d5206504e05ff1daa2e50'
6
+ metadata.gz: f72b64fdca5fcfbc472128a074b7c72a5d54fbe48bba746dff1bd07f65427207bb85a933465336edeca68334bbce3994663a1ba2c4c241cdc898d0c40de61380
7
+ data.tar.gz: 48f73da5f1a77c0c8b754ccc8d235b5622f02ee18a926be5f372b58d79a7cb8a0e3c45c202e3e56b3146279c3799eb947c95958bb853ab7f682765ccabf5314e
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'cucumber-cucumber-expressions'
4
- s.version = '8.3.1'
4
+ s.version = '9.0.0'
5
5
  s.authors = ["Aslak Hellesøy"]
6
6
  s.description = 'Cucumber Expressions - a simpler alternative to Regular Expressions'
7
7
  s.summary = "cucumber-expressions-#{s.version}"
data/default.mk CHANGED
@@ -32,11 +32,16 @@ endif
32
32
  endif
33
33
  .PHONY: gem
34
34
 
35
- $(GEM): clean .tested
35
+ $(GEM): .tested
36
36
  gem build $(GEMSPEC)
37
37
  test -s "$(GEM)" || { echo "Gem not built: $(GEM)"; exit 1; }
38
38
 
39
- pre-release: update-version update-dependencies gem
39
+ remove-local-dependencies:
40
+ cat Gemfile | sed 's/^gem /#gem /' > Gemfile.tmp
41
+ mv Gemfile.tmp Gemfile
42
+ .PHONY: remove-local-dependencies
43
+
44
+ pre-release: remove-local-dependencies update-version update-dependencies gem
40
45
  .PHONY: pre-release
41
46
 
42
47
  update-version:
@@ -59,7 +64,8 @@ endif
59
64
  .PHONY: publish
60
65
 
61
66
  post-release:
62
- @echo "No post-release needed for ruby"
67
+ cat Gemfile | sed 's/^#gem /gem /' > Gemfile.tmp
68
+ mv Gemfile.tmp Gemfile
63
69
  .PHONY: post-release
64
70
 
65
71
  clean: clean-ruby
@@ -0,0 +1,22 @@
1
+ require 'cucumber/cucumber_expressions/errors'
2
+ require 'cucumber/cucumber_expressions/cucumber_expression'
3
+ require 'cucumber/cucumber_expressions/regular_expression'
4
+
5
+ module Cucumber
6
+ module CucumberExpressions
7
+ class ExpressionFactory
8
+ def initialize(parameter_type_registry)
9
+ @parameter_type_registry = parameter_type_registry
10
+ end
11
+
12
+ def create_expression(string_or_regexp)
13
+ case string_or_regexp
14
+ when String then CucumberExpression.new(string_or_regexp, @parameter_type_registry)
15
+ when Regexp then RegularExpression.new(string_or_regexp, @parameter_type_registry)
16
+ else
17
+ raise CucumberExpressionError.new("Can't create an expression from #{string_or_regexp.inspect}")
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ require 'cucumber/cucumber_expressions/expression_factory'
2
+
3
+ module Cucumber
4
+ module CucumberExpressions
5
+ describe ExpressionFactory do
6
+ before do
7
+ @expression_factory = ExpressionFactory.new(ParameterTypeRegistry.new)
8
+ end
9
+
10
+ it 'creates a RegularExpression' do
11
+ expect(@expression_factory.create_expression(/x/).class).to eq(RegularExpression)
12
+ end
13
+
14
+ it 'creates a CucumberExpression' do
15
+ expect(@expression_factory.create_expression('{int}').class).to eq(CucumberExpression)
16
+ end
17
+
18
+ it 'creates a XXXRegularExpression' do
19
+ expect {@expression_factory.create_expression('hello {x}')}.to raise_error("Undefined parameter type {x}")
20
+ end
21
+ end
22
+ end
23
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-cucumber-expressions
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.3.1
4
+ version: 9.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-10 00:00:00.000000000 Z
11
+ date: 2020-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -94,6 +94,7 @@ files:
94
94
  - lib/cucumber/cucumber_expressions/cucumber_expression.rb
95
95
  - lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb
96
96
  - lib/cucumber/cucumber_expressions/errors.rb
97
+ - lib/cucumber/cucumber_expressions/expression_factory.rb
97
98
  - lib/cucumber/cucumber_expressions/generated_expression.rb
98
99
  - lib/cucumber/cucumber_expressions/group.rb
99
100
  - lib/cucumber/cucumber_expressions/group_builder.rb
@@ -112,6 +113,7 @@ files:
112
113
  - spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb
113
114
  - spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb
114
115
  - spec/cucumber/cucumber_expressions/expression_examples_spec.rb
116
+ - spec/cucumber/cucumber_expressions/expression_factory_spec.rb
115
117
  - spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb
116
118
  - spec/cucumber/cucumber_expressions/parameter_type_spec.rb
117
119
  - spec/cucumber/cucumber_expressions/regular_expression_spec.rb
@@ -145,7 +147,7 @@ rubyforge_project:
145
147
  rubygems_version: 2.7.6.2
146
148
  signing_key:
147
149
  specification_version: 4
148
- summary: cucumber-expressions-8.3.1
150
+ summary: cucumber-expressions-9.0.0
149
151
  test_files:
150
152
  - spec/capture_warnings.rb
151
153
  - spec/coverage.rb
@@ -156,6 +158,7 @@ test_files:
156
158
  - spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb
157
159
  - spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb
158
160
  - spec/cucumber/cucumber_expressions/expression_examples_spec.rb
161
+ - spec/cucumber/cucumber_expressions/expression_factory_spec.rb
159
162
  - spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb
160
163
  - spec/cucumber/cucumber_expressions/parameter_type_spec.rb
161
164
  - spec/cucumber/cucumber_expressions/regular_expression_spec.rb