buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From as...@apache.org
Subject svn commit: r753130 - in /buildr/trunk: CHANGELOG lib/buildr.rb lib/buildr/java/cobertura.rb lib/buildr/java/emma.rb lib/buildr/java/rjb.rb lib/buildr/packaging/artifact_namespace.rb
Date Fri, 13 Mar 2009 05:49:12 GMT
Author: assaf
Date: Fri Mar 13 05:49:11 2009
New Revision: 753130

URL: http://svn.apache.org/viewvc?rev=753130&view=rev
Log:
Fixed: BUILDR-140 Get rid of const_defined? all across the board.

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr.rb
    buildr/trunk/lib/buildr/java/cobertura.rb
    buildr/trunk/lib/buildr/java/emma.rb
    buildr/trunk/lib/buildr/java/rjb.rb
    buildr/trunk/lib/buildr/packaging/artifact_namespace.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=753130&r1=753129&r2=753130&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Fri Mar 13 05:49:11 2009
@@ -30,6 +30,7 @@
 http://github.com/mojombo/jekyll/ This replaces Docter so less code to
 maintain and the same Textile/Liquid mechanism as when using Github pages.
 * Fixed:  Removed double complete/fail messages showing up on console.
+* Fixed:  BUILDR-140 Get rid of const_defined? all across the board.
 * Fixed:  BUILDR-158 Nailgun is now a delegate for buildr/drb (a pure-ruby dRuby server)
 * Fixed:  BUILDR-170 ArtifactNamespace#method_missing has a condition that is never true.
 * Fixed:  BUILDR-172 Scala compiler not loaded by default.

Modified: buildr/trunk/lib/buildr.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr.rb?rev=753130&r1=753129&r2=753130&view=diff
==============================================================================
--- buildr/trunk/lib/buildr.rb (original)
+++ buildr/trunk/lib/buildr.rb Fri Mar 13 05:49:11 2009
@@ -28,5 +28,8 @@
 # The Buildfile object (self) has access to all the Buildr methods and constants.
 class << self ; include Buildr ; end
 class Object #:nodoc:
-  Buildr.constants.each { |c| const_set c, Buildr.const_get(c) unless const_defined?(c) }
+  Buildr.constants.each do |name|
+    const = Buildr.const_get(name)
+    const_set name, const if const.is_a?(Module)
+  end
 end

Modified: buildr/trunk/lib/buildr/java/cobertura.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/cobertura.rb?rev=753130&r1=753129&r2=753130&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/cobertura.rb (original)
+++ buildr/trunk/lib/buildr/java/cobertura.rb Fri Mar 13 05:49:11 2009
@@ -42,7 +42,7 @@
     class << self
 
       REQUIRES = ["net.sourceforge.cobertura:cobertura:jar:1.9", "log4j:log4j:jar:1.2.9",
-        "asm:asm:jar:2.2.1", "asm:asm-tree:jar:2.2.1", "oro:oro:jar:2.0.8"] unless const_defined?('REQUIRES')
+        "asm:asm:jar:2.2.1", "asm:asm-tree:jar:2.2.1", "oro:oro:jar:2.0.8"]
 
       def requires()
         @requires ||= Buildr.artifacts(REQUIRES).each(&:invoke).map(&:to_s)

Modified: buildr/trunk/lib/buildr/java/emma.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/emma.rb?rev=753130&r1=753129&r2=753130&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/emma.rb (original)
+++ buildr/trunk/lib/buildr/java/emma.rb Fri Mar 13 05:49:11 2009
@@ -39,7 +39,7 @@
 
     class << self
 
-      REQUIRES = ['emma:emma_ant:jar:2.0.5312', 'emma:emma:jar:2.0.5312'] unless const_defined?('REQUIRES')
+      REQUIRES = ['emma:emma_ant:jar:2.0.5312', 'emma:emma:jar:2.0.5312']
 
       def requires()
         @requires ||= Buildr.artifacts(REQUIRES).each(&:invoke).map(&:to_s)

Modified: buildr/trunk/lib/buildr/java/rjb.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/rjb.rb?rev=753130&r1=753129&r2=753130&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/rjb.rb (original)
+++ buildr/trunk/lib/buildr/java/rjb.rb Fri Mar 13 05:49:11 2009
@@ -134,7 +134,7 @@
 
     def __package__(name) #:nodoc:
       const = name.split('.').map { |part| part.gsub(/^./) { |char| char.upcase } }.join
-      return const_get(const) if const_defined?(const)
+      return const_get(const) if constants.include?(const)
       package = Module.new
       package.extend Package
       package.instance_variable_set :@name, name

Modified: buildr/trunk/lib/buildr/packaging/artifact_namespace.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/packaging/artifact_namespace.rb?rev=753130&r1=753129&r2=753130&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/packaging/artifact_namespace.rb (original)
+++ buildr/trunk/lib/buildr/packaging/artifact_namespace.rb Fri Mar 13 05:49:11 2009
@@ -220,7 +220,7 @@
       # Forget all namespaces, create a new ROOT
       def clear
         @instances = nil
-        remove_const(:ROOT) if const_defined?(:ROOT)
+        remove_const(:ROOT) rescue nil
         const_set(:ROOT, new('root'))
       end
 



Mime
View raw message