Module: Yast::WFM
- Extended by:
- Logger
- Defined in:
- src/ruby/yast/wfm.rb
Overview
Wrapper class for WFM component in Yast See yast documentation for WFM
Class Method Summary collapse
-
.Args(*args) ⇒ Object
Returns list of arguments passed to client or element at given index.
-
.CallFunction(client, args = []) ⇒ Object
calls client of given name with passed args.
-
.ClientExists(client) ⇒ true, false
Checks if client of given name exists on system.
-
.Execute(path, *args) ⇒ Object
Runs execute on local system agent operating on inst-sys.
-
.GetEncoding ⇒ String
deprecated
Deprecated.
enconding is now always UTF-8
-
.GetEnvironmentEncoding ⇒ String
Returns enconding of environment where Yast start.
-
.GetLanguage ⇒ String
Returns current language without modifiers as string.
-
.Read(path, *args) ⇒ Object
Runs read on local system agent operating on inst-sys.
-
.scr_chrooted? ⇒ Boolean
Tests if scr instance is pointed to chroot.
-
.scr_root ⇒ String
Returns root on which scr operates.
-
.SCRClose(handle) ⇒ Object
Closes SCR handle obtained via WFM.SCROpen.
-
.SCRGetDefault ⇒ Object
Gets handle of current default SCR.
-
.SCRGetName(handle) ⇒ String
Gets name of SCR associated with handle.
-
.SCROpen(name, check_version) ⇒ Object
Creates new SCR instance.
-
.SCRSetDefault(handle) ⇒ Object
Sets the default SCR to given handle.
-
.SetLanguage(language, *args) ⇒ Object
Sets language for translate with optional enconding.
-
.Write(path, *args) ⇒ Object
Runs write on local system agent operating on inst-sys.
Instance Method Summary collapse
-
#call(client, arguments = []) ⇒ Object
deprecated
Deprecated.
use WFM.CallFunction
Methods included from Logger
Class Method Details
.Args(*args) ⇒ Object
Returns list of arguments passed to client or element at given index
23 24 25 |
# File 'src/ruby/yast/wfm.rb', line 23 def self.Args(*args) call_builtin_wrapper("Args", *args) end |
.CallFunction(client, args = []) ⇒ Object
calls client of given name with passed args
187 188 189 190 191 192 193 194 195 196 |
# File 'src/ruby/yast/wfm.rb', line 187 def self.CallFunction(client, args = []) if !client.is_a?(::String) raise ArgumentError, "CallFunction first parameter('#{client.inspect}') have to be String." end if !args.is_a?(::Array) raise ArgumentError, "CallFunction second parameter('#{args.inspect}') have to be Array." end call_builtin_wrapper("CallFunction", client, args) end |
.ClientExists(client) ⇒ true, false
useful for checking before calling given client
Checks if client of given name exists on system
35 36 37 |
# File 'src/ruby/yast/wfm.rb', line 35 def self.ClientExists(client) call_builtin_wrapper("ClientExists", client) end |
.Execute(path, *args) ⇒ Object
very limited use-case. It is needed only if installer switched to scr on target system and agent from inst-sys must be called
Runs execute on local system agent operating on inst-sys
51 52 53 |
# File 'src/ruby/yast/wfm.rb', line 51 def self.Execute(path, *args) call_builtin_wrapper("Execute", Yast.path(path), *args) end |
.GetEncoding ⇒ String
enconding is now always UTF-8
Returns current encoding code as string
59 60 61 |
# File 'src/ruby/yast/wfm.rb', line 59 def self.GetEncoding call_builtin_wrapper("GetEncoding") end |
.GetEnvironmentEncoding ⇒ String
Returns enconding of environment where Yast start
66 67 68 |
# File 'src/ruby/yast/wfm.rb', line 66 def self.GetEnvironmentEncoding call_builtin_wrapper("GetEnvironmentEncoding") end |
.GetLanguage ⇒ String
Returns current language without modifiers as string
76 77 78 |
# File 'src/ruby/yast/wfm.rb', line 76 def self.GetLanguage call_builtin_wrapper("GetLanguage") end |
.Read(path, *args) ⇒ Object
very limited use-case. It is needed only if installer switched to scr on target system and agent from inst-sys must be called
Runs read on local system agent operating on inst-sys
92 93 94 |
# File 'src/ruby/yast/wfm.rb', line 92 def self.Read(path, *args) call_builtin_wrapper("Read", Yast.path(path), *args) end |
.scr_chrooted? ⇒ Boolean
Tests if scr instance is pointed to chroot
118 119 120 |
# File 'src/ruby/yast/wfm.rb', line 118 def self.scr_chrooted? SCRGetName(SCRGetDefault()) != "scr" end |
.scr_root ⇒ String
Returns root on which scr operates. or "/mnt" when installation was switched.
125 126 127 128 129 130 131 132 133 134 |
# File 'src/ruby/yast/wfm.rb', line 125 def self.scr_root case SCRGetName(SCRGetDefault()) when "scr" "/" when /chroot=(.*):scr/ Regexp.last_match(1) else raise "invalid SCR instance #{SCRGetName(SCRGetDefault())}" end end |
.SCRClose(handle) ⇒ Object
Closes SCR handle obtained via SCROpen
If SCR is set as default, then try to switch to another reasonable SCR openned
100 101 102 |
# File 'src/ruby/yast/wfm.rb', line 100 def self.SCRClose(handle) call_builtin_wrapper("SCRClose", handle) end |
.SCRGetDefault ⇒ Object
Gets handle of current default SCR
105 106 107 |
# File 'src/ruby/yast/wfm.rb', line 105 def self.SCRGetDefault call_builtin_wrapper("SCRGetDefault") end |
.SCRGetName(handle) ⇒ String
Gets name of SCR associated with handle
112 113 114 |
# File 'src/ruby/yast/wfm.rb', line 112 def self.SCRGetName(handle) call_builtin_wrapper("SCRGetName", handle) end |
.SCROpen(name, check_version) ⇒ Object
Creates new SCR instance
It is useful for installation where agents start operation on installed system
148 149 150 |
# File 'src/ruby/yast/wfm.rb', line 148 def self.SCROpen(name, check_version) call_builtin_wrapper("SCROpen", name, check_version) end |
.SCRSetDefault(handle) ⇒ Object
Sets the default SCR to given handle
153 154 155 |
# File 'src/ruby/yast/wfm.rb', line 153 def self.SCRSetDefault(handle) call_builtin_wrapper("SCRSetDefault", handle) end |
.SetLanguage(language, *args) ⇒ Object
Sets language for translate with optional enconding
158 159 160 |
# File 'src/ruby/yast/wfm.rb', line 158 def self.SetLanguage(language, *args) call_builtin_wrapper("SetLanguage", language, *args) end |
.Write(path, *args) ⇒ Object
very limited use-case. It is needed only if installer switched to scr on target system and agent from inst-sys must be called
Runs write on local system agent operating on inst-sys
174 175 176 |
# File 'src/ruby/yast/wfm.rb', line 174 def self.Write(path, *args) call_builtin_wrapper("Write", Yast.path(path), *args) end |
Instance Method Details
#call(client, arguments = []) ⇒ Object
use CallFunction
200 |
# File 'src/ruby/yast/wfm.rb', line 200 singleton_class.send(:alias_method, :call, :CallFunction) |