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.


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

def initialize
  set_default_path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path


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

def path
  @path
end

Instance Method Details

#childrenObject


129
130
131
# File 'library/general/src/modules/Hooks.rb', line 129

def children
  path.children
end

#join!(new_path) ⇒ Object


117
118
119
# File 'library/general/src/modules/Hooks.rb', line 117

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

#resetObject


121
122
123
# File 'library/general/src/modules/Hooks.rb', line 121

def reset
  set_default_path
end

#set(new_path) ⇒ Object


125
126
127
# File 'library/general/src/modules/Hooks.rb', line 125

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

#to_sObject


133
134
135
# File 'library/general/src/modules/Hooks.rb', line 133

def to_s
  path.to_s
end

#verify!Object


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

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

  path
end