]> icculus.org git repositories - duncan/yastx-core.git/blob - examples/test-2.rb
more doc
[duncan/yastx-core.git] / examples / test-2.rb
1 require 'scr'
2
3 Plugin.define "release_agent" do
4   author "Duncan"
5   version "1.0.0"
6   extends :agent
7   run_before :other
8   
9   def read(path)
10     if path == :'.system.product.edition'
11       f = File.open('/etc/SuSE-release', 'r')
12       f.each_line do |l|
13         return l
14       end
15       return ""
16     end
17   end
18       
19   def supports_path?(path)
20     return path == :'.system.product.edition'
21   end
22 end
23
24 puts SCR::read(:'.system.product.edition')