Skip to content

Commit 2d87544

Browse files
(PUP-11767) Enable Style/DocumentDynamicEvalDefinition
1 parent d0d5d6c commit 2d87544

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,6 @@ Style/DefWithParentheses:
235235

236236
Style/Dir:
237237
Enabled: true
238+
239+
Style/DocumentDynamicEvalDefinition:
240+
Enabled: true

lib/puppet/interface/documentation.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ def attr_doc(name, &validate)
3434
# without as methods. When we are 1.9 only (hah!) you can totally
3535
# replace this with some up-and-up define_method. --daniel 2011-04-29
3636
module_eval(<<-EOT, __FILE__, __LINE__ + 1)
37-
def #{name}(value = nil)
38-
self.#{name} = value unless value.nil?
39-
@#{name}
40-
end
41-
42-
def #{name}=(value)
43-
@#{name} = Puppet::Interface::DocGen.strip_whitespace(#{get_arg})
44-
end
37+
def #{name}(value = nil) # def attribute(value=nil)
38+
self.#{name} = value unless value.nil? # self.attribute = value unless value.nil?
39+
@#{name} # @value
40+
end # end
41+
42+
def #{name}=(value) # def attribute=(value)
43+
@#{name} = Puppet::Interface::DocGen.strip_whitespace(#{get_arg}) # @value = Puppet::Interface::DocGen.strip_whitespace(#{get_arg})
44+
end # end
4545
EOT
4646
end
4747
end

0 commit comments

Comments
 (0)