Author: boisvert
Date: Tue Oct 19 16:47:03 2010
New Revision: 1024320
URL: http://svn.apache.org/viewvc?rev=1024320&view=rev
Log:
Fix Run::Base.to_sym for case where specify :name => :foo isn't used
Cleanup runner? method.
Modified:
buildr/trunk/lib/buildr/run.rb
Modified: buildr/trunk/lib/buildr/run.rb
URL:
http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/run.rb?rev=1024320&r1=1024319&r2=1024320&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/run.rb (original)
+++ buildr/trunk/lib/buildr/run.rb Tue Oct 19 16:47:03 2010
@@ -43,15 +43,15 @@ module Buildr
attr_reader :project
class << self
- attr_accessor :name, :languages
+ attr_accessor :runner_name, :languages
def specify(options)
- @name ||= options[:name]
+ @runner_name ||= options[:name]
@languages ||= options[:languages]
end
def to_sym
- @name ||= name.split('::').last.downcase.to_sym
+ @runner_name || name.split('::').last.downcase.to_sym
end
end
@@ -128,19 +128,8 @@ module Buildr
@runner ||= guess_runner
end
- # :call-seq:
- # runner?(clazz) => boolean
- #
- # Check if the underlying runner is an instance of the given class.
- # If no class is supplied, simply check if runner is defined.
- def runner?(clazz = nil)
- begin
- @runner ||= guess_runner if project.compile.language
- rescue
- return false
- end
- return [email protected]? unless clazz
- @runner.is_a?(clazz) if @runner
+ def runner?
+ @runner ||= guess_runner if project.compile.language rescue nil
end
def run