Prefer single quotes

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

Branch: refs/heads/master
Commit: 380bb927b87f72ced4ff96e829e4f4e13a726057
Parents: 59eb77a
Author: Peter Donald <[email protected]>
Authored: Mon Feb 20 13:55:57 2017 +1100
Committer: Peter Donald <[email protected]>
Committed: Mon Feb 20 22:34:29 2017 +1100

----------------------------------------------------------------------
 addon/buildr/bnd.rb              |  6 +++---
 lib/buildr/java/packaging.rb     |  7 +++----
 lib/buildr/packaging/artifact.rb |  2 +-
 lib/buildr/scala/bdd.rb          | 32 ++++++++++++++++----------------
 lib/buildr/scala/compiler.rb     | 24 ++++++++++++------------
 5 files changed, 35 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/380bb927/addon/buildr/bnd.rb
----------------------------------------------------------------------
diff --git a/addon/buildr/bnd.rb b/addon/buildr/bnd.rb
index f709c24..fa8c331 100644
--- a/addon/buildr/bnd.rb
+++ b/addon/buildr/bnd.rb
@@ -101,14 +101,14 @@ module Buildr
           bnd_filename = filename.sub /(\.jar)?$/, '.bnd'
 
           params = self.to_params
-          params["-output"] = filename
+          params['-output'] = filename
           File.open(bnd_filename, 'w') do |f|
             f.print params.collect { |k, v| "#{k}=#{v}" }.join("\n")
           end
 
           Buildr::Bnd.bnd_main( bnd_filename )
           begin
-            Buildr::Bnd.bnd_main( "print", "-verify", filename )
+            Buildr::Bnd.bnd_main('print', '-verify', filename )
           rescue => e
             rm filename
             raise e
@@ -127,7 +127,7 @@ module Buildr
 
       def package_as_bundle(filename)
         project.task('bnd:print' => [filename]) do |task|
-          Buildr::Bnd.bnd_main("print", filename)
+          Buildr::Bnd.bnd_main('print', filename)
         end
 
         dirname = File.dirname(filename)

http://git-wip-us.apache.org/repos/asf/buildr/blob/380bb927/lib/buildr/java/packaging.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/java/packaging.rb b/lib/buildr/java/packaging.rb
index 841c9fe..86a764c 100644
--- a/lib/buildr/java/packaging.rb
+++ b/lib/buildr/java/packaging.rb
@@ -223,11 +223,10 @@ module Buildr #:nodoc:
         #   package(:jar).with(:manifest=>'MANIFEST_MF')
         def with(*args)
           super args.pop if Hash === args.last
-          fail "package.with() should not contain nil values" if args.include? 
nil
+          fail 'package.with() should not contain nil values' if args.include? 
nil
           include :from=>args if args.size > 0
           self
         end
-
       end
 
 
@@ -521,8 +520,8 @@ module Buildr #:nodoc:
           buffer = ""
           xml = Builder::XmlMarkup.new(:target=>buffer, :indent => 2)
           xml.declare! :DOCTYPE, :application, :PUBLIC,
-          "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN",
-          "http://java.sun.com/j2ee/dtds/application_1_2.dtd";
+                       '-//Sun Microsystems, Inc.//DTD J2EE Application 
1.2//EN',
+                       'http://java.sun.com/j2ee/dtds/application_1_2.dtd'
           xml.application do
             xml.tag! 'display-name', display_name
             desc = self.description || @project.comment

http://git-wip-us.apache.org/repos/asf/buildr/blob/380bb927/lib/buildr/packaging/artifact.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/packaging/artifact.rb b/lib/buildr/packaging/artifact.rb
index f71c5f0..e417273 100644
--- a/lib/buildr/packaging/artifact.rb
+++ b/lib/buildr/packaging/artifact.rb
@@ -35,7 +35,7 @@ module Buildr #:nodoc:
   module ActsAsArtifact
 
     ARTIFACT_ATTRIBUTES = [:group, :id, :type, :classifier, :version]
-    MAVEN_METADATA = "maven-metadata.xml"
+    MAVEN_METADATA = 'maven-metadata.xml'
 
     class << self
     private

