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
c2b004a4
Commit
c2b004a4
authored
Sep 14, 2013
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4c6bbc68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
main.rb
main.rb
+13
-6
No files found.
main.rb
View file @
c2b004a4
#encoding: UTF-8
# = Building
if
defined?
(
Ocra
)
or
defined?
(
Exerb
)
require
'json'
...
...
@@ -5,6 +6,7 @@ if defined?(Ocra) or defined?(Exerb)
require
'fileutils'
require
'uri'
require
'open-uri'
require
'net/http'
require
'win32api'
require
'win32ole'
require
'win32/registry'
...
...
@@ -89,7 +91,8 @@ begin
result
=
szFile
.
delete
(
"
\0
"
.
encode
(
Encoding
::
UTF_16LE
)).
encode
(
Encoding
::
UTF_8
)
if
!
result
.
empty?
and
File
.
file?
result
result
=
File
.
expand_path
result
require
'pathname'
result
=
Pathname
.
new
(
result
).
cleanpath
Config
[
'ygopro'
][
'path'
]
=
result
else
exit
...
...
@@ -253,9 +256,10 @@ begin
def
replay
(
replay
)
require
'fileutils'
moved_replay_directory
=
File
.
expand_path
(
File
.
dirname
(
Config
[
'ygopro'
][
'path'
]))
==
Dir
.
pwd
?
'replay_moved'
:
'replay'
moved_replay_directory
=
File
.
join
(
File
.
dirname
(
Config
[
'ygopro'
][
'path'
]),
'replay'
,
'stashed'
)
files
=
Dir
.
glob
(
File
.
join
(
File
.
dirname
(
Config
[
'ygopro'
][
'path'
]),
'replay'
,
'*.yrp'
))
files
.
delete
File
.
join
(
File
.
dirname
(
Config
[
'ygopro'
][
'path'
]),
'replay'
,
replay
+
'.yrp'
)
FileUtils
.
mkdir_p
moved_replay_directory
unless
File
.
directory?
moved_replay_directory
FileUtils
.
mv
files
,
moved_replay_directory
run_ygopro
(
'-r'
)
end
...
...
@@ -282,16 +286,19 @@ begin
def
parse_path
(
path
)
require
'fileutils'
require
'pathname'
path
=
Pathname
.
new
(
path
).
cleanpath
case
File
.
extname
(
path
)
when
'.ydk'
deck_directory
=
File
.
join
(
File
.
dirname
(
Config
[
'ygopro'
][
'path'
]),
'deck'
)
if
file
.
dirname
(
path
)
!
=
deck_directory
deck_directory
=
File
.
expand_path
(
'deck'
,
File
.
dirname
(
Config
[
'ygopro'
][
'path'
])
)
unless
File
.
expand_path
(
File
.
dirname
(
path
))
=
=
deck_directory
Dir
.
mkdir
(
deck_directory
)
unless
File
.
directory?
(
deck_directory
)
FileUtils
.
copy
(
path
,
deck_directory
)
end
deck
(
File
.
basename
(
path
,
'.ydk'
))
when
'.yrp'
replay_directory
=
File
.
expand_path
(
File
.
dirname
(
Config
[
'ygopro'
][
'path'
]))
replay_directory
=
File
.
expand_path
(
'replay'
,
File
.
dirname
(
Config
[
'ygopro'
][
'path'
]))
unless
File
.
expand_path
(
File
.
dirname
(
path
))
==
replay_directory
Dir
.
mkdir
(
replay_directory
)
unless
File
.
directory?
(
replay_directory
)
FileUtils
.
copy
(
path
,
replay_directory
)
...
...
@@ -360,6 +367,6 @@ an error occurs, please send your operation and message below to zh99998@gmail.c
#{
exception
.
inspect
}
#{
exception
.
backtrace
.
join
(
"
\n
"
)
}
"
open
(
'error.txt'
,
'w'
)
{
|
f
|
f
.
write
error
}
open
(
'error.txt'
,
'w
:utf-8
'
)
{
|
f
|
f
.
write
error
}
spawn
'notepad'
,
'error.txt'
end
\ No newline at end of file
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