Skip to content

Commit 5ec48b3

Browse files
committed
rubocop and old ruby
1 parent 67fb84a commit 5ec48b3

10 files changed

Lines changed: 27 additions & 34 deletions

File tree

lib/puppet-strings/markdown/puppet_class.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
module PuppetStrings::Markdown
44
class PuppetClass < Base
5-
def initialize(registry:,
6-
template: 'puppet_resource.erb')
7-
@template = template
5+
def initialize(registry)
6+
@template = 'puppet_resource.erb'
87
super(registry, 'class')
98
end
109

lib/puppet-strings/markdown/puppet_classes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def self.in_classes
99
def self.render
1010
final = "## Classes\n\n"
1111
in_classes.each do |klass|
12-
final << PuppetStrings::Markdown::PuppetClass.new(registry: klass).render
12+
final << PuppetStrings::Markdown::PuppetClass.new(klass).render
1313
end
1414
final
1515
end
@@ -18,7 +18,7 @@ def self.toc_info
1818
final = []
1919

2020
in_classes.each do |klass|
21-
final.push(PuppetStrings::Markdown::PuppetClass.new(registry: klass).toc_info)
21+
final.push(PuppetStrings::Markdown::PuppetClass.new(klass).toc_info)
2222
end
2323

2424
final

lib/puppet-strings/markdown/puppet_defined_type.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
module PuppetStrings::Markdown
44
class PuppetDefinedType < Base
5-
def initialize(registry:,
6-
template: 'puppet_resource.erb')
7-
@template = template
5+
def initialize(registry)
6+
@template = 'puppet_resource.erb'
87
super(registry, 'defined type')
98
end
109

lib/puppet-strings/markdown/puppet_defined_types.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def self.in_dtypes
99
def self.render
1010
final = "## Defined types\n\n"
1111
in_dtypes.each do |type|
12-
final << PuppetStrings::Markdown::PuppetDefinedType.new(registry: type).render
12+
final << PuppetStrings::Markdown::PuppetDefinedType.new(type).render
1313
end
1414
final
1515
end
@@ -18,7 +18,7 @@ def self.toc_info
1818
final = []
1919

2020
in_dtypes.each do |type|
21-
final.push(PuppetStrings::Markdown::PuppetDefinedType.new(registry: type).toc_info)
21+
final.push(PuppetStrings::Markdown::PuppetDefinedType.new(type).toc_info)
2222
end
2323

2424
final

lib/puppet-strings/markdown/puppet_function.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ module PuppetStrings::Markdown
44
class PuppetFunction < Base
55
attr_reader :signatures
66

7-
def initialize(registry:,
8-
template: 'puppet_function.erb')
9-
@template = template
7+
def initialize(registry)
8+
@template = 'puppet_function.erb'
109
super(registry, 'function')
1110
@signatures = []
1211
registry[:signatures].each do |sig|
13-
@signatures.push(Signature.new(registry: sig))
12+
@signatures.push(Signature.new(sig))
1413
end
1514
end
1615

@@ -20,8 +19,9 @@ def render
2019
end
2120

2221
class PuppetFunction::Signature < Base
23-
def initialize(registry:)
24-
super(registry, 'function signature')
22+
def initialize(registry)
23+
@registry = registry
24+
super(@registry, 'function signature')
2525
end
2626

2727
def signature

lib/puppet-strings/markdown/puppet_functions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def self.in_functions
99
def self.render
1010
final = "## Functions\n\n"
1111
in_functions.each do |func|
12-
final << PuppetStrings::Markdown::PuppetFunction.new(registry: func).render
12+
final << PuppetStrings::Markdown::PuppetFunction.new(func).render
1313
end
1414
final
1515
end
@@ -18,7 +18,7 @@ def self.toc_info
1818
final = []
1919

2020
in_functions.each do |func|
21-
final.push(PuppetStrings::Markdown::PuppetFunction.new(registry: func).toc_info)
21+
final.push(PuppetStrings::Markdown::PuppetFunction.new(func).toc_info)
2222
end
2323

2424
final

lib/puppet-strings/markdown/puppet_resource_type.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
module PuppetStrings::Markdown
44
class PuppetResourceType < Base
5-
def initialize(registry:,
6-
template: 'puppet_resource_type.erb')
7-
@template = template
5+
def initialize(registry)
6+
@template = 'puppet_resource_type.erb'
87
super(registry, 'resource type')
98
end
109

lib/puppet-strings/markdown/puppet_resource_types.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def self.in_rtypes
99
def self.render
1010
final = "## Resource types\n\n"
1111
in_rtypes.each do |type|
12-
final << PuppetStrings::Markdown::PuppetResourceType.new(registry: type).render
12+
final << PuppetStrings::Markdown::PuppetResourceType.new(type).render
1313
end
1414
final
1515
end
@@ -18,7 +18,7 @@ def self.toc_info
1818
final = []
1919

2020
in_rtypes.each do |type|
21-
final.push(PuppetStrings::Markdown::PuppetResourceType.new(registry: type).toc_info)
21+
final.push(PuppetStrings::Markdown::PuppetResourceType.new(type).toc_info)
2222
end
2323

2424
final

lib/puppet/face/strings.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,12 @@ def build_generate_options(options = nil, *yard_args)
101101
generate_options[:markup] = markup if markup
102102
generate_options[:path] = options[:out] if options[:out]
103103
generate_options[:stdout] = options[:stdout]
104-
case options[:format].downcase
105-
when 'markdown'
104+
format = options[:format] || ""
105+
if format.casecmp 'markdown'
106106
generate_options[:markdown] = true
107-
when 'json'
107+
elsif format.casecmp 'json'
108108
generate_options[:json] = true
109-
else
110-
end if options[:format]
109+
end
111110
generate_options[:path] = nil if options[:stdout]
112111
end
113112
generate_options

spec/unit/puppet-strings/markdown/base_spec.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class klass(Integer $param1, $param2, String $param3 = hi) inherits foo::bar {
2727
'see',
2828
'since',
2929
'return_val',
30-
'return_type',
31-
].each do |method|
30+
'return_type',].each do |method|
3231
describe "##{method}" do
3332
it 'returns nil' do
3433
expect(component.method(method.to_sym).call).to be_nil
@@ -91,13 +90,11 @@ class klass::yeah(
9190
end
9291
end
9392

94-
[
95-
'summary',
93+
['summary',
9694
'see',
9795
'since',
9896
'return_val',
99-
'return_type',
100-
].each do |method|
97+
'return_type'].each do |method|
10198
describe "##{method}" do
10299
it 'returns nil' do
103100
expect(component.method(method.to_sym).call).to be_nil

0 commit comments

Comments
 (0)