mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
merge @mattn's win-compatibility
This commit is contained in:
@@ -6,7 +6,10 @@ c_dir = File.dirname(__FILE__)
|
||||
MRUBY_ROOT = File.expand_path("#{c_dir}/../..")
|
||||
DOC_DIR = File.expand_path(c_dir)
|
||||
|
||||
cmd = "#{DOC_DIR}/mrbdoc/mrbdoc.rb #{MRUBY_ROOT} #{DOC_DIR}"
|
||||
PTY.spawn(cmd) do |i,o,pid|
|
||||
i.each { |l| print l }
|
||||
cmd = "ruby #{DOC_DIR}/mrbdoc/mrbdoc.rb #{MRUBY_ROOT} #{DOC_DIR} false"
|
||||
IO.popen(cmd, "r+") do |io|
|
||||
io.close_write
|
||||
while line = io.gets
|
||||
puts line
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,7 +10,7 @@ class MRBDoc
|
||||
private
|
||||
|
||||
def write dir, cfg
|
||||
File.open(File.expand_path('Core.md', dir), 'w+') do |io|
|
||||
File.open(File.expand_path('Core.md', dir), 'wb+') do |io|
|
||||
print_core_classes(io, cfg)
|
||||
print_core_modules(io, cfg)
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@ require 'mrbdoc_docu'
|
||||
MRUBY_ROOT = ARGV[0]
|
||||
DOC_ROOT = ARGV[1]
|
||||
_WRITE_LINE_NO = ARGV[2]
|
||||
STDOUT.sync = true
|
||||
|
||||
raise ArgumentError.new 'mruby root missing!' if MRUBY_ROOT.nil?
|
||||
raise ArgumentError.new 'doc root missing!' if DOC_ROOT.nil?
|
||||
|
||||
Reference in New Issue
Block a user