http://git-wip-us.apache.org/repos/asf/buildr/blob/380bb927/lib/buildr/scala/bdd.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/scala/bdd.rb b/lib/buildr/scala/bdd.rb
index edc1358..cacdf7e 100644
--- a/lib/buildr/scala/bdd.rb
+++ b/lib/buildr/scala/bdd.rb
@@ -20,11 +20,11 @@ module Buildr::Scala #:nodoc:
     @bdd_dir = :spec
 
     VERSION = case
-      when Buildr::Scala.version?("2.8.0"),  Buildr::Scala.version?("2.8.1"), 
Buildr::Scala.version?("2.8.2")
+      when Buildr::Scala.version?('2.8.0'),  Buildr::Scala.version?('2.8.1'), 
Buildr::Scala.version?('2.8.2')
         '1.5'
-      when Buildr::Scala.version?("2.9")
+      when Buildr::Scala.version?('2.9')
         '1.11'
-      when  Buildr::Scala.version?("2.10")
+      when  Buildr::Scala.version?('2.10')
         '1.12.3'
       else
         '3.7' # default for Scala 2.11 and beyond
@@ -46,7 +46,7 @@ module Buildr::Scala #:nodoc:
           when Buildr.settings.build['scala.specs2.artifact']
             Buildr.settings.build['scala.specs2.artifact']
           else
-            if Buildr::Scala.version < "2.11"
+            if Buildr::Scala.version < '2.11'
               "specs2_#{Buildr::Scala.version_without_build_number}"
             else
               "specs2_#{Buildr::Scala.version_major_minor}"
@@ -55,18 +55,18 @@ module Buildr::Scala #:nodoc:
       end
 
       def type
-        if Buildr::Scala.version < "2.11"
-          "jar"
+        if Buildr::Scala.version < '2.11'
+          'jar'
         else
-          "pom"
+          'pom'
         end
       end
 
       def scalaz_dependencies
-        if Buildr::Scala.version?("2.8")
+        if Buildr::Scala.version?('2.8')
           []
-        elsif Buildr::Scala.version < "2.11"
-          default_version = "6.0.1"
+        elsif Buildr::Scala.version < '2.11'
+          default_version = '6.0.1'
           custom_version = Buildr.settings.build['scala.specs2-scalaz']
           version = (custom_version =~ /:/) ? 
Buildr.artifact(custom_version).version : default_version
 
@@ -74,9 +74,9 @@ module Buildr::Scala #:nodoc:
 
           custom_spec = Buildr.settings.build['scala.specs2-scalaz']
           spec = [ (custom_spec =~ /:/) ? custom_spec : 
"org.specs2:#{artifact}:jar:#{version}" ]
-          Buildr.transitive(spec, :scopes => [nil, "compile", "runtime", 
"provided", "optional"], :optional => true)
+          Buildr.transitive(spec, :scopes => [nil, 'compile', 'runtime', 
'provided', 'optional'], :optional => true)
         else
-          default_version = "7.2.2"
+          default_version = '7.2.2'
           custom_version = Buildr.settings.build['scala.specs2-scalaz']
           version = (custom_version =~ /:/) ? 
Buildr.artifact(custom_version).version : default_version
 
@@ -84,7 +84,7 @@ module Buildr::Scala #:nodoc:
 
           custom_spec = Buildr.settings.build['scala.specs2-scalaz']
           spec = [ (custom_spec =~ /:/) ? custom_spec : 
"org.scalaz:#{artifact}:jar:#{version}" ]
-          [Buildr.transitive(spec, :scopes => [nil, "compile", "runtime", 
"provided", "optional"], :optional => true), 
"org.scala-lang.modules:scala-xml_2.11:jar:1.0.1"]
+          [Buildr.transitive(spec, :scopes => [nil, 'compile', 'runtime', 
'provided', 'optional'], :optional => true), 
'org.scala-lang.modules:scala-xml_2.11:jar:1.0.1']
         end
       end
 
