Class: Getch::Gentoo::Use

Inherits:
Object
  • Object
show all
Includes:
NiTo
Defined in:
lib/getch/gentoo/use.rb

Instance Method Summary collapse

Methods included from NiTo

cp, echo, echo_a, grep?, mkdir, mount, mount?, rm, search_proc_swaps, sed, sh, swapoff, swapoff_dm, touch, umount

Constructor Details

#initialize(pkg = nil) ⇒ Use

Returns a new instance of Use.



10
11
12
13
14
15
# File 'lib/getch/gentoo/use.rb', line 10

def initialize(pkg = nil)
  @use_dir = "#{OPTIONS[:mountpoint]}/etc/portage/package.use"
  @pkg = pkg
  @file = @pkg ? @pkg.match(/[\w]+$/) : nil
  @make = "#{OPTIONS[:mountpoint]}/etc/portage/make.conf"
end

Instance Method Details

#add(*flags) ⇒ Object



17
18
19
20
# File 'lib/getch/gentoo/use.rb', line 17

def add(*flags)
  @flags = flags.join(' ')
  write
end

#add_global(*flags) ⇒ Object



22
23
24
25
# File 'lib/getch/gentoo/use.rb', line 22

def add_global(*flags)
  @flags = flags
  write_global
end