From: Ryan Davis Date: 2009-05-14T04:24:34+09:00 Subject: Re: Rake as a library/API: possible? On May 13, 2009, at 04:11 , David Palm wrote: > Looking through the source code and trying out some stuff in irb I'm > getting the impression this usage was not considered at design > stage. But is it possible? > >>> a = Rake::Application.new > => #>> a.init > ...throws me out of IRB, as does "Rake::Application.new.run" I think the biggie is that Rake::Application is a singleton. % ruby -rubygems -e 'require "rake"; load "Rakefile"; p Rake.application.tasks.map { |t| t.name }.sort' ["announce", "audit", "autotest", "check_extra_deps", "check_manifest", "clean", "clobber", "clobber_docs", "clobber_package", "clobber_rcov", "config_hoe", "debug_gem", "default", "deps:email", "deps:fetch", "deps:list", "doc", "doc/ index.html", "docs", "email", "flay", "flog", "gem", "generate_key", "install_gem", "multi", "package", "pkg", "pkg/ZenTest-4.0.0", "pkg/ ZenTest-4.0.0.gem", "pkg/ZenTest-4.0.0.tgz", "post_blog", "post_news", "publish_docs", "publish_on_announce", "rcov", "rcov_info", "rcov_overlay", "redocs", "release", "repackage", "ridocs", "sort", "test", "test_deps", "update"]