Sha256: 2b388c07b5e855ac63b8fa8639d60758259975f623832d2492a05cb43106753a

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

#! ruby
# -*- coding: utf-8 -*-
#
# Narou.rb ― 小説家になろうダウンロード&整形スクリプト
#
# Copyright 2013 whiteleaf. All rights reserved.
#

$debug = File.exists?(File.join(File.expand_path(File.dirname($0)), "debug"))
Encoding.default_external = Encoding::UTF_8

require_relative "lib/logger"
require_relative "lib/version"
require_relative "lib/commandline"

rescue_level = $debug ? Exception : StandardError

begin
  display_backtrace = ARGV.delete("--backtrace")
  display_backtrace ||= $debug
  $disable_color = ARGV.delete("--no-color")
  $disable_color ||= GlobalSetting.get["global_setting"]["no-color"]
  CommandLine.run(ARGV)
rescue rescue_level => e
  warn $@.shift + ": #{e.message} (#{e.class})"
  if display_backtrace
    $@.each do |b|
      warn "  from #{b}"
    end
  else
    warn "  エラーが発生したため終了しました。"
    warn "  詳細なエラーは --backtrace オプションを付けて再度実行して下さい。"
  end
  exit 1
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
narou-1.1.2.1 narou.rb
narou-1.1.2 narou.rb