Commit e221baad authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent 8230ce54
...@@ -135,14 +135,16 @@ begin ...@@ -135,14 +135,16 @@ begin
result = szFile.delete("\0".encode(Encoding::UTF_16LE)).encode(Encoding::UTF_8) result = szFile.delete("\0".encode(Encoding::UTF_16LE)).encode(Encoding::UTF_8)
if !result.empty? and File.file? result if !result.empty? and File.file? result
require 'pathname' require 'pathname'
result = Pathname.new(result).cleanpath result = Pathname.new(result).cleanpath.to_s.gsub('\\', '/')
Config['ygopro']['path'] = result Config['ygopro']['path'] = result
else else
exit exit
end end
else
require 'pathname'
Config['ygopro']['path'] = Pathname.new(Config['ygopro']['path']).cleanpath.to_s.gsub('\\', '/')
end end
def save_config(config=Config) def save_config(config=Config)
require 'json' require 'json'
open('config.json', 'w') { |f| JSON.dump config, f } open('config.json', 'w') { |f| JSON.dump config, f }
...@@ -264,6 +266,7 @@ an error occurs, please send your operation and message below to zh99998@gmail.c ...@@ -264,6 +266,7 @@ an error occurs, please send your operation and message below to zh99998@gmail.c
thumbnails_count = thumbnails_to_download.size thumbnails_count = thumbnails_to_download.size
images_count = images_to_download.size images_count = images_to_download.size
errors_count = 0 errors_count = 0
puts files.keys.join("\n")
batch_download(image_url.to_s, files, 'image/jpeg') { |http| batch_download(image_url.to_s, files, 'image/jpeg') { |http|
if http.req.path["thumbnail"] if http.req.path["thumbnail"]
thumbnails_count -= 1 thumbnails_count -= 1
...@@ -590,7 +593,7 @@ an error occurs, please send your operation and message below to zh99998@gmail.c ...@@ -590,7 +593,7 @@ an error occurs, please send your operation and message below to zh99998@gmail.c
def parse_path(path) def parse_path(path)
require 'fileutils' require 'fileutils'
require 'pathname' require 'pathname'
path = Pathname.new(path).cleanpath path = Pathname.new(path).cleanpath.to_s.gsub('\\', '/')
case File.extname(path) case File.extname(path)
when '.ydk' when '.ydk'
...@@ -652,7 +655,7 @@ an error occurs, please send your operation and message below to zh99998@gmail.c ...@@ -652,7 +655,7 @@ an error occurs, please send your operation and message below to zh99998@gmail.c
end end
end end
#monkey patch for exerb & addressable #monkey patch for exerb & addressable
if defined? ExerbRuntime if defined? ExerbRuntime
module Addressable module Addressable
module IDNA module IDNA
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment