buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject [6/8] buildr git commit: Prefer %w syntax
Date Mon, 20 Feb 2017 11:35:56 GMT
Prefer %w syntax


Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/db9a976f
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/db9a976f
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/db9a976f

Branch: refs/heads/master
Commit: db9a976fa6251fc5ca19b28a69bdb9e03862f3e9
Parents: 380bb92
Author: Peter Donald <peter@realityforge.org>
Authored: Mon Feb 20 21:10:51 2017 +1100
Committer: Peter Donald <peter@realityforge.org>
Committed: Mon Feb 20 22:34:41 2017 +1100

----------------------------------------------------------------------
 lib/buildr/scala/bdd.rb         | 2 +-
 lib/buildr/scala/compiler.rb    | 8 ++++----
 spec/packaging/artifact_spec.rb | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/db9a976f/lib/buildr/scala/bdd.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/scala/bdd.rb b/lib/buildr/scala/bdd.rb
index cacdf7e..c52e20f 100644
--- a/lib/buildr/scala/bdd.rb
+++ b/lib/buildr/scala/bdd.rb
@@ -133,7 +133,7 @@ module Buildr::Scala #:nodoc:
     end
 
     def tests(dependencies)
-      filter_classes(dependencies, :interfaces => ['org.specs2.Specification', 'org.specs2.mutable.Specification'])
+      filter_classes(dependencies, :interfaces => %w(org.specs2.Specification org.specs2.mutable.Specification))
     end
 
     def run(specs, dependencies)  #:nodoc:

http://git-wip-us.apache.org/repos/asf/buildr/blob/db9a976f/lib/buildr/scala/compiler.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/scala/compiler.rb b/lib/buildr/scala/compiler.rb
index 73ee7a5..172492a 100644
--- a/lib/buildr/scala/compiler.rb
+++ b/lib/buildr/scala/compiler.rb
@@ -117,7 +117,7 @@ module Buildr::Scala
 
       def dependencies
         scala_dependencies = if use_installed?
-          ['scala-library', 'scala-compiler'].map { |s| File.expand_path("lib/#{s}.jar",
scala_home) }
+          %w(scala-library scala-compiler).map { |s| File.expand_path("lib/#{s}.jar", scala_home)
}
         else
           REQUIRES.artifacts.map(&:to_s)
         end
@@ -282,9 +282,9 @@ module Buildr::Scala
       cmd_args += files_from_sources(sources)
 
       unless Buildr.application.options.dryrun
-        trace((['io.tmio.scalamain.Main', 'com.typesafe.zinc.Main', 'main'] + cmd_args).join('
'))
+        trace((%w(io.tmio.scalamain.Main com.typesafe.zinc.Main main) + cmd_args).join('
'))
         begin
-          Java::Commands.java 'io.tmio.scalamain.Main', *(['com.typesafe.zinc.Main', 'main']
+ cmd_args + [{ :classpath => Scalac.dependencies + [ File.join(File.dirname(__FILE__))
]}])
+          Java::Commands.java 'io.tmio.scalamain.Main', *(%w(com.typesafe.zinc.Main main)
+ cmd_args + [{:classpath => Scalac.dependencies + [File.join(File.dirname(__FILE__)) ]}])
         rescue => e
           fail "Zinc compiler crashed:\n#{e.inspect}\n#{e.backtrace.join("\n")}"
         end
@@ -306,7 +306,7 @@ module Buildr::Scala
 
         sources.each do |source|
           # try to extract package name from .java or .scala files
-          if ['.java', '.scala'].include? File.extname(source)
+          if %w(.java .scala).include? File.extname(source)
             name = File.basename(source).split(".")[0]
             package = findFirst(source, /^\s*package\s+([^\s;]+)\s*;?\s*/)
             packages = count(source, /^\s*package\s+([^\s;]+)\s*;?\s*/)

http://git-wip-us.apache.org/repos/asf/buildr/blob/db9a976f/spec/packaging/artifact_spec.rb
----------------------------------------------------------------------
diff --git a/spec/packaging/artifact_spec.rb b/spec/packaging/artifact_spec.rb
index 783eba0..d715919 100644
--- a/spec/packaging/artifact_spec.rb
+++ b/spec/packaging/artifact_spec.rb
@@ -1214,7 +1214,7 @@ end
 describe Buildr, '#transitive' do
   before do
     repositories.remote = 'http://buildr.apache.org/repository/noexist'
-    @simple = [ 'saxon:saxon:jar:8.4', 'saxon:saxon-dom:jar:8.4', 'saxon:saxon-xpath:jar:8.4'
]
+    @simple = %w(saxon:saxon:jar:8.4 saxon:saxon-dom:jar:8.4 saxon:saxon-xpath:jar:8.4)
     @simple.map { |spec| artifact(spec).pom }.each { |task| write task.name, task.pom_xml.call
}
     @provided = @simple.first
     @complex = 'group:app:jar:1.0'


Mime
View raw message