macros4cuke 0.5.12 → 0.5.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTdmM2JkNWVlNGNjNjQ3YjkwYmY1N2FiNzJhYTcwY2YzMGZlYmMwMw==
4
+ NTA0YjNkNDg5MzFmMTVhZmZlYTg4MWQ2OGUxNTg5OWJlZGY5NzI5MA==
5
5
  data.tar.gz: !binary |-
6
- MTQ0NWZmYjgyY2VjMzhmMjFjMjExN2MwYWVkNzVmNmUyYzg4YjBkYg==
6
+ OTdiOGVjOTFmZmVjODk2YzlmNjVjZmNkMzU0MWIxNDA5ZTEzNDgwYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzE2MjZiOGM5ZjczZjFjNDc1Mjc4MGQ3YmEyMGM2MzE2YTIwYTI5NTg3MmFj
10
- ZDJhNTU3NTk1ODc5ZTQyNWRmM2U1NjBiNjJiMzhmNTI2NDUxMWJkNWQyOWYz
11
- MWQwNzg1ZGVhN2RiMmRmZTZmMzNlOTM2Yzg1NGY1NmRhMjcyMGE=
9
+ NTYxZDc5NzFkYmMzNDJlYmQwODdkNmIwMjUxZWJkMTZmYzgzODZiNWNkOTRk
10
+ YjUxMWQ3ZTg0YzI2NzEzNWNlNTc5MTkxNTE2YjYyY2NkMjAxNTI4OGQ2OGI0
11
+ Yjk5ZTJmNmM3OWVlNzJjMjkzODQ1YzFlNDA0MzRhMTdiMTYwOWU=
12
12
  data.tar.gz: !binary |-
13
- NGU5YmJmZTQ0YjUwMzMxNmE4NGI5ZmNhMmEyZjNkN2ExMjZlODIxOWMyYWI0
14
- N2U1YTM5OWFjOTAzN2Y2MWVmNTUzMTQxNTAzY2Y4YjY1Yzk2MDYzY2I2NWM3
15
- MmFkMDJiMDRjZDUyOTVkZDhlYjJhZmVkNzI4OTMzMDZmMDA4Y2I=
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
- Enabled: true
11
-
12
- # This is disabled because some demos use UTF-8
13
- AsciiComments:
14
- Enabled: false
15
-
16
- CaseIndentation:
17
- IndentWhenRelativeTo: end
18
- IndentOneStep: true
19
-
20
- # Rubocop enforces the use of is_a? instead of kind_of?
21
- # Which is contrary to modelling practice.
22
- ClassCheck:
23
- Enabled: false
24
-
25
- ClassLength:
26
- Max: 250
27
- CountComments: false
28
-
29
- ConstantName:
30
- Enabled: false
31
-
32
- CyclomaticComplexity:
33
- Enabled: false
34
-
35
- DefWithParentheses:
36
- Enabled: false
37
-
38
- Documentation:
39
- Enabled: false
40
-
41
- EmptyLines:
42
- Enabled: false
43
-
44
- Encoding:
45
- Enabled: false
46
-
47
- FileName:
48
- Enabled: false
49
-
50
- IndentationWidth :
51
- Enabled: false
52
-
53
-
54
- # Avoid methods longer than 50 lines of code
55
- MethodLength:
56
- Max: 50
57
- CountComments: false
58
-
59
- NonNilCheck:
60
- Enabled: false
61
-
62
- NumericLiterals:
63
- Enabled: false
64
-
65
- PerceivedComplexity:
66
- Max: 10
67
-
68
- RaiseArgs:
69
- Enabled: false
70
-
71
- RedundantReturn:
72
- Enabled: false
73
-
74
- SpaceInsideBrackets:
75
- Enabled: false
76
-
77
- TrailingWhitespace:
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(/^I\sdefine\sthe\sstep\s" # Fixed part of defining step
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:$/x) do |macro_phrase, colon_capture, template|
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 + aPath.to_s + '/' + file_name + '.rb'
43
+ destination = prefix + aPath.to_s + '/' + file_name + '.rb'
44
44
 
45
45
  begin
46
46
  fail SupportFileExists.new(destination) if File.exist?(destination)
@@ -78,7 +78,7 @@ class CollWalkerFactory
78
78
 
79
79
  # Add children elements to the visit backlog
80
80
  def add_children(anEnumerable, theBacklog)
81
- anEnumerable.reverse.each do |elem|
81
+ anEnumerable.reverse_each do |elem|
82
82
  theBacklog.unshift(elem)
83
83
  end
84
84
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Macros4Cuke # Module used as a namespace
5
5
  # The version number of the gem.
6
- Version = '0.5.12'
6
+ Version = '0.5.13'
7
7
 
8
8
  # Brief description of the gem.
9
9
  Description = 'Add your own macro-steps to Cucumber scenarios'
@@ -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? || supported_events.empty?
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 < UnaryElement
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(/<\/address>/, '')
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(/<\/address>/, '</foobar>')
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.12
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-04-02 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber