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
709a9dbb
Commit
709a9dbb
authored
May 30, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时
parent
d3b84e50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
lib/main.rb
lib/main.rb
+5
-1
lib/quickstart.rb
lib/quickstart.rb
+7
-1
No files found.
lib/main.rb
View file @
709a9dbb
#!/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"
)
...
@@ -17,7 +19,7 @@ begin
...
@@ -17,7 +19,7 @@ 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
w
.exe" -C"'
+
pwd
+
'" -KU lib/main.rb'
path
=
'"'
+
pwd
+
'\ruby\bin\ruby.exe" -C"'
+
pwd
+
'" -KU lib/main.rb'
command
=
path
+
' "%1"'
command
=
path
+
' "%1"'
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
)}
...
@@ -34,6 +36,8 @@ begin
...
@@ -34,6 +36,8 @@ 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
...
...
lib/quickstart.rb
View file @
709a9dbb
...
@@ -4,7 +4,11 @@ require_relative 'room'
...
@@ -4,7 +4,11 @@ require_relative 'room'
require_relative
'ygocore/game'
require_relative
'ygocore/game'
$game
=
Ygocore
.
new
$game
=
Ygocore
.
new
uri
=
URI
.
unescape
ARGV
.
first
[
9
,
ARGV
.
first
.
size
-
9
]
p
1
STDIN
.
gets
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'
...
@@ -25,6 +29,8 @@ when /^(.*\.ydk)$/
...
@@ -25,6 +29,8 @@ 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
...
...
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