From: Jeremy Hinegardner Date: 2005-06-23T14:15:24+09:00 Subject: Re: [ANN] traits-0.4.0 - the coffee release --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 23, 2005 at 09:00:36AM +0900, Jeremy Hinegardner wrote: > On Thu, Jun 23, 2005 at 08:31:35AM +0900, Ara.T.Howard wrote: > > On Thu, 23 Jun 2005, James Britt wrote: > > > > >Ara.T.Howard wrote: > > >> > > >>i wasn't drinking enough coffee while coding the 0.3.0 release. this is a > > >>remedy release. > > > > > >Very very cool. > > > > > >Is there a gem for this? > > > > not yet. i'm having gem issues ;-) > > > > i keep codeforpeople.com in sync like like > > > > scp -r ruby/ codeforpeople.com/lib/ > > > > and all my ruby projects are updated. with rubyforge and gems i have to do > > each one individually and this tends to take me a while to get to... how are > > others dealing with this? > > Rakefile's are your friend. Check out: And I really mean it this time. See the attached Rakefile as an example one for traits. I haven't yet tried recursive Rakefiles. Executing 'rake publish' in your top level ruby directory and watching it build gems and sync everything up, that could be nice. There is a rake task for publishing to rubyforge, but I haven't played with it yet. enjoy, -jeremy -- ======================================================================== Jeremy Hinegardner jeremy@hinegardner.org --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=Rakefile require 'rake' require 'rake/clean' require 'rake/contrib/sshpublisher' require 'rake/gempackagetask' PKG_VERSION = IO::read 'VERSION' PKG_VERSION.strip! PKG_NAME = "traits" PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" #----------------------------------------------------------------------- desc "Default Task" task :default => :package #----------------------------------------------------------------------- # cleanup #----------------------------------------------------------------------- CLOBBER.include( "pkg/**", "README" ) #----------------------------------------------------------------------- # generate README # # - maybe make a task lib out of the gen_readme.rb code ? # #----------------------------------------------------------------------- desc "Generate README" task :readme => [:clobber] do File.open('README','w') do |f| $stdout = f tmpl = IO::read 'gen_readme.rb' eval tmpl $stdout = STDOUT end end #----------------------------------------------------------------------- # Publish to website #----------------------------------------------------------------------- desc "Publish the gem on codeforpeople.com" PUBLISH_HOST = "codeforpeople.com" PUBLISH_ROOT = "/lib/ruby" task :publish => [:package] do `ssh #{PUBLISH_HOST} 'mkdir -p #{PUBLISH_ROOT}/#{PKG_NAME}/#{PKG_FILE_NAME}'` `scp -rq ./ #{PUBLISH_HOST}:#{PUBLISH_ROOT}/#{PKG_NAME}/#{PKG_FILE_NAME}` # if packages should go somewhere else Rake::SshFilePublisher.new(PUBLISH_HOST, "#{PUBLISH_ROOT}/pkg", "pkg", "#{PKG_FILE_NAME}.zip").upload Rake::SshFilePublisher.new(PUBLISH_HOST, "#{PUBLISH_ROOT}/pkg", "pkg", "#{PKG_FILE_NAME}.tgz").upload Rake::SshFilePublisher.new(PUBLISH_HOST, "#{PUBLISH_ROOT}/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload end #----------------------------------------------------------------------- # install #----------------------------------------------------------------------- task :install => [:package] do `gem install pkg/#{PKG_FILE_NAME}.gem` end #----------------------------------------------------------------------- # gem specification for :package #----------------------------------------------------------------------- task :package => [:clobber, :readme] spec = Gem::Specification.new do |s| s.name = PKG_NAME s.version = PKG_VERSION s.platform = Gem::Platform::RUBY s.summary = "better living through metaprogramming:" s.description = <= version') s.files = %w(README VERSION) + Dir['lib/**/*'] + Dir['sample/**/*'] s.require_path = '.' s.author = "Ara T. Howard" s.email = "ara [dot] t [dot] howard [at] noaa [dot] gov" end Rake::GemPackageTask.new(spec) do |p| p.gem_spec = spec p.need_tar = true p.need_zip = true end --uAKRQypu60I7Lcqm--