mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 01:17:42 -04:00
Rubocop "fixes"
This commit is contained in:
parent
e6528f7c93
commit
51b9a3a332
12 changed files with 33 additions and 8 deletions
|
|
@ -2,4 +2,7 @@ AllCops:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'vendor/**/*'
|
- 'vendor/**/*'
|
||||||
- 'spec/fixtures/**/*'
|
- 'spec/fixtures/**/*'
|
||||||
TargetRubyVersion: 2.0
|
TargetRubyVersion: 2.5
|
||||||
|
Style/CommentedKeyword:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
|
|
||||||
2
Rakefile
2
Rakefile
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'rubocop/rake_task'
|
require 'rubocop/rake_task'
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
require 'puppetlabs_spec_helper/rake_tasks'
|
require 'puppetlabs_spec_helper/rake_tasks'
|
||||||
|
|
|
||||||
2
Vagrantfile
vendored
2
Vagrantfile
vendored
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Vagrant.configure('2') do |config|
|
Vagrant.configure('2') do |config|
|
||||||
config.vm.box = 'genebean/centos-7-nocm'
|
config.vm.box = 'genebean/centos-7-nocm'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'open3'
|
require 'open3'
|
||||||
require 'os'
|
require 'os'
|
||||||
require 'tty-command'
|
require 'tty-command'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
def existing_symlink(source, destination)
|
def existing_symlink(source, destination)
|
||||||
return if File.readlink(destination).eql?(source)
|
return if File.readlink(destination).eql?(source)
|
||||||
|
|
||||||
# rubocop:disable Metrics/LineLength
|
# rubocop:disable Metrics/LineLength
|
||||||
if @prompt.yes?("#{destination} currently points to #{File.readlink(destination)}, do you want point it at #{source}?")
|
if @prompt.yes?("#{destination} currently points to #{File.readlink(destination)}, do you want point it at #{source}?")
|
||||||
File.unlink(destination)
|
File.unlink(destination)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
desc 'Run dots'
|
desc 'Run dots'
|
||||||
task :dots do
|
task :dots do
|
||||||
ruby 'bin/dots.rb'
|
ruby 'bin/dots.rb'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
# rubocop:disable Lint/UnneededDisable, Naming
|
# frozen_string_literal: true
|
||||||
|
|
||||||
forge 'http://forge.puppetlabs.com'
|
forge 'http://forge.puppetlabs.com'
|
||||||
|
|
||||||
# rubocop:disable Metrics/LineLength
|
# rubocop:disable Metrics/LineLength
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
begin
|
begin
|
||||||
require 'rugged'
|
require 'rugged'
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Facter.add(:os_release) do
|
Facter.add(:os_release) do
|
||||||
confine kernel: 'Linux'
|
confine kernel: 'Linux'
|
||||||
|
|
||||||
|
|
@ -7,12 +9,12 @@ Facter.add(:os_release) do
|
||||||
os_release_hash = {}
|
os_release_hash = {}
|
||||||
File.open(file_path, 'r') do |file|
|
File.open(file_path, 'r') do |file|
|
||||||
file.each_line do |line|
|
file.each_line do |line|
|
||||||
unless line.nil? or line.strip.length.eql? 0
|
next if line.nil? || line.strip.length.eql?(0)
|
||||||
line_data = line.split('=')
|
|
||||||
key = line_data[0].downcase
|
line_data = line.split('=')
|
||||||
value = line_data[1].strip.gsub(/(^\")|(\"$)/, '')
|
key = line_data[0].downcase
|
||||||
os_release_hash[key] = value
|
value = line_data[1].strip.gsub(/(^\")|(\"$)/, '')
|
||||||
end
|
os_release_hash[key] = value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
os_release_hash
|
os_release_hash
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Puppet::Functions.create_function(:find_group) do
|
Puppet::Functions.create_function(:find_group) do
|
||||||
dispatch :find_group do
|
dispatch :find_group do
|
||||||
param 'String', :some_path
|
param 'String', :some_path
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Puppet::Functions.create_function(:find_owner) do
|
Puppet::Functions.create_function(:find_owner) do
|
||||||
dispatch :find_owner do
|
dispatch :find_owner do
|
||||||
param 'String', :some_path
|
param 'String', :some_path
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Puppet::Functions.create_function(:homedir_to_user) do
|
Puppet::Functions.create_function(:homedir_to_user) do
|
||||||
dispatch :homedir_to_user do
|
dispatch :homedir_to_user do
|
||||||
param 'String', :some_path
|
param 'String', :some_path
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue