You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by dj...@apache.org on 2009/06/23 02:02:58 UTC
svn commit: r787466 - /buildr/trunk/lib/buildr/shell.rb
Author: djspiewak
Date: Tue Jun 23 00:02:57 2009
New Revision: 787466
URL: http://svn.apache.org/viewvc?rev=787466&view=rev
Log:
Added special :none language for shells
Modified:
buildr/trunk/lib/buildr/shell.rb
Modified: buildr/trunk/lib/buildr/shell.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/shell.rb?rev=787466&r1=787465&r2=787466&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/shell.rb (original)
+++ buildr/trunk/lib/buildr/shell.rb Tue Jun 23 00:02:57 2009
@@ -3,7 +3,13 @@
class << self
def add(p)
@providers ||= {}
- @providers[p.lang] = p
+
+ if p.lang == :none
+ @providers[:none] ||= []
+ @providers[:none] << p
+ else
+ @providers[p.lang] = p
+ end
end
alias :<< :add
@@ -22,11 +28,19 @@
before_define do |project|
ShellProviders.providers.each do |lang, p|
- name = p.to_sym
+ load_provider = proc do |prov|
+ name = prov.to_sym
+
+ project.task "shell:#{name}" => :compile do
+ trace "Launching #{name} shell"
+ prov.new(project).launch
+ end
+ end
- project.task "shell:#{name}" => :compile do
- trace "Launching #{name} shell"
- p.new(project).launch
+ if lang == :none
+ p.each load_provider
+ else
+ load_provider.call p
end
end
end
@@ -51,6 +65,10 @@
attr_reader :project
class << self
+ def lang
+ :none
+ end
+
def to_sym
@symbol ||= name.split('::').last.downcase.to_sym
end