Class: DWSRegistryWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/drb_reg_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ DWSRegistryWrapper

Returns a new instance of DWSRegistryWrapper.



12
13
14
15
16
17
# File 'lib/drb_reg_server.rb', line 12

def initialize(filename)
  
  @filename = filename
  load_reg()
  
end

Instance Method Details

#delete_key(key) ⇒ Object



19
20
21
22
# File 'lib/drb_reg_server.rb', line 19

def delete_key(key)
  r = @reg.delete_key key
  r ? 'key deleted' : 'key not found'
end

#gem_register(gemfile) ⇒ Object



38
39
40
# File 'lib/drb_reg_server.rb', line 38

def gem_register(gemfile)    
  @reg.gem_register(gemfile)
end

#get_key(path, auto_detect_type: false) ⇒ Object



24
25
26
27
# File 'lib/drb_reg_server.rb', line 24

def get_key(path, auto_detect_type: false)
  e = @reg.get_key(path, auto_detect_type: auto_detect_type)
  e.xml
end

#get_keys(key) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/drb_reg_server.rb', line 29

def get_keys(key)
  
  recordset = @reg.get_keys(key)
  return unless recordset
  
  recordset.to_doc(root: 'recordset').root.xml

end

#import(s) ⇒ Object



42
43
44
# File 'lib/drb_reg_server.rb', line 42

def import(s)
  @reg.import(s)    
end

#refreshObject



46
47
48
# File 'lib/drb_reg_server.rb', line 46

def refresh()
  load_reg()
end

#set_key(path, value) ⇒ Object



50
51
52
53
# File 'lib/drb_reg_server.rb', line 50

def set_key(path, value)
  e = @reg.set_key(path, value)
  e.xml
end

#xpath(xpath) ⇒ Object



55
56
57
58
59
60
61
62
# File 'lib/drb_reg_server.rb', line 55

def xpath(xpath)
  
  recordset = @reg.xpath(xpath)
  return unless recordset
  
  recordset.to_doc(root: 'recordset').root.xml          
  
end