mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 09:27:44 -04:00
commit
1e57bb2e5d
15 changed files with 131 additions and 107 deletions
|
|
@ -2,4 +2,7 @@ AllCops:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'vendor/**/*'
|
- 'vendor/**/*'
|
||||||
- 'spec/fixtures/**/*'
|
- 'spec/fixtures/**/*'
|
||||||
TargetRubyVersion: 2.0
|
TargetRubyVersion: 2.5
|
||||||
|
Style/CommentedKeyword:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ os:
|
||||||
# - osx
|
# - osx
|
||||||
|
|
||||||
rvm:
|
rvm:
|
||||||
- 2.4.1
|
- 2.5
|
||||||
- 2.3.1
|
- 2.6
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- gem update --system
|
- gem update --system
|
||||||
|
|
|
||||||
4
Gemfile
4
Gemfile
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# vim:ft=ruby
|
# vim:ft=ruby
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
|
@ -22,7 +24,7 @@ group :development, :unit_tests do
|
||||||
gem 'metadata-json-lint', '~> 2.0'
|
gem 'metadata-json-lint', '~> 2.0'
|
||||||
gem 'puppetlabs_spec_helper', '~> 2.3'
|
gem 'puppetlabs_spec_helper', '~> 2.3'
|
||||||
gem 'rspec-puppet', '~> 2.6'
|
gem 'rspec-puppet', '~> 2.6'
|
||||||
gem 'rubocop', '~> 0.50'
|
gem 'rubocop', '~> 0.78'
|
||||||
gem 'tty-command', '~> 0.6'
|
gem 'tty-command', '~> 0.6'
|
||||||
gem 'tty-file', '~> 0.4'
|
gem 'tty-file', '~> 0.4'
|
||||||
gem 'tty-prompt', '~> 0.13'
|
gem 'tty-prompt', '~> 0.13'
|
||||||
|
|
|
||||||
189
Gemfile.lock
189
Gemfile.lock
|
|
@ -1,69 +1,69 @@
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
CFPropertyList (2.3.5)
|
CFPropertyList (2.3.6)
|
||||||
addressable (2.5.2)
|
addressable (2.7.0)
|
||||||
public_suffix (>= 2.0.2, < 4.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
ast (2.3.0)
|
ast (2.4.0)
|
||||||
colored (1.2)
|
colored (1.2)
|
||||||
cri (2.6.1)
|
cri (2.6.1)
|
||||||
colored (~> 1.2)
|
colored (~> 1.2)
|
||||||
diff-lcs (1.3)
|
diff-lcs (1.3)
|
||||||
equatable (0.5.0)
|
equatable (0.6.1)
|
||||||
facter (2.5.1)
|
facter (2.5.6)
|
||||||
facter (2.5.1-universal-darwin)
|
facter (2.5.6-universal-darwin)
|
||||||
CFPropertyList (~> 2.2)
|
CFPropertyList (~> 2.2)
|
||||||
faraday (0.9.2)
|
faraday (0.13.1)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
faraday_middleware (0.10.1)
|
faraday_middleware (0.12.2)
|
||||||
faraday (>= 0.7.4, < 1.0)
|
faraday (>= 0.7.4, < 1.0)
|
||||||
fast_gettext (1.1.0)
|
fast_gettext (1.1.2)
|
||||||
gettext (3.2.4)
|
gettext (3.2.9)
|
||||||
locale (>= 2.0.5)
|
locale (>= 2.0.5)
|
||||||
text (>= 1.3.0)
|
text (>= 1.3.0)
|
||||||
gettext-setup (0.28)
|
gettext-setup (0.31)
|
||||||
fast_gettext (~> 1.1.0)
|
fast_gettext (~> 1.1.0)
|
||||||
gettext (>= 3.0.2)
|
gettext (>= 3.0.2)
|
||||||
locale
|
locale
|
||||||
hiera (3.4.2)
|
hiera (3.6.0)
|
||||||
hitimes (1.2.6)
|
jaro_winkler (1.5.4)
|
||||||
json (2.1.0)
|
json (2.3.0)
|
||||||
json-schema (2.8.0)
|
json-schema (2.8.1)
|
||||||
addressable (>= 2.4)
|
addressable (>= 2.4)
|
||||||
locale (2.1.2)
|
locale (2.1.2)
|
||||||
log4r (1.1.10)
|
log4r (1.1.10)
|
||||||
metaclass (0.0.4)
|
metadata-json-lint (2.2.0)
|
||||||
metadata-json-lint (2.0.2)
|
|
||||||
json-schema (~> 2.8)
|
json-schema (~> 2.8)
|
||||||
spdx-licenses (~> 1.0)
|
spdx-licenses (~> 1.0)
|
||||||
minitar (0.6.1)
|
minitar (0.9)
|
||||||
mocha (1.3.0)
|
mocha (1.11.1)
|
||||||
metaclass (~> 0.0.1)
|
multi_json (1.14.1)
|
||||||
multi_json (1.12.2)
|
multipart-post (2.1.1)
|
||||||
multipart-post (2.0.0)
|
necromancer (0.5.1)
|
||||||
necromancer (0.4.0)
|
os (1.0.1)
|
||||||
os (1.0.0)
|
parallel (1.19.1)
|
||||||
parallel (1.12.0)
|
parser (2.7.0.0)
|
||||||
parser (2.4.0.0)
|
ast (~> 2.4.0)
|
||||||
ast (~> 2.2)
|
pastel (0.7.3)
|
||||||
pastel (0.7.1)
|
equatable (~> 0.6)
|
||||||
equatable (~> 0.5.0)
|
tty-color (~> 0.5)
|
||||||
tty-color (~> 0.4.0)
|
pathspec (0.2.1)
|
||||||
powerpack (0.1.1)
|
public_suffix (4.0.1)
|
||||||
public_suffix (3.0.0)
|
puppet (5.5.17)
|
||||||
puppet (5.3.2)
|
facter (> 2.0.1, < 4)
|
||||||
facter (> 2.0, < 4)
|
fast_gettext (~> 1.1.2)
|
||||||
gettext-setup (>= 0.10, < 1)
|
|
||||||
hiera (>= 3.2.1, < 4)
|
hiera (>= 3.2.1, < 4)
|
||||||
locale (~> 2.1)
|
locale (~> 2.1)
|
||||||
puppet (5.3.2-universal-darwin)
|
multi_json (~> 1.10)
|
||||||
|
puppet (5.5.17-universal-darwin)
|
||||||
CFPropertyList (~> 2.2)
|
CFPropertyList (~> 2.2)
|
||||||
facter (> 2.0, < 4)
|
facter (> 2.0.1, < 4)
|
||||||
gettext-setup (>= 0.10, < 1)
|
fast_gettext (~> 1.1.2)
|
||||||
hiera (>= 3.2.1, < 4)
|
hiera (>= 3.2.1, < 4)
|
||||||
locale (~> 2.1)
|
locale (~> 2.1)
|
||||||
puppet-lint (2.3.3)
|
multi_json (~> 1.10)
|
||||||
puppet-lint-absolute_classname-check (0.2.4)
|
puppet-lint (2.4.2)
|
||||||
|
puppet-lint-absolute_classname-check (0.2.5)
|
||||||
puppet-lint (>= 1.0, < 3.0)
|
puppet-lint (>= 1.0, < 3.0)
|
||||||
puppet-lint-absolute_template_path (1.0.1)
|
puppet-lint-absolute_template_path (1.0.1)
|
||||||
puppet-lint (>= 1.1, < 3.0)
|
puppet-lint (>= 1.1, < 3.0)
|
||||||
|
|
@ -71,7 +71,7 @@ GEM
|
||||||
puppet-lint (>= 1.0, < 3.0)
|
puppet-lint (>= 1.0, < 3.0)
|
||||||
puppet-lint-leading_zero-check (0.1.1)
|
puppet-lint-leading_zero-check (0.1.1)
|
||||||
puppet-lint (>= 1.0, < 3.0)
|
puppet-lint (>= 1.0, < 3.0)
|
||||||
puppet-lint-resource_reference_syntax (1.0.10)
|
puppet-lint-resource_reference_syntax (1.0.14)
|
||||||
puppet-lint (>= 1.0, < 3.0)
|
puppet-lint (>= 1.0, < 3.0)
|
||||||
puppet-lint-spaceship_operator_without_tag-check (0.1.1)
|
puppet-lint-spaceship_operator_without_tag-check (0.1.1)
|
||||||
puppet-lint (>= 1.0, < 3.0)
|
puppet-lint (>= 1.0, < 3.0)
|
||||||
|
|
@ -83,79 +83,76 @@ GEM
|
||||||
puppet-lint (>= 1.0, < 3.0)
|
puppet-lint (>= 1.0, < 3.0)
|
||||||
puppet-lint-variable_contains_upcase (1.2.0)
|
puppet-lint-variable_contains_upcase (1.2.0)
|
||||||
puppet-lint (>= 1.0, < 3.0)
|
puppet-lint (>= 1.0, < 3.0)
|
||||||
puppet-syntax (2.4.1)
|
puppet-syntax (2.6.0)
|
||||||
rake
|
rake
|
||||||
puppet_forge (2.2.6)
|
puppet_forge (2.2.9)
|
||||||
faraday (~> 0.9.0)
|
faraday (>= 0.9.0, < 0.14.0)
|
||||||
faraday_middleware (>= 0.9.0, < 0.11.0)
|
faraday_middleware (>= 0.9.0, < 0.13.0)
|
||||||
gettext-setup (~> 0.11)
|
gettext-setup (~> 0.11)
|
||||||
minitar
|
minitar
|
||||||
semantic_puppet (~> 0.1.0)
|
semantic_puppet (~> 1.0)
|
||||||
puppetlabs_spec_helper (2.3.2)
|
puppetlabs_spec_helper (2.14.1)
|
||||||
mocha (~> 1.0)
|
mocha (~> 1.0)
|
||||||
|
pathspec (~> 0.2.1)
|
||||||
puppet-lint (~> 2.0)
|
puppet-lint (~> 2.0)
|
||||||
puppet-syntax (~> 2.0)
|
puppet-syntax (~> 2.0)
|
||||||
rspec-puppet (~> 2.0)
|
rspec-puppet (~> 2.0)
|
||||||
r10k (2.5.5)
|
r10k (2.6.7)
|
||||||
colored (= 1.2)
|
colored (= 1.2)
|
||||||
cri (~> 2.6.1)
|
cri (~> 2.6.1)
|
||||||
gettext-setup (~> 0.5)
|
gettext-setup (~> 0.5)
|
||||||
log4r (= 1.1.10)
|
log4r (= 1.1.10)
|
||||||
multi_json (~> 1.10)
|
multi_json (~> 1.10)
|
||||||
puppet_forge (~> 2.2)
|
puppet_forge (~> 2.2.8)
|
||||||
semantic_puppet (~> 0.1.0)
|
rainbow (3.0.0)
|
||||||
rainbow (2.2.2)
|
rake (13.0.1)
|
||||||
rake
|
rspec (3.9.0)
|
||||||
rake (12.1.0)
|
rspec-core (~> 3.9.0)
|
||||||
rspec (3.6.0)
|
rspec-expectations (~> 3.9.0)
|
||||||
rspec-core (~> 3.6.0)
|
rspec-mocks (~> 3.9.0)
|
||||||
rspec-expectations (~> 3.6.0)
|
rspec-core (3.9.0)
|
||||||
rspec-mocks (~> 3.6.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-core (3.6.0)
|
rspec-expectations (3.9.0)
|
||||||
rspec-support (~> 3.6.0)
|
|
||||||
rspec-expectations (3.6.0)
|
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.6.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-mocks (3.6.0)
|
rspec-mocks (3.9.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.6.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-puppet (2.6.9)
|
rspec-puppet (2.7.8)
|
||||||
rspec
|
rspec
|
||||||
rspec-support (3.6.0)
|
rspec-support (3.9.0)
|
||||||
rubocop (0.50.0)
|
rubocop (0.78.0)
|
||||||
|
jaro_winkler (~> 1.5.1)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 2.3.3.1, < 3.0)
|
parser (>= 2.6)
|
||||||
powerpack (~> 0.1)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
rainbow (>= 2.2.2, < 3.0)
|
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (~> 1.0, >= 1.0.1)
|
unicode-display_width (>= 1.4.0, < 1.7)
|
||||||
ruby-progressbar (1.9.0)
|
ruby-progressbar (1.10.1)
|
||||||
rugged (0.26.0)
|
rugged (0.28.4.1)
|
||||||
semantic_puppet (0.1.4)
|
semantic_puppet (1.0.2)
|
||||||
gettext-setup (>= 0.3)
|
spdx-licenses (1.2.0)
|
||||||
spdx-licenses (1.1.0)
|
|
||||||
text (1.3.1)
|
text (1.3.1)
|
||||||
timers (4.1.2)
|
trollop (2.9.10)
|
||||||
hitimes
|
tty-color (0.5.0)
|
||||||
trollop (2.1.2)
|
tty-command (0.9.0)
|
||||||
tty-color (0.4.2)
|
|
||||||
tty-command (0.6.0)
|
|
||||||
pastel (~> 0.7.0)
|
pastel (~> 0.7.0)
|
||||||
tty-cursor (0.5.0)
|
tty-cursor (0.7.0)
|
||||||
tty-file (0.4.0)
|
tty-file (0.8.0)
|
||||||
diff-lcs (~> 1.3.0)
|
diff-lcs (~> 1.3)
|
||||||
pastel (~> 0.7.1)
|
pastel (~> 0.7.2)
|
||||||
tty-prompt (~> 0.13.2)
|
tty-prompt (~> 0.18)
|
||||||
tty-prompt (0.13.2)
|
tty-prompt (0.20.0)
|
||||||
necromancer (~> 0.4.0)
|
necromancer (~> 0.5.0)
|
||||||
pastel (~> 0.7.0)
|
pastel (~> 0.7.0)
|
||||||
timers (~> 4.1.2)
|
tty-reader (~> 0.7.0)
|
||||||
tty-cursor (~> 0.5.0)
|
tty-reader (0.7.0)
|
||||||
tty-reader (~> 0.1.0)
|
tty-cursor (~> 0.7)
|
||||||
tty-reader (0.1.0)
|
tty-screen (~> 0.7)
|
||||||
wisper (~> 2.0.0)
|
wisper (~> 2.0.0)
|
||||||
unicode-display_width (1.3.0)
|
tty-screen (0.7.0)
|
||||||
wisper (2.0.0)
|
unicode-display_width (1.6.0)
|
||||||
|
wisper (2.0.1)
|
||||||
xmlrpc (0.3.0)
|
xmlrpc (0.3.0)
|
||||||
yamllint (0.0.9)
|
yamllint (0.0.9)
|
||||||
trollop (~> 2)
|
trollop (~> 2)
|
||||||
|
|
@ -184,7 +181,7 @@ DEPENDENCIES
|
||||||
puppetlabs_spec_helper (~> 2.3)
|
puppetlabs_spec_helper (~> 2.3)
|
||||||
r10k (~> 2.5)
|
r10k (~> 2.5)
|
||||||
rspec-puppet (~> 2.6)
|
rspec-puppet (~> 2.6)
|
||||||
rubocop (~> 0.50)
|
rubocop (~> 0.78)
|
||||||
rugged (~> 0.26)
|
rugged (~> 0.26)
|
||||||
tty-command (~> 0.6)
|
tty-command (~> 0.6)
|
||||||
tty-file (~> 0.4)
|
tty-file (~> 0.4)
|
||||||
|
|
@ -193,4 +190,4 @@ DEPENDENCIES
|
||||||
yamllint (~> 0.0.9)
|
yamllint (~> 0.0.9)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.15.4
|
2.0.2
|
||||||
|
|
|
||||||
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