diff --git a/spec/rename_spec.cr b/spec/rename_spec.cr index 87bf302..6108974 100644 --- a/spec/rename_spec.cr +++ b/spec/rename_spec.cr @@ -64,7 +64,8 @@ describe Rule do it "renders a few examples correctly" do rule = Rule.new "[Ch. {chapter }] {title | id} testing" rule.render({"id" => "ID"}).should eq "ID testing" - rule.render({"chapter" => "CH", "id" => "ID"}).should eq "Ch. CH ID testing" + rule.render({"chapter" => "CH", "id" => "ID"}) + .should eq "Ch. CH ID testing" rule.render({} of String => String).should eq "testing" end end diff --git a/src/handlers/upload_handler.cr b/src/handlers/upload_handler.cr index a6db8b4..0846814 100644 --- a/src/handlers/upload_handler.cr +++ b/src/handlers/upload_handler.cr @@ -11,7 +11,9 @@ class UploadHandler < Kemal::Handler return call_next env end - ary = env.request.path.split(File::SEPARATOR).select { |part| !part.empty? } + ary = env.request.path.split(File::SEPARATOR).select do |part| + !part.empty? + end ary[0] = @upload_dir path = File.join ary diff --git a/src/mangadex/api.cr b/src/mangadex/api.cr index 8161ac5..18462bd 100644 --- a/src/mangadex/api.cr +++ b/src/mangadex/api.cr @@ -141,7 +141,8 @@ module MangaDex end def initialize - @base_url = Config.current.mangadex["api_url"].to_s || "https://mangadex.org/api/" + @base_url = Config.current.mangadex["api_url"].to_s || + "https://mangadex.org/api/" @lang = {} of String => String CSV.each_row {{read_file "src/assets/lang_codes.csv"}} do |row| @lang[row[1]] = row[0] diff --git a/src/mango.cr b/src/mango.cr index 4c3a100..b8ca7d1 100644 --- a/src/mango.cr +++ b/src/mango.cr @@ -19,7 +19,8 @@ OptionParser.parse do |parser| exit end parser.on "-c PATH", "--config=PATH", - "Path to the config file. Default is `~/.config/mango/config.yml`" do |path| + "Path to the config file. " \ + "Default is `~/.config/mango/config.yml`" do |path| config_path = path end end diff --git a/src/rename.cr b/src/rename.cr index af115e6..3aefcef 100644 --- a/src/rename.cr +++ b/src/rename.cr @@ -85,8 +85,8 @@ module Rename raise "unmatched ] at position #{i}" end if !pattern.nil? - raise "patterns (`{}`) should be closed before closing the group " \ - "(`[]`)" + raise "patterns (`{}`) should be closed before closing the " \ + "group (`[]`)" end @ary.push group group = nil