class WWWCHTMLConverter::Link

Public Class Methods

new(wwwc_path, html_path) click to toggle source
# File lib/WWWCHtmlConverter/WWWCHTMLConverterLib.rb, line 63
def initialize(wwwc_path, html_path)
  if wwwc_path == nil or html_path == nil then
    help()
    return 0
  end

  if Dir::exist?(wwwc_path) == true and Dir::exist?(html_path) == true then

    if File::ftype(wwwc_path) == "directory" then
      p wwwc_path.encode(Encoding::SJIS) + "WWWCのディレクトリではないです".encode(Encoding::SJIS)
      return 0
    end

    if File::ftype(html_path) == "directory" then
      p html_path.encode(Encoding::SJIS) + "Linkのディレクトリではないです".encode(Encoding::SJIS)
      return 0
    end

  end

  @wwwc = WWWC_HTML_Converter.new

  # Item.datのパスを回帰的に取得
  @items = []
  Dir.glob("Item.dat/**/*").each{|dir|
    wwwc = WWWC_HTML_Converter.new
    wwwc.item_date_pach = dir
    p dir.encode(Encoding::SJIS)
  }

  # ディレクトリリスト作成
  @items.each{|wwwc|
    dir_list = Dir::entries()
    dir_list.each{|dir|
      if File::ftype(dir) == true then
        wwwc.dir_list << dir
      end
    }
  }

  @items.each{|wwwc|
    f = File.open(wwwc.item_dat_pach, 'r:SJIS'){|f|
      @source = f.read  # 全て読み込む
    }

  }
end

Public Instance Methods

help() click to toggle source
# File lib/WWWCHtmlConverter/WWWCHTMLConverterLib.rb, line 111
def help()
  p "WWWC_HTML_Converter.exe wwwc_path html_path"
end