@@ -94,7 +94,7 @@ module Buildr::Scala #:nodoc:
 
           # Add utility classes and other dependencies
           options = {
-            :scopes => [nil, "compile", "runtime", "provided", "optional"],
+            :scopes => [nil, 'compile', 'runtime', 'provided', 'optional'],
             :optional => true
           }
           @dependencies |= [ File.join(File.dirname(__FILE__)) ] + 
Buildr.transitive(specs, options) +
@@ -113,7 +113,7 @@ module Buildr::Scala #:nodoc:
     private
 
       def find(file, pattern)
-        File.open(file, "r") do |infile|
+        File.open(file, 'r') do |infile|
           while (line = infile.gets)
             return true if line.match(pattern)
           end
@@ -137,7 +137,7 @@ module Buildr::Scala #:nodoc:
     end
 
     def run(specs, dependencies)  #:nodoc:
-      properties = { "specs2.outDir" => task.compile.target.to_s }
+      properties = {'specs2.outDir' => task.compile.target.to_s }
 
       cmd_options = { :properties => options[:properties].merge(properties),
                       :java_args => options[:java_args],

http://git-wip-us.apache.org/repos/asf/buildr/blob/380bb927/lib/buildr/scala/compiler.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/scala/compiler.rb b/lib/buildr/scala/compiler.rb
index dcaa8e3..73ee7a5 100644
--- a/lib/buildr/scala/compiler.rb
+++ b/lib/buildr/scala/compiler.rb
@@ -20,7 +20,7 @@ module Buildr::Scala
   class << self
 
     def version_str
-      warn "Use of Scala.version_str is deprecated.  Use Scala.version instead"
+      warn 'Use of Scala.version_str is deprecated. Use Scala.version instead'
       version
     end
 
@@ -128,7 +128,7 @@ module Buildr::Scala
       end
 
       def use_fsc
-        use_installed? && ENV["USE_FSC"] =~ /^(yes|on|true)$/i
+        use_installed? && ENV['USE_FSC'] =~ /^(yes|on|true)$/i
       end
 
       def applies_to?(project, task) #:nodoc:
@@ -275,7 +275,7 @@ module Buildr::Scala
       cmd_args << '-Ssourcepath' << ("-S" + 
source_paths.join(File::PATH_SEPARATOR)) unless source_paths.empty?
       cmd_args << '-d' << File.expand_path(target)
       cmd_args += scalac_args
-      cmd_args << "-debug" if trace?(:scalac)
+      cmd_args << '-debug' if trace?(:scalac)
 
       cmd_args.map!(&:to_s)
 
@@ -341,7 +341,7 @@ module Buildr::Scala
 
     def count(file, pattern)
       count = 0
-      File.open(file, "r") do |infile|
+      File.open(file, 'r') do |infile|
         while (line = infile.gets)
           count += 1 if line.match(pattern)
         end
@@ -357,19 +357,19 @@ module Buildr::Scala
     # Returns Scalac command line arguments from the set of options.
     def scalac_args #:nodoc:
       args = []
-      args << "-nowarn" unless options[:warnings]
-      args << "-verbose" if trace?(:scalac)
-      if options[:debug] == true
-        args << (Scala.version?(2.7, 2.8) ? "-g" : "-g:vars")
+      args << '-nowarn' unless options[:warnings]
+      args << '-verbose' if trace?(:scalac)
+      if !!options[:debug]
+        args << (Scala.version?(2.7, 2.8) ? '-g' : '-g:vars')
       elsif options[:debug]
         args << "-g:#{options[:debug]}"
       end
-      args << "-deprecation" if options[:deprecation]
-      args << "-optimise" if options[:optimise]
-      args << "-target:jvm-" + options[:target].to_s if options[:target]
+      args << '-deprecation' if options[:deprecation]
+      args << '-optimise' if options[:optimise]
+      args << '-target:jvm-' + options[:target].to_s if options[:target]
       args += Array(options[:other])
       if zinc?
-        args.map { |arg| "-S" + arg } + Array(options[:zinc_options])
+        args.map { |arg| '-S' + arg } + Array(options[:zinc_options])
       else
         args
       end

Reply via email to