Class: Getch::Gentoo::Use
- Inherits:
-
Object
- Object
- Getch::Gentoo::Use
- Includes:
- NiTo
- Defined in:
- lib/getch/gentoo/use.rb
Overview
Utility to configure use flag on Gentoo
Instance Method Summary collapse
- #add(*flags) ⇒ Object
- #add_global(*flags) ⇒ Object
-
#initialize(pkg = nil) ⇒ Use
constructor
A new instance of Use.
Methods included from NiTo
cp, echo, echo_a, grep?, mkdir, mount, mount?, mv, rm, search_proc_swaps, sed, sh, swapoff, swapoff_dm, touch, umount
Constructor Details
#initialize(pkg = nil) ⇒ Use
Returns a new instance of Use.
11 12 13 14 15 16 |
# File 'lib/getch/gentoo/use.rb', line 11 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
18 19 20 21 |
# File 'lib/getch/gentoo/use.rb', line 18 def add(*flags) @flags = flags.join(' ') write end |
#add_global(*flags) ⇒ Object
23 24 25 26 |
# File 'lib/getch/gentoo/use.rb', line 23 def add_global(*flags) @flags = flags write_global end |