Haven't been too active on the list lately. Buildr has been behaving itself
very well.
I have an advanced question.
This may have been covered, it seems obvious, but I haven't really seen this
one discussed.
I want to be able to have the option of running Buildr from within a Ruby
application, Chef recipe etc.
And yes, obviously I can exec it off as another process, but that seems
really lame since Buildr is in Ruby.
Hacking around a bit, I came up with the following, which fails on run
test.rb
====
require 'rubygems'
require 'buildr'
include Buildr
include Rake
include RakeFileUtils
app = Application.new
p app # yep object is there...
app.run #blows up
I have already created a buildfile in the same directory.
The error looks like this:
$ ruby test.rb
#<Buildr::Application:0x1015bee40 @on_completion=[], @tty_output=true,
@tasks={}, @default_loader=#<Rake::DefaultLoader:0x1015bec38>,
@rakefile=nil, @settings=#<Buildr::Settings:0x1015be8f0
@application=#<Buildr::Application:0x1015bee40 ...>>,
@loaders={".rake"=>#<Rake::DefaultLoader:0x1015bea30>,
".rf"=>#<Rake::DefaultLoader:0x1015bead0>,
".rb"=>#<Rake::DefaultLoader:0x1015beb70>}, @rakefiles=["buildfile",
"Buildfile", "buildfile.rb", "Buildfile.rb", "rakefile", "Rakefile",
"rakefile.rb", "Rakefile.rb"], @name="rake", @last_description=nil,
@home_dir="/Users/esmiley/.buildr", @top_level_tasks=[], @imported=[],
@on_failure=[], @rules=[], @original_dir="/Users/esmiley/testb", @scope=[],
@pending_imports=[]>
Buildr aborted!
TypeError : can't convert nil into String
/Library/Ruby/Gems/1.8/gems/buildr-1.4.3/lib/buildr/core/application.rb:171:in
`buildfile'
/Library/Ruby/Gems/1.8/gems/buildr-1.4.3/lib/buildr/core/application.rb:217:in
`load_buildfile'
/Library/Ruby/Gems/1.8/gems/buildr-1.4.3/lib/buildr/core/application.rb:213:in
`load_buildfile'