Class: Yast::HooksClass::SearchPath

Inherits:
Object
  • Object
show all
Defined in:
../../library/general/src/modules/Hooks.rb

Constant Summary

DEFAULT_DIR =
"/var/lib/YaST2/hooks"

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (SearchPath) initialize

Returns a new instance of SearchPath



111
112
113
# File '../../library/general/src/modules/Hooks.rb', line 111

def initialize
  set_default_path
end

Instance Attribute Details

- (Object) path (readonly)

Returns the value of attribute path



109
110
111
# File '../../library/general/src/modules/Hooks.rb', line 109

def path
  @path
end

Instance Method Details

- (Object) children



127
128
129
# File '../../library/general/src/modules/Hooks.rb', line 127

def children
  path.children
end

- (Object) join!(new_path)



115
116
117
# File '../../library/general/src/modules/Hooks.rb', line 115

def join!(new_path)
  @path = path.join(new_path)
end

- (Object) reset



119
120
121
# File '../../library/general/src/modules/Hooks.rb', line 119

def reset
  set_default_path
end

- (Object) set(new_path)



123
124
125
# File '../../library/general/src/modules/Hooks.rb', line 123

def set(new_path)
  @path = Pathname.new(new_path)
end

- (Object) to_s



131
132
133
# File '../../library/general/src/modules/Hooks.rb', line 131

def to_s
  path.to_s
end

- (Object) verify!



135
136
137
138
139
140
141
# File '../../library/general/src/modules/Hooks.rb', line 135

def verify!
  if path.exist?
    path
  else
    raise "Hook search path #{path} does not exists"
  end
end