Commit 5a87a77c authored by zh99998's avatar zh99998

0.6.6 URL protocol

parent 709a9dbb
/nbproject/
/.idea/
/ruby/
/pkg/
/config.yml
......
......@@ -7,10 +7,6 @@ require 'rdoc/task'
#require 'rake/testtask'
Windows = RUBY_PLATFORM["mingw"] || RUBY_PLATFORM["mswin"]
if Windows
STDOUT.set_encoding "GBK", "UTF-8"
STDERR.set_encoding "GBK", "UTF-8"
end
#在windows上UTF-8脚本编码环境中 Dir.glob无法列出中文目录下的文件 所以自己写个递归
def list(path)
result = []
......@@ -24,7 +20,7 @@ end
spec = Gem::Specification.new do |s|
s.name = 'mycard'
s.version = '0.6.4'
s.version = '0.6.6'
s.extra_rdoc_files = ['README.txt', 'LICENSE.txt']
s.summary = 'a card game'
s.description = s.summary
......
#!/usr/bin/env ruby
p ARGV
STDIN.gets
begin
#定义全局方法
def load_config(file="config.yml")
......@@ -19,8 +17,10 @@ begin
if RUBY_PLATFORM["win"] || RUBY_PLATFORM["ming"]
require 'win32/registry'
pwd = Dir.pwd.gsub('/', '\\')
path = '"' + pwd + '\ruby\bin\ruby.exe" -C"' + pwd + '" -KU lib/main.rb'
path = '"' + pwd + '\ruby\bin\rubyw.exe" -C"' + pwd + '" -KU lib/main.rb'
command = path + ' "%1"'
path.replace path.ljust path.bytesize
command.replace command.ljust command.bytesize
Win32::Registry::HKEY_CLASSES_ROOT.create('mycard'){|reg|reg['URL Protocol'] = path unless (reg['URL Protocol'] == path rescue false)}
Win32::Registry::HKEY_CLASSES_ROOT.create('mycard\shell\open\command'){|reg|reg[nil] = command unless (reg[nil] == command rescue false)}
end
......@@ -36,8 +36,6 @@ begin
log_level = "INFO"
profile = nil
ARGV.each do |arg|
p arg
STDIN.gets
case arg.dup.force_encoding("UTF-8")
when /--log=(.*)/
log.replace $1
......@@ -74,7 +72,6 @@ begin
require 'logger'
if log == "STDOUT" #调试用
log = STDOUT
STDOUT.set_encoding "GBK", "UTF-8", :invalid => :replace, :undef => :replace if RUBY_PLATFORM["win"] || RUBY_PLATFORM["ming"]
end
$log = Logger.new(log)
$log.level = Logger.const_get log_level
......
......@@ -4,11 +4,7 @@ require_relative 'room'
require_relative 'ygocore/game'
$game = Ygocore.new
p 1
STDIN.gets
uri = URI.unescape URI.unescape ARGV.first[9, ARGV.first.size-9]
p uri
STDIN.gets
case uri
when /^(.*\.yrp)$/
require 'open-uri'
......@@ -29,8 +25,6 @@ when /^(.*\.ydk)$/
}
Ygocore.run_ygocore(File.basename($1, '.ydk'), true)
when /^(?:(.*)\:(.*)\@)?(.*)\:(\d+)\/(.*)$/
p $1
STDIN.gets
require 'uri'
$game.user = User.new($1.to_sym, $1) if $1
$game.password = $2 if $2
......
......@@ -2,7 +2,7 @@ require 'open-uri'
require "fileutils"
require_relative 'card'
module Update
Version = '0.6.4'
Version = '0.6.6'
URL = "http://card.touhou.cc/mycard/update.json?version=#{Version}"
class <<self
attr_reader :thumbnails, :images, :status
......
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