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:
|
||||
- 'vendor/**/*'
|
||||
- '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 'rubygems'
|
||||
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|
|
||||
config.vm.box = 'genebean/centos-7-nocm'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'open3'
|
||||
require 'os'
|
||||
require 'tty-command'
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
desc 'Run dots'
|
||||
task :dots do
|
||||
ruby 'bin/dots.rb'
|
||||
|
|
|
|||
|
|
@ -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,14 +9,14 @@ 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
|
||||
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
|
||||
end
|
||||
os_release_hash
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -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