the Shoes adventurer's list

Re: Compiling/Packaging shoes?

by francois.vaux on 05:53 on August 15th, 2007

Mark Silverberg a écrit :
> My question is.. after I build my .rb file(s) that use Shoe.app..
> what's the best way to package it up and send to a friend? One of my
> ideas includes connecting to a SQL server however the client shouldnt
> have easy access to it those logins. The rest of the code can be open
> source.

You can use a Rakefile to do that, with an "install" task that downloads the 
last shoes version from svn (or a specific revision with svn co -r).
Then you can copy the interesting files from the dist/ folder into your app's 
folder.

For my app I use the following task:

   task :install do
     # Create the application folder
     FileUtils.mkdir('app', :verbose => true)
     # First, we install Shoes by checking out the last version from svn
     # then we build it and move it to the app/ folder
     %x{svn co http://code.whytheluckystiff.net/svn/shoes/trunk shoes}
     FileUtils.cd('shoes') do
       %x{rake}
       FileUtils.cd('dist', :verbose => true) do
         appdir = '../../app'
         FileUtils.cp_r('./lib/',         appdir, :verbose => true)
         FileUtils.cp_r('./ruby/',        appdir, :verbose => true)
         FileUtils.cp('./libruby1.8.so',  appdir, :verbose => true)
         FileUtils.cp('./libruby.so.1.8', appdir, :verbose => true)
         FileUtils.cp('./shoes',          appdir, :verbose => true)
         FileUtils.cp('./shoes-bin',      appdir, :verbose => true)
       end
     end
   end

Then make a tar.bz or a zip with your app's files and your Rakefile, and put 
some instructions in a README, and it should be OK :P