[exerb-eng:18] Re: error with yaml

Back to archive index

Austin Ziegler austi****@halos*****
Wed Sep 10 23:28:52 JST 2003


I can't answer your first question, but:

> 2) can i pack icons and other data into the exe?

You will need to encode the icons as Ruby data first. The following script 
should stringify the data:

ARGV.each do |icon_file|
  data = File.open(icon_file, 'rb') { |f| f.read }

  out_name = icon_file.sub(/#{File.extname(icon_file)}$/, '').upcase
  out_file = icon_file.sub(/#{File.extname(icon_file)}$/, '.rb')

  File.open(out_file) { |f| f.puts "#{out_name} = #{bytes.inspect}" }
end

(I say should because I haven't tested this version. It's based on an 
earlier version that used constant values for icon_file, out_name, and 
out_file.)

-austin
--
austin ziegler    * austi****@halos***** * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.09.10
                                         * 10.18.40






More information about the exerb-english mailing list
Back to archive index