Fix long lines

This commit is contained in:
Alex Ling 2020-05-05 05:45:20 +00:00
parent c3608c101b
commit 049bd3ab2c
5 changed files with 11 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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]

View File

@ -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

View File

@ -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