Class: Yast::HooksClass::SearchPath

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

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSearchPath

Returns a new instance of SearchPath.



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

def initialize
  set_default_path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



113
114
115
# File 'library/general/src/modules/Hooks.rb', line 113

def path
  @path
end

Instance Method Details

#childrenObject



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

def children
  path.children
end

#join!(new_path) ⇒ Object



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

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

#resetObject



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

def reset
  set_default_path
end

#set(new_path) ⇒ Object



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

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

#to_sObject



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

def to_s
  path.to_s
end

#verify!Object



139
140
141
142
143
# File 'library/general/src/modules/Hooks.rb', line 139

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

  path
end