Rubocop "fixes"

This commit is contained in:
Gene Liverman 2019-12-26 20:40:20 -05:00
parent e6528f7c93
commit 51b9a3a332
No known key found for this signature in database
GPG key ID: 66D794FE7043CBCA
12 changed files with 33 additions and 8 deletions

View file

@ -2,4 +2,7 @@ AllCops:
Exclude:
- 'vendor/**/*'
- 'spec/fixtures/**/*'
TargetRubyVersion: 2.0
TargetRubyVersion: 2.5
Style/CommentedKeyword:
Enabled: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rubocop/rake_task'
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'

2
Vagrantfile vendored
View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Vagrant.configure('2') do |config|
config.vm.box = 'genebean/centos-7-nocm'
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'open3'
require 'os'
require 'tty-command'

View file

@ -1,5 +1,8 @@
# frozen_string_literal: true
def existing_symlink(source, destination)
return if File.readlink(destination).eql?(source)
# rubocop:disable Metrics/LineLength
if @prompt.yes?("#{destination} currently points to #{File.readlink(destination)}, do you want point it at #{source}?")
File.unlink(destination)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
desc 'Run dots'
task :dots do
ruby 'bin/dots.rb'

View file

@ -1,4 +1,5 @@
# rubocop:disable Lint/UnneededDisable, Naming
# frozen_string_literal: true
forge 'http://forge.puppetlabs.com'
# rubocop:disable Metrics/LineLength

View file

@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
begin
require 'rugged'
rescue LoadError

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Facter.add(:os_release) do
confine kernel: 'Linux'
@ -7,12 +9,12 @@ Facter.add(:os_release) do
os_release_hash = {}
File.open(file_path, 'r') do |file|
file.each_line do |line|
unless line.nil? or line.strip.length.eql? 0
line_data = line.split('=')
key = line_data[0].downcase
value = line_data[1].strip.gsub(/(^\")|(\"$)/, '')
os_release_hash[key] = value
end
next if line.nil? || line.strip.length.eql?(0)
line_data = line.split('=')
key = line_data[0].downcase
value = line_data[1].strip.gsub(/(^\")|(\"$)/, '')
os_release_hash[key] = value
end
end
os_release_hash

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Puppet::Functions.create_function(:find_group) do
dispatch :find_group do
param 'String', :some_path

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Puppet::Functions.create_function(:find_owner) do
dispatch :find_owner do
param 'String', :some_path

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Puppet::Functions.create_function(:homedir_to_user) do
dispatch :homedir_to_user do
param 'String', :some_path