Sha256: d3103c1a1e54c953096b1b43676d8ad1322859fb825359f12ceebfd6a6c6afbc

Contents?: true

Size: 929 Bytes

Versions: 1

Compression:

Stored size: 929 Bytes

Contents

Eye::Cli.class_eval do
  private

  def loader_path
    filename = File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. .. bin eye-patch-loader]))
    File.exists?(filename) ? filename : nil
  end
end

Eye::System.class_eval do
  private

  def spawn_options(config = {})
    o = {pgroup: true, chdir: config[:working_dir] || '/'}
    o.update(out: [config[:stdout], 'a']) if config[:stdout]
    o.update(err: [config[:stderr], 'a']) if config[:stderr]
    o.update(in: config[:stdin]) if config[:stdin]
    o.update(close_others: !config[:preserve_fds])

    if Eye::Local.root?
      o.update(uid: Etc.getpwnam(config[:uid]).uid) if config[:uid]
      o.update(gid: Etc.getpwnam(config[:gid]).gid) if config[:gid]
    end

    o.update(umask: config[:umask]) if config[:umask]

    o
  end
end

Eye::Controller.class_eval do
  private

  def parse_config(filename)
    Eye::Patch.parse(filename)
  end
end

Eye::Control

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eye-patch-0.0.8 lib/eye/patch/overrides.rb