class Niman::Library::CustomPackage

Attributes

commands[R]
files[R]
package_names[R]

Public Class Methods

description() click to toggle source
# File lib/niman/library/custom_package.rb, line 31
def description
  ''
end
errors() click to toggle source
# File lib/niman/library/custom_package.rb, line 40
def errors
  return [] if self.valid?
  package_names.keys.map do |key|
    if package_names[key].empty?
      "No package name configured for OS #{key}"
    end
  end.flatten
end
exec(sudo=:no_sudo, command) click to toggle source
# File lib/niman/library/custom_package.rb, line 35
def exec(sudo=:no_sudo, command)
  @commands ||= []
  @commands << Niman::Library::Command.new(use_sudo: sudo, command: command)
end
file(path) { |file| ... } click to toggle source
# File lib/niman/library/custom_package.rb, line 24
def file(path)
  @files ||= []
  file = Niman::Library::File.new(path: path)
  yield file if block_given?
  @files << file
end
installable?() click to toggle source
# File lib/niman/library/custom_package.rb, line 15
def installable?
  !package_names.nil? && !package_names.empty?
end
package_name(os, name) click to toggle source
# File lib/niman/library/custom_package.rb, line 19
def package_name(os, name)
  @package_names ||= {}
  @package_names[os.to_sym] = name
end
valid?() click to toggle source
# File lib/niman/library/custom_package.rb, line 7
def valid?
  if installable?
    package_names.keys.all?{|k| !package_names[k].empty?}
  else
    true
  end
end