narou.rb in narou-2.8.3.1 vs narou.rb in narou-2.9.0

- old
+ new

@@ -4,17 +4,12 @@ # Narou.rb ― 小説家になろうダウンロード&整形スクリプト # # Copyright 2013 whiteleaf. All rights reserved. # -require "open-uri" -require "open_uri_redirections" +require_relative "lib/extension" -def make_open_uri_options(add) - add -end - script_dir = File.expand_path(File.dirname(__FILE__)) $debug = File.exist?(File.join(script_dir, "debug")) Encoding.default_external = Encoding::UTF_8 @@ -24,10 +19,17 @@ puts "実行時間 #{Time.now - now}秒" end end require_relative "lib/inventory" + +$development = Narou.commit_version.! +begin + require "pry" if $development +rescue LoadError +end + global = Inventory.load("global_setting", :global) $display_backtrace = ARGV.delete("--backtrace") $display_backtrace ||= $debug $disable_color = ARGV.delete("--no-color") $disable_color ||= global["no-color"] @@ -35,17 +37,9 @@ require_relative "lib/logger" require_relative "lib/version" require_relative "lib/commandline" rescue_level = $debug ? Exception : StandardError - -if !global["dismiss-notice"] && RUBY_VERSION < "2.1.0" - puts <<-EOS.termcolor -<cyan><bold>[Notice] -ご使用のRubyのバージョンが#{RUBY_VERSION}と古いままです。近い将来Ruby2.1.0以上を必須とする予定なので準備をお願いします -このお知らせを消すには narou s dismiss-notice=true を実行して下さい</bold></cyan> - EOS -end begin CommandLine.run(ARGV.map { |v| v.dup }) rescue SystemExit => e exit e.status