Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
akerl committed Jul 9, 2023
1 parent e99115a commit 36183cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions dock0.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ require 'dock0/version'
Gem::Specification.new do |s|
s.name = 'dock0'
s.version = Dock0::VERSION
s.date = Time.now.strftime('%Y-%m-%d')

s.required_ruby_version = '>= 3.0'

s.summary = 'Builds a read-only Arch host for Docker'
s.description = 'Generates a read-only Arch host for running Docker containers' # rubocop:disable Metrics/LineLength
s.description = 'Generates a read-only Arch host for running Docker containers'
s.authors = ['Les Aker']
s.email = 'me@lesaker.org'
s.homepage = 'https://github.com/aker/dock0'
s.license = 'MIT'

s.files = `git ls-files`.split
s.test_files = `git ls-files spec/*`.split
s.executables = ['dock0']

s.add_dependency 'cymbal', '~> 2.0.0'
Expand All @@ -24,4 +24,5 @@ Gem::Specification.new do |s|
s.add_dependency 'mercenary', '~> 0.4.0'

s.add_development_dependency 'goodcop', '~> 0.9.7'
s.metadata['rubygems_mfa_required'] = 'true'
end
8 changes: 4 additions & 4 deletions lib/dock0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Base

def initialize(*configs)
@config = configs.each_with_object(default_config) do |path, obj|
new = YAML.safe_load(File.read(path))
new = YAML.safe_load_file(path)
next unless new
obj.deep_merge! Cymbal.symbolize(new)
end
Expand All @@ -57,11 +57,11 @@ def render_templates(prefix)
templates.each do |path|
puts "Templating #{path}"
template = File.read "#{@paths[:templates]}/#{path}"
parsed = ERB.new(template, nil, '<>').result(binding)
parsed = ERB.new(template, trim_mode: '<>').result(binding)

target_path = "#{@paths[:build]}/#{prefix}/#{path}"
FileUtils.mkdir_p File.dirname(target_path)
File.open(target_path, 'w') { |fh| fh.write parsed }
File.write(target_path, parsed)
end
end

Expand All @@ -70,7 +70,7 @@ def run_script(script)
end

def run_scripts
Dir.glob(@paths[:scripts] + '/*.rb').sort.each do |script|
Dir.glob("#{@paths[:scripts]}/*.rb").each do |script|
puts "Running #{script}"
run_script script
end
Expand Down
2 changes: 1 addition & 1 deletion lib/dock0/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def install_packages

def apply_overlay
puts "Applying overlay from #{@paths[:overlay]}"
overlay_path = @paths[:overlay] + '/.'
overlay_path = "#{@paths[:overlay]}/."
FileUtils.cp_r overlay_path, @paths[:build]
end

Expand Down

0 comments on commit 36183cf

Please sign in to comment.