builder/extra/cluster-home/lib/ruby/tungsten/properties.rb
# Write properties to a file.  We use signal protection to avoid getting
# interrupted half-way through. 
Write properties to a file.  We use signal protection to avoid getting
interrupted half-way through.
Write properties to a file . We use signal protection to avoid getting interrupted half - way through .
def store(properties_filename, use_json = true)
    interrupted = false
    old_trap = trap("INT") {
      interrupted = true;
    }
    File.open(properties_filename, 'w') do |file|
      file.printf "# Tungsten configuration properties\n"
      file.printf "# Date: %s\n", DateTime.now
      if use_json == false
        @props.sort.each do | key, value |
          file.printf "%s=%s\n", key, value
        end
      else
        file.print self.to_s
      end
    end
    if (interrupted) 
      puts
      puts ("Configuration interrupted") 
      exit 1;
    else
      trap("INT", old_trap);
    end
  end
def store ( properties_filename , use_json = true ) interrupted = false old_trap = trap ( "INT" ) { interrupted = true ; } File . open ( properties_filename , 'w' ) do | file | file . printf "# Tungsten configuration properties\n" file . printf "# Date: %s\n" , DateTime . now if use_json == false @props . sort . each do | key , value | file . printf "%s=%s\n" , key , value end else file . print self . to_s end end if ( interrupted ) puts puts ( "Configuration interrupted" ) exit 1 ; else trap ( "INT" , old_trap ) ; end end
Write properties to a file.
Write properties to a file .
# Protect I/O with trap for Ctrl-C.  # Write.  # Check for interrupt and restore handler. 
properties_filename
use_json