macros4cuke 0.5.12 → 0.5.13
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 +8 -8
- data/.rubocop.yml +94 -79
- data/CHANGELOG.md +4 -0
- data/lib/macro_steps.rb +2 -2
- data/lib/macros4cuke/application.rb +1 -1
- data/lib/macros4cuke/coll-walker-factory.rb +1 -1
- data/lib/macros4cuke/constants.rb +1 -1
- data/lib/macros4cuke/formatting-service.rb +1 -1
- data/lib/macros4cuke/templating/engine.rb +1 -1
- data/lib/macros4cuke/templating/section.rb +1 -1
- data/spec/macros4cuke/templating/engine_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTA0YjNkNDg5MzFmMTVhZmZlYTg4MWQ2OGUxNTg5OWJlZGY5NzI5MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTdiOGVjOTFmZmVjODk2YzlmNjVjZmNkMzU0MWIxNDA5ZTEzNDgwYw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTYxZDc5NzFkYmMzNDJlYmQwODdkNmIwMjUxZWJkMTZmYzgzODZiNWNkOTRk
|
10
|
+
YjUxMWQ3ZTg0YzI2NzEzNWNlNTc5MTkxNTE2YjYyY2NkMjAxNTI4OGQ2OGI0
|
11
|
+
Yjk5ZTJmNmM3OWVlNzJjMjkzODQ1YzFlNDA0MzRhMTdiMTYwOWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmU5Njk5YmY2OWUwMTQ1ZmI3MTdlYzFmNTQyYTQ1M2ZmMDZlNDU1YWU4MDNm
|
14
|
+
ZmU0MTdlYjEyYzJkNjBjNDNjNjI5ZGYzNTA5YTg4NTdmNDA5MDY1YzJmNGM1
|
15
|
+
ODU4ZjBkYjIzNTE1MTBhNDFjNGMwZDhlMmQ0MzE4ODI1ZWY0Yzk=
|
data/.rubocop.yml
CHANGED
@@ -1,79 +1,94 @@
|
|
1
|
-
AllCops:
|
2
|
-
Exclude:
|
3
|
-
- 'examples/**/*'
|
4
|
-
- 'features/**/*'
|
5
|
-
- 'gems/**/*'
|
6
|
-
- 'lab/**/*'
|
7
|
-
|
8
|
-
AbcSize:
|
9
|
-
Max: 45
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
Max:
|
67
|
-
|
68
|
-
|
69
|
-
Enabled: false
|
70
|
-
|
71
|
-
|
72
|
-
Enabled: false
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
Enabled: false
|
79
|
-
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- 'examples/**/*'
|
4
|
+
- 'features/**/*'
|
5
|
+
- 'gems/**/*'
|
6
|
+
- 'lab/**/*'
|
7
|
+
|
8
|
+
AbcSize:
|
9
|
+
Max: 45
|
10
|
+
|
11
|
+
# This is disabled because some demos use UTF-8
|
12
|
+
AsciiComments:
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Attr:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
BlockComments:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
CaseIndentation:
|
22
|
+
IndentWhenRelativeTo: end
|
23
|
+
IndentOneStep: true
|
24
|
+
|
25
|
+
# Rubocop enforces the use of is_a? instead of kind_of?
|
26
|
+
# Which is contrary to modelling practice.
|
27
|
+
ClassCheck:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
ClassLength:
|
31
|
+
Max: 250
|
32
|
+
CountComments: false
|
33
|
+
|
34
|
+
ConstantName:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
CyclomaticComplexity:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
DefWithParentheses:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
Documentation:
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
EmptyLines:
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
Encoding:
|
50
|
+
Enabled: false
|
51
|
+
|
52
|
+
FileName:
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
IndentationWidth :
|
56
|
+
Enabled: false
|
57
|
+
|
58
|
+
|
59
|
+
# Avoid methods longer than 50 lines of code
|
60
|
+
MethodLength:
|
61
|
+
Max: 50
|
62
|
+
CountComments: false
|
63
|
+
|
64
|
+
# Avoid modules longer than 500 lines of code
|
65
|
+
ModuleLength:
|
66
|
+
Max: 500
|
67
|
+
|
68
|
+
NonNilCheck:
|
69
|
+
Enabled: false
|
70
|
+
|
71
|
+
NumericLiterals:
|
72
|
+
Enabled: false
|
73
|
+
|
74
|
+
PerceivedComplexity:
|
75
|
+
Max: 10
|
76
|
+
|
77
|
+
RaiseArgs:
|
78
|
+
Enabled: false
|
79
|
+
|
80
|
+
RedundantReturn:
|
81
|
+
Enabled: false
|
82
|
+
|
83
|
+
RegexpLiteral:
|
84
|
+
EnforcedStyle: mixed
|
85
|
+
AllowInnerSlashes: false
|
86
|
+
|
87
|
+
SpaceInsideBrackets:
|
88
|
+
Enabled: false
|
89
|
+
|
90
|
+
TrailingWhitespace:
|
91
|
+
Enabled: false
|
92
|
+
|
93
|
+
VariableName:
|
94
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
### 0.5.13 / 2015-06-19
|
2
|
+
* [CHANGE] Code re-formatted to please Rubocop 0.32.0
|
3
|
+
* [FIX] File `.rubocop.yml`: disable some cop settings that were too loud.
|
4
|
+
|
1
5
|
### 0.5.12 / 2015-04-02
|
2
6
|
* [FIX] File `.travis.yml`: Removed MRI Ruby 1.9.2 since it is rejected by latest Cucumber version.
|
3
7
|
* [NEW] File `.travis.yml` Added support for Ruby 2.2.0
|
data/lib/macro_steps.rb
CHANGED
@@ -20,10 +20,10 @@ require_relative './macros4cuke/formatter/to-gherkin'
|
|
20
20
|
# The regexp has two capturing group: one for the phrase,
|
21
21
|
# a second for the terminating colon (:)
|
22
22
|
# The regular expression uses the /x option in order to split it in pieces
|
23
|
-
Given(
|
23
|
+
Given(%r{^I\sdefine\sthe\sstep\s" # Fixed part of defining step
|
24
24
|
(?:Given|When|Then|\*)\s # ... A keyword that starts the new step
|
25
25
|
I\s\[((?:[^\\\]]|\\.)+)\](:?) # ...I followed by text in square brackets
|
26
|
-
"\sto\smean
|
26
|
+
"\sto\smean:$}x) do |macro_phrase, colon_capture, template|
|
27
27
|
use_table = (colon_capture == ':')
|
28
28
|
add_macro(macro_phrase, template, use_table)
|
29
29
|
end
|
@@ -40,7 +40,7 @@ class Application
|
|
40
40
|
def setup_project(aPath)
|
41
41
|
file_name = 'use_macros4cuke'
|
42
42
|
prefix = aPath.relative? ? './' : ''
|
43
|
-
destination = prefix +
|
43
|
+
destination = prefix + aPath.to_s + '/' + file_name + '.rb'
|
44
44
|
|
45
45
|
begin
|
46
46
|
fail SupportFileExists.new(destination) if File.exist?(destination)
|
@@ -32,7 +32,7 @@ class FormattingService
|
|
32
32
|
supported_events = aFormatter.implements
|
33
33
|
|
34
34
|
# Complain if list is empty or nil
|
35
|
-
if supported_events.nil? ||
|
35
|
+
if supported_events.nil? || supported_events.empty?
|
36
36
|
fail(NoFormattingEventForFormatter.new(aFormatter))
|
37
37
|
end
|
38
38
|
|
@@ -249,7 +249,7 @@ class Engine
|
|
249
249
|
# @param aText [String] The text that is enclosed between chevrons.
|
250
250
|
def parse_tag(aText)
|
251
251
|
# Recognize the first character
|
252
|
-
if aText =~
|
252
|
+
if aText =~ %r{^[\?/]}
|
253
253
|
matching = DisallowedSigns.match(aText[1..-1])
|
254
254
|
else
|
255
255
|
# Disallow punctuation and delimiter signs in tags.
|
@@ -12,7 +12,7 @@ module Templating
|
|
12
12
|
# Represents a section in a template, that is,
|
13
13
|
# a set of template elements for which its rendition depends
|
14
14
|
# on the value of a variable.
|
15
|
-
class Section
|
15
|
+
class Section < UnaryElement
|
16
16
|
# The child elements of the section
|
17
17
|
attr_reader(:children)
|
18
18
|
|
@@ -218,7 +218,7 @@ SNIPPET
|
|
218
218
|
|
219
219
|
it 'should complain when a section has no closing tag' do
|
220
220
|
# Removing an end of section tag...
|
221
|
-
text_w_open_section = sophisticated_template.sub(
|
221
|
+
text_w_open_section = sophisticated_template.sub(%r{</address>}, '')
|
222
222
|
|
223
223
|
error_message = 'Unterminated section <?address>.'
|
224
224
|
expect { Engine.new text_w_open_section }.to raise_error(
|
@@ -227,7 +227,7 @@ SNIPPET
|
|
227
227
|
|
228
228
|
it 'should complain when a closing tag has no corresponding opening tag' do
|
229
229
|
# Replacing an end of section tag by another...
|
230
|
-
text_w_wrong_end = sophisticated_template.sub(
|
230
|
+
text_w_wrong_end = sophisticated_template.sub(%r{</address>}, '</foobar>')
|
231
231
|
|
232
232
|
msg = "End of section</foobar> doesn't match current section 'address'."
|
233
233
|
expect { Engine.new text_w_wrong_end }.to raise_error(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macros4cuke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Geshef
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|