diff --git a/spec/compiler/codegen/macro_spec.cr b/spec/compiler/codegen/macro_spec.cr index 5bd1ba94aab9..42a3298988b6 100644 --- a/spec/compiler/codegen/macro_spec.cr +++ b/spec/compiler/codegen/macro_spec.cr @@ -554,7 +554,7 @@ describe "Code gen: macro" do @x = 1; @x = 1.1 end def foo - {{ @type.instance_vars.first.type.union_types.map(&.name).sort }}.join("-") + {{ @type.instance_vars.first.type.union_types.map(&.name).sort }}.join('-') end end Foo.new.foo @@ -599,7 +599,7 @@ describe "Code gen: macro" do require "prelude" class Foo(T, K) def self.foo : String - {{ @type.type_vars.map(&.stringify) }}.join("-") + {{ @type.type_vars.map(&.stringify) }}.join('-') end end Foo.foo @@ -693,7 +693,7 @@ describe "Code gen: macro" do end names = {{ Foo.subclasses.map &.name }} - names.join("-") + names.join('-') )).to_string.should eq("Bar-Baz") end @@ -711,7 +711,7 @@ describe "Code gen: macro" do end names = {{ Foo.all_subclasses.map &.name }} - names.join("-") + names.join('-') )).to_string.should eq("Bar-Baz") end diff --git a/spec/compiler/macro/macro_methods_spec.cr b/spec/compiler/macro/macro_methods_spec.cr index e1ba3e8ca6b6..4b932b37065e 100644 --- a/spec/compiler/macro/macro_methods_spec.cr +++ b/spec/compiler/macro/macro_methods_spec.cr @@ -252,7 +252,7 @@ describe "macro methods" do end it "executes split with argument" do - assert_macro "", %({{"1-2-3".split("-")}}), [] of ASTNode, %(["1", "2", "3"] of ::String) + assert_macro "", %({{"1-2-3".split('-')}}), [] of ASTNode, %(["1", "2", "3"] of ::String) end it "executes split with char argument" do diff --git a/spec/std/file_spec.cr b/spec/std/file_spec.cr index f48e81e70514..65de5d0c3624 100644 --- a/spec/std/file_spec.cr +++ b/spec/std/file_spec.cr @@ -565,7 +565,7 @@ describe "File" do it "converts a pathname to an absolute pathname, using ~ (home) as base" do File.expand_path("~/").should eq(home) File.expand_path("~/..badfilename").should eq(File.join(home, "..badfilename")) - File.expand_path("..").should eq("/#{base.split("/")[0...-1].join("/")}".gsub(%r{\A//}, "/")) + File.expand_path("..").should eq("/#{base.split('/')[0...-1].join('/')}".gsub(%r{\A//}, "/")) File.expand_path("~/a", "~/b").should eq(File.join(home, "a")) File.expand_path("~").should eq(home) File.expand_path("~", "/tmp/gumby/ddd").should eq(home) @@ -578,7 +578,7 @@ describe "File" do ENV["HOME"] = __DIR__ + "/" File.expand_path("~/").should eq(home) File.expand_path("~/..badfilename").should eq(File.join(home, "..badfilename")) - File.expand_path("..").should eq("/#{base.split("/")[0...-1].join("/")}".gsub(%r{\A//}, "/")) + File.expand_path("..").should eq("/#{base.split('/')[0...-1].join('/')}".gsub(%r{\A//}, "/")) File.expand_path("~/a", "~/b").should eq(File.join(home, "a")) File.expand_path("~").should eq(home) File.expand_path("~", "/tmp/gumby/ddd").should eq(home) @@ -594,7 +594,7 @@ describe "File" do ENV["HOME"] = "/" File.expand_path("~/").should eq(home) File.expand_path("~/..badfilename").should eq(File.join(home, "..badfilename")) - File.expand_path("..").should eq("/#{base.split("/")[0...-1].join("/")}".gsub(%r{\A//}, "/")) + File.expand_path("..").should eq("/#{base.split('/')[0...-1].join('/')}".gsub(%r{\A//}, "/")) File.expand_path("~/a", "~/b").should eq(File.join(home, "a")) File.expand_path("~").should eq(home) File.expand_path("~", "/tmp/gumby/ddd").should eq(home) diff --git a/spec/std/string_spec.cr b/spec/std/string_spec.cr index 916024d73aed..ff25a78d35d6 100644 --- a/spec/std/string_spec.cr +++ b/spec/std/string_spec.cr @@ -870,7 +870,7 @@ describe "String" do it { "foo ".split(' ').should eq(["foo", "", "", ""]) } it { " foo bar".split(' ').should eq(["", "", "", "foo", "", "bar"]) } it { " foo bar\n\t baz ".split(' ').should eq(["", "", "", "foo", "", "", "bar\n\t", "", "baz", "", "", ""]) } - it { " foo bar\n\t baz ".split(" ").should eq(["", "", "", "foo", "", "", "bar\n\t", "", "baz", "", "", ""]) } + it { " foo bar\n\t baz ".split(' ').should eq(["", "", "", "foo", "", "", "bar\n\t", "", "baz", "", "", ""]) } it { "foo,bar,baz,qux".split(',', 1).should eq(["foo,bar,baz,qux"]) } it { "foo,bar,baz,qux".split(',', 3).should eq(["foo", "bar", "baz,qux"]) } it { "foo,bar,baz,qux".split(',', 30).should eq(["foo", "bar", "baz", "qux"]) } diff --git a/src/compiler/crystal/command.cr b/src/compiler/crystal/command.cr index ac1b64c74b7a..70a853071b6c 100644 --- a/src/compiler/crystal/command.cr +++ b/src/compiler/crystal/command.cr @@ -313,7 +313,7 @@ class Crystal::Command end unless no_codegen - opts.on("--emit [#{VALID_EMIT_VALUES.join("|")}]", "Comma separated list of types of output for the compiler to emit") do |emit_values| + opts.on("--emit [#{VALID_EMIT_VALUES.join('|')}]", "Comma separated list of types of output for the compiler to emit") do |emit_values| compiler.emit = validate_emit_values(emit_values.split(',').map(&.strip)) end end @@ -426,7 +426,7 @@ class Crystal::Command end end - compiler.link_flags = link_flags.join(" ") unless link_flags.empty? + compiler.link_flags = link_flags.join(' ') unless link_flags.empty? output_filename = opt_output_filename filenames += opt_filenames.not_nil! diff --git a/src/compiler/crystal/config.cr b/src/compiler/crystal/config.cr index d6fb907fa275..7b230ac05c3f 100644 --- a/src/compiler/crystal/config.cr +++ b/src/compiler/crystal/config.cr @@ -46,7 +46,7 @@ module Crystal # On release: 0.0.0-0-gabcd123 # Ahead of last release: 0.0.0-42-gabcd123 - tag, commits, sha = git_version.split("-") + tag, commits, sha = git_version.split('-') sha = sha[1..-1] # Strip g tag = "#{tag}+#{commits}" unless commits == "0" # Reappend commits since release unless we hit it exactly diff --git a/src/compiler/crystal/semantic/bindings.cr b/src/compiler/crystal/semantic/bindings.cr index f63b6b40fc2c..247f3c7d8e38 100644 --- a/src/compiler/crystal/semantic/bindings.cr +++ b/src/compiler/crystal/semantic/bindings.cr @@ -504,7 +504,7 @@ module Crystal end if types.size > 300 - raise "tuple too big: Tuple(#{types[0...10].join(",")}, ...)" + raise "tuple too big: Tuple(#{types[0...10].join(',')}, ...)" end self.type = tuple_type diff --git a/src/compiler/crystal/tools/init.cr b/src/compiler/crystal/tools/init.cr index 5b0d771f6203..aa65d1e79264 100644 --- a/src/compiler/crystal/tools/init.cr +++ b/src/compiler/crystal/tools/init.cr @@ -198,7 +198,7 @@ module Crystal end def module_name - config.name.split("-").map(&.camelcase).join("::") + config.name.split('-').map(&.camelcase).join("::") end abstract def full_path diff --git a/src/crypto/bcrypt/password.cr b/src/crypto/bcrypt/password.cr index 8c0d8a5b64f0..7e80965dd162 100644 --- a/src/crypto/bcrypt/password.cr +++ b/src/crypto/bcrypt/password.cr @@ -39,7 +39,7 @@ class Crypto::Bcrypt::Password # password.digest # => "8/Po4wTL0fhdDNdAdjcKN/Fup8tGCya" # ``` def initialize(@raw_hash : String) - parts = @raw_hash.split("$") + parts = @raw_hash.split('$') @version = parts[1] @cost = parts[2].to_i diff --git a/src/option_parser.cr b/src/option_parser.cr index 6aa254cebd0a..f7ea548d9b8a 100644 --- a/src/option_parser.cr +++ b/src/option_parser.cr @@ -250,7 +250,7 @@ class OptionParser end private def process_double_flag(flag, block, raise_if_missing = false) - while index = args_index { |arg| arg.split("=")[0] == flag } + while index = args_index { |arg| arg.split('=')[0] == flag } arg = @args[index] if arg.size == flag.size delete_arg_at_index(index) diff --git a/src/regex.cr b/src/regex.cr index 741c9a1935b8..dfab7a2270a7 100644 --- a/src/regex.cr +++ b/src/regex.cr @@ -301,7 +301,7 @@ class Regex # re.match("sledding") # => # # ``` def self.union(patterns : Enumerable(Regex | String)) : self - new patterns.map { |pattern| union_part pattern }.join("|") + new patterns.map { |pattern| union_part pattern }.join('|') end # Union. Returns a `Regex` that matches any of *patterns*. diff --git a/src/semantic_version.cr b/src/semantic_version.cr index cf0837f373e5..82d162dd1dff 100644 --- a/src/semantic_version.cr +++ b/src/semantic_version.cr @@ -64,7 +64,7 @@ class SemanticVersion struct Prerelease def self.parse(str : String) : self identifiers = [] of String | Int32 - str.split(".").each do |val| + str.split('.').each do |val| if val.match /^\d+$/ identifiers << val.to_i32 else