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".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSearchPath

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

#pathObject (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

#childrenObject



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

def children
  path.children
end

#join!(new_path) ⇒ Object



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

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

#resetObject



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

def reset
  set_default_path
end

#set(new_path) ⇒ Object



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

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

#to_sObject



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

def to_s
  path.to_s
end

#verify!Object



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

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