Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
syntax_j
mycard
Commits
5a87a77c
Commit
5a87a77c
authored
Jun 03, 2012
by
zh99998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.6.6 URL protocol
parent
709a9dbb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
225 additions
and
237 deletions
+225
-237
.gitignore
.gitignore
+1
-0
Rakefile
Rakefile
+64
-68
lib/main.rb
lib/main.rb
+126
-129
lib/quickstart.rb
lib/quickstart.rb
+33
-39
lib/update.rb
lib/update.rb
+1
-1
No files found.
.gitignore
View file @
5a87a77c
/nbproject/
/nbproject/
/.idea/
/ruby/
/ruby/
/pkg/
/pkg/
/config.yml
/config.yml
...
...
Rakefile
View file @
5a87a77c
...
@@ -7,10 +7,6 @@ require 'rdoc/task'
...
@@ -7,10 +7,6 @@ require 'rdoc/task'
#require 'rake/testtask'
#require 'rake/testtask'
Windows
=
RUBY_PLATFORM
[
"mingw"
]
||
RUBY_PLATFORM
[
"mswin"
]
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无法列出中文目录下的文件 所以自己写个递归
#在windows上UTF-8脚本编码环境中 Dir.glob无法列出中文目录下的文件 所以自己写个递归
def
list
(
path
)
def
list
(
path
)
result
=
[]
result
=
[]
...
@@ -24,7 +20,7 @@ end
...
@@ -24,7 +20,7 @@ end
spec
=
Gem
::
Specification
.
new
do
|
s
|
spec
=
Gem
::
Specification
.
new
do
|
s
|
s
.
name
=
'mycard'
s
.
name
=
'mycard'
s
.
version
=
'0.6.
4'
s
.
version
=
'0.6.
6'
s
.
extra_rdoc_files
=
[
'README.txt'
,
'LICENSE.txt'
]
s
.
extra_rdoc_files
=
[
'README.txt'
,
'LICENSE.txt'
]
s
.
summary
=
'a card game'
s
.
summary
=
'a card game'
s
.
description
=
s
.
summary
s
.
description
=
s
.
summary
...
...
lib/main.rb
View file @
5a87a77c
#!/usr/bin/env ruby
#!/usr/bin/env ruby
p
ARGV
STDIN
.
gets
begin
begin
#定义全局方法
#定义全局方法
def
load_config
(
file
=
"config.yml"
)
def
load_config
(
file
=
"config.yml"
)
...
@@ -19,8 +17,10 @@ begin
...
@@ -19,8 +17,10 @@ begin
if
RUBY_PLATFORM
[
"win"
]
||
RUBY_PLATFORM
[
"ming"
]
if
RUBY_PLATFORM
[
"win"
]
||
RUBY_PLATFORM
[
"ming"
]
require
'win32/registry'
require
'win32/registry'
pwd
=
Dir
.
pwd
.
gsub
(
'/'
,
'\\'
)
pwd
=
Dir
.
pwd
.
gsub
(
'/'
,
'\\'
)
path
=
'"'
+
pwd
+
'\ruby\bin\ruby
.exe" -C"'
+
pwd
+
'" -KU lib/main.rb'
path
=
'"'
+
pwd
+
'\ruby\bin\ruby
w.exe" -C"'
+
pwd
+
'" -KU lib/main.rb'
command
=
path
+
' "%1"'
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'
){
|
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
)}
Win32
::
Registry
::
HKEY_CLASSES_ROOT
.
create
(
'mycard\shell\open\command'
){
|
reg
|
reg
[
nil
]
=
command
unless
(
reg
[
nil
]
==
command
rescue
false
)}
end
end
...
@@ -36,8 +36,6 @@ begin
...
@@ -36,8 +36,6 @@ begin
log_level
=
"INFO"
log_level
=
"INFO"
profile
=
nil
profile
=
nil
ARGV
.
each
do
|
arg
|
ARGV
.
each
do
|
arg
|
p
arg
STDIN
.
gets
case
arg
.
dup
.
force_encoding
(
"UTF-8"
)
case
arg
.
dup
.
force_encoding
(
"UTF-8"
)
when
/--log=(.*)/
when
/--log=(.*)/
log
.
replace
$1
log
.
replace
$1
...
@@ -74,7 +72,6 @@ begin
...
@@ -74,7 +72,6 @@ begin
require
'logger'
require
'logger'
if
log
==
"STDOUT"
#调试用
if
log
==
"STDOUT"
#调试用
log
=
STDOUT
log
=
STDOUT
STDOUT
.
set_encoding
"GBK"
,
"UTF-8"
,
:invalid
=>
:replace
,
:undef
=>
:replace
if
RUBY_PLATFORM
[
"win"
]
||
RUBY_PLATFORM
[
"ming"
]
end
end
$log
=
Logger
.
new
(
log
)
$log
=
Logger
.
new
(
log
)
$log
.
level
=
Logger
.
const_get
log_level
$log
.
level
=
Logger
.
const_get
log_level
...
...
lib/quickstart.rb
View file @
5a87a77c
...
@@ -4,11 +4,7 @@ require_relative 'room'
...
@@ -4,11 +4,7 @@ require_relative 'room'
require_relative
'ygocore/game'
require_relative
'ygocore/game'
$game
=
Ygocore
.
new
$game
=
Ygocore
.
new
p
1
STDIN
.
gets
uri
=
URI
.
unescape
URI
.
unescape
ARGV
.
first
[
9
,
ARGV
.
first
.
size
-
9
]
uri
=
URI
.
unescape
URI
.
unescape
ARGV
.
first
[
9
,
ARGV
.
first
.
size
-
9
]
p
uri
STDIN
.
gets
case
uri
case
uri
when
/^(.*\.yrp)$/
when
/^(.*\.yrp)$/
require
'open-uri'
require
'open-uri'
...
@@ -29,8 +25,6 @@ when /^(.*\.ydk)$/
...
@@ -29,8 +25,6 @@ when /^(.*\.ydk)$/
}
}
Ygocore
.
run_ygocore
(
File
.
basename
(
$1
,
'.ydk'
),
true
)
Ygocore
.
run_ygocore
(
File
.
basename
(
$1
,
'.ydk'
),
true
)
when
/^(?:(.*)\:(.*)\@)?(.*)\:(\d+)\/(.*)$/
when
/^(?:(.*)\:(.*)\@)?(.*)\:(\d+)\/(.*)$/
p
$1
STDIN
.
gets
require
'uri'
require
'uri'
$game
.
user
=
User
.
new
(
$1
.
to_sym
,
$1
)
if
$1
$game
.
user
=
User
.
new
(
$1
.
to_sym
,
$1
)
if
$1
$game
.
password
=
$2
if
$2
$game
.
password
=
$2
if
$2
...
...
lib/update.rb
View file @
5a87a77c
...
@@ -2,7 +2,7 @@ require 'open-uri'
...
@@ -2,7 +2,7 @@ require 'open-uri'
require
"fileutils"
require
"fileutils"
require_relative
'card'
require_relative
'card'
module
Update
module
Update
Version
=
'0.6.
4
'
Version
=
'0.6.
6
'
URL
=
"http://card.touhou.cc/mycard/update.json?version=
#{
Version
}
"
URL
=
"http://card.touhou.cc/mycard/update.json?version=
#{
Version
}
"
class
<<
self
class
<<
self
attr_reader
:thumbnails
,
:images
,
:status
attr_reader
:thumbnails
,
:images
,
:status
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment