Duncan Mac-Vicar P.


Hackweek II (Day 3)

without comments

So today SCR (system configuration repository) works from Ruby. Also if you call Ruby from YCP and the Ruby module calls YaST, Ruby can’t find the library. I fixed that.

require 'yast'

m = YaST::Module.new("SCR")
m.Execute(".target.bash", "firefox")

Will launch firefox

require 'yast'

m = YaST::Module.new("SCR")
modules = m.Read(".proc.modules")
modules.each do | k, v |
  puts "#{k}:"
  v.each do | a, b |
    puts "    #{a} - #{b}"
  end
end

Will output:

de_cd:
    size - 40608
    used - 0
cdrom:
    size - 36896
    used - 2
ehci_hcd:
    size - 34956
    used - 0
... (more)

Written by duncan

June 27th, 2007 at 12:23 pm

Posted in uncategorized

Tagged with ,

Leave a Reply