Sha256: 7d983960bb02b321e094ed02536b412d2c8fd12a2b21c1093ff703aac941cfdf
Contents?: true
Size: 768 Bytes
Versions: 8
Compression:
Stored size: 768 Bytes
Contents
# $Date: 2009/02/19 15:49:32 $ module UserSpace # provided by caller (global_options_variables): # USER_CONF_DIR # GEM_LIB_DIR # CONF_FILE def self.mkdir(subdir='') dir = USER_CONF_DIR+subdir Dir.mkdir(dir) if !File.exist?(dir) end def self.cp(rfile,wfile) if !File.exist?(wfile) then File.open(rfile, 'r'){|fhr| File.open(wfile, 'w'){|fhw| fhr.each{|ln| fhw.puts ln} } } File.chmod(0600, wfile) # rw to user only end end def self.copy(rfile, wfile=nil) wfile = rfile if !wfile self.cp(GEM_ROOT_DIR+rfile, USER_CONF_DIR+wfile) end def self.cp_conf self.cp(GEM_LIB_DIR+CONF_FILE, USER_CONF_DIR+CONF_FILE) end def self.setup self.mkdir self.cp_conf end end
Version data entries
8 entries across 8 versions & 1 rubygems