mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 09:27:44 -04:00
Rubocop "fixes"
This commit is contained in:
parent
e6528f7c93
commit
51b9a3a332
12 changed files with 33 additions and 8 deletions
|
|
@ -1,4 +1,5 @@
|
|||
# rubocop:disable Lint/UnneededDisable, Naming
|
||||
# frozen_string_literal: true
|
||||
|
||||
forge 'http://forge.puppetlabs.com'
|
||||
|
||||
# rubocop:disable Metrics/LineLength
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
begin
|
||||
require 'rugged'
|
||||
rescue LoadError
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Puppet::Functions.create_function(:find_group) do
|
||||
dispatch :find_group do
|
||||
param 'String', :some_path
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Puppet::Functions.create_function(:find_owner) do
|
||||
dispatch :find_owner do
|
||||
param 'String', :some_path
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue