buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From as...@apache.org
Subject svn commit: r753057 - in /buildr/trunk: CHANGELOG lib/buildr/packaging/artifact_namespace.rb spec/packaging/artifact_namespace_spec.rb
Date Thu, 12 Mar 2009 23:36:52 GMT
Author: assaf
Date: Thu Mar 12 23:36:52 2009
New Revision: 753057

URL: http://svn.apache.org/viewvc?rev=753057&view=rev
Log:
Fixed:  BUILDR-185 Exception if using artifact names with hyphen (Joel Muzzerall).

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/packaging/artifact_namespace.rb
    buildr/trunk/spec/packaging/artifact_namespace_spec.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=753057&r1=753056&r2=753057&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Thu Mar 12 23:36:52 2009
@@ -31,6 +31,8 @@
 * Fixed:  BUILDR-170 ArtifactNamespace#method_missing has a condition that is never true.
 * Fixed:  BUILDR-172 Scala compiler not loaded by default.
 * Fixed:  BUILDR-175 Fail to find child project when calling project method inside project
definition.
+* Fixed:  BUILDR-185 Exception if using artifact names with hyphen (Joel
+Muzzerall).
 * Fixed:  BUILDR-192 TestNG report results are overwritten (Alexis Midon).
 * Fixed:  BUILDR-193 TestNG uses project name for suite name (not valid file
           name on Windows).

Modified: buildr/trunk/lib/buildr/packaging/artifact_namespace.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/packaging/artifact_namespace.rb?rev=753057&r1=753056&r2=753057&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/packaging/artifact_namespace.rb (original)
+++ buildr/trunk/lib/buildr/packaging/artifact_namespace.rb Thu Mar 12 23:36:52 2009
@@ -737,7 +737,7 @@
     # Like Hash#fetch
     def fetch(name, default = nil, &block)
       block ||= lambda { raise IndexError.new("No artifact found by name #{name.inspect}
in namespace #{self}") }
-      real_name = name.to_s[/^\w+$/] ? name : ArtifactRequirement.unversioned_spec(name)
+      real_name = name.to_s[/^[\w\-\.]+$/] ? name : ArtifactRequirement.unversioned_spec(name)
       get(real_name.to_sym) || default || block.call(name)
     end
 
@@ -794,7 +794,7 @@
     def values_at(*names)
       names.map do |name| 
         catch :artifact do
-          unless name.to_s[/^\w+$/] 
+          unless name.to_s[/^[\w\-\.]+$/]
             unvers = ArtifactRequirement.unversioned_spec(name)
             unless unvers.to_s == name.to_s
               req = ArtifactRequirement.new(name)
@@ -812,7 +812,7 @@
     end
 
     def key?(name, include_parents = false)
-      name = ArtifactRequirement.unversioned_spec(name) unless name.to_s[/^\w+$/]
+      name = ArtifactRequirement.unversioned_spec(name) unless name.to_s[/^[\w\-\.]+$/]
       registry.key?(name, include_parents)
     end
 

Modified: buildr/trunk/spec/packaging/artifact_namespace_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/packaging/artifact_namespace_spec.rb?rev=753057&r1=753056&r2=753057&view=diff
==============================================================================
--- buildr/trunk/spec/packaging/artifact_namespace_spec.rb (original)
+++ buildr/trunk/spec/packaging/artifact_namespace_spec.rb Thu Mar 12 23:36:52 2009
@@ -281,6 +281,14 @@
       artifact_ns(:moo).foo_bar.should == artifact_ns(:foo).bar
     end
 
+    it 'should handle symbols with dashes and periods' do
+      [:'a-b', :'a.b'].each do |symbol|
+        artifact_ns.use symbol => 'a:b:c:1'
+        artifact_ns[symbol].version.should == '1'
+        artifact_ns[symbol].id.should == 'b'
+      end
+    end
+
   end
 
   describe '#values' do 



Mime
View raw message