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 it "renders a few examples correctly" do
rule = Rule.new "[Ch. {chapter }] {title | id} testing" rule = Rule.new "[Ch. {chapter }] {title | id} testing"
rule.render({"id" => "ID"}).should eq "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" rule.render({} of String => String).should eq "testing"
end end
end end

View File

@ -11,7 +11,9 @@ class UploadHandler < Kemal::Handler
return call_next env return call_next env
end 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 ary[0] = @upload_dir
path = File.join ary path = File.join ary

View File

@ -141,7 +141,8 @@ module MangaDex
end end
def initialize 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 @lang = {} of String => String
CSV.each_row {{read_file "src/assets/lang_codes.csv"}} do |row| CSV.each_row {{read_file "src/assets/lang_codes.csv"}} do |row|
@lang[row[1]] = row[0] @lang[row[1]] = row[0]

View File

@ -19,7 +19,8 @@ OptionParser.parse do |parser|
exit exit
end end
parser.on "-c PATH", "--config=PATH", 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 config_path = path
end end
end end

View File

@ -85,8 +85,8 @@ module Rename
raise "unmatched ] at position #{i}" raise "unmatched ] at position #{i}"
end end
if !pattern.nil? if !pattern.nil?
raise "patterns (`{}`) should be closed before closing the group " \ raise "patterns (`{}`) should be closed before closing the " \
"(`[]`)" "group (`[]`)"
end end
@ary.push group @ary.push group
group = nil group = nil