narou 3.5.0.1 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of narou might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95bf07d5d411dc375dc6fdef96d6539c2f3d66b63bd71f0f48ab883f16e42ffc
4
- data.tar.gz: 53e35c22ca89fb11c8c27945c23790f174e418ce353e818ff28d5374caf30cee
3
+ metadata.gz: f37fc846838d47f62b093acfd19416b7eb81a992eaf50feb4f05a857624b3bbf
4
+ data.tar.gz: 9765f2c1e9d88f266a922410f5f3ed89b70060c553c4f557bbac282fa7fc3a4b
5
5
  SHA512:
6
- metadata.gz: 41a54f0b642fc2aea1a5e8d52b196c7b9ab6353bfd27bc3f0dbb5f8c5d867432a5783c1640bb64c37451a9ab84a41078f09b85cb5bd4b65043d4d302d248b7a8
7
- data.tar.gz: 84a52aff09cddeed454fcd07f6b25385c75a3f807145f59f1086fe611a03d966237a4fa5a9e0251158b33f30a76debf8e7033503bc010c98d06b01622bef1e47
6
+ metadata.gz: 770d433baf61c01dc2d577e79fb8be0d6ca418c62fb6f6900c84b8401b1658b2c08beb65c5bcf58352bc70b62735b8cdb47caf4c25fe1bc15b2dad183eb6fc04
7
+ data.tar.gz: 726d8579ab32be6ad94e9d2a84c764bea0c7c2f78b5ca7e9c7584f2b30340f472315e30781f16a44cf5d72043396271e6903d8a5002d4b5eaf8c51cf3ebb7e8e
@@ -56,9 +56,6 @@ Style/AndOr:
56
56
  Style/BlockDelimiters:
57
57
  Enabled: false
58
58
 
59
- Style/BracesAroundHashParameters:
60
- Enabled: false
61
-
62
59
  Style/CollectionMethods:
63
60
  PreferredMethods:
64
61
  detect: "detect"
@@ -241,3 +238,6 @@ Style/FormatStringToken:
241
238
 
242
239
  Layout/EmptyLineAfterGuardClause:
243
240
  Enabled: false
241
+
242
+ Style/StderrPuts:
243
+ Enabled: false
@@ -1,6 +1,14 @@
1
1
  更新履歴 - ChangeLog
2
2
  ====================
3
3
 
4
+ 3.5.1: 2020/03/21
5
+ -----------------
6
+ #### 修正内容
7
+ - 小説家になろう系列の挿絵をダウンロード時に、サムネイル画像を取得するように
8
+ なってしまっていたのを修正
9
+ - Ruby 2.7 で narou setting -l を実行時に警告が大量に出ていたのを修正
10
+
11
+
4
12
  3.5.0: 2020/02/16
5
13
  -----------------
6
14
  #### 修正内容
data/README.md CHANGED
@@ -34,10 +34,12 @@ Narou.rb - 小説家になろうのダウンローダ&縦書き整形&管理
34
34
  更新履歴 - ChangeLog
35
35
  --------------------
36
36
 
37
- 3.5.0: 2020/02/16
37
+ 3.5.1: 2020/03/21
38
38
  -----------------
39
39
  #### 修正内容
40
- - Ruby 2.7 に対応
40
+ - 小説家になろう系列の挿絵をダウンロード時に、サムネイル画像を取得するように
41
+ なってしまっていたのを修正
42
+ - Ruby 2.7 で narou setting -l を実行時に警告が大量に出ていたのを修正
41
43
 
42
44
  ----
43
45
 
@@ -118,7 +118,7 @@ module Command
118
118
  settings.each do |scope, scoped_settings|
119
119
  stream_io.puts "[#{scope.capitalize} Variables]"
120
120
  scoped_settings.each do |name, value|
121
- if value =~ / /
121
+ if value.to_s =~ / /
122
122
  value = "'#{value}'"
123
123
  end
124
124
  stream_io.puts "<bold><green>#{name}</green></bold>=#{value}".termcolor
@@ -995,7 +995,7 @@ class ConverterBase
995
995
  # URL っぽい文字列を一旦別のIDに置き換えてあとで復元することで、変換処理の影響を受けさせない
996
996
  #
997
997
  def replace_url(data)
998
- data.gsub!(URI.regexp(%w(http https))) do |match|
998
+ data.gsub!(URI::DEFAULT_PARSER.make_regexp(%w(http https))) do |match|
999
999
  @url_list << match
1000
1000
  "[#URL=#{@url_list.size - 1}]"
1001
1001
  end
@@ -89,7 +89,7 @@ class Downloader
89
89
  #
90
90
  def self.get_target_type(target)
91
91
  case target
92
- when URI.regexp
92
+ when URI::DEFAULT_PARSER.make_regexp
93
93
  :url
94
94
  when /^n\d+[a-z]+$/i
95
95
  target.downcase!
@@ -27,7 +27,7 @@ class Illustration
27
27
  source.gsub!(/[#挿絵((.+?))入る]/) do |match|
28
28
  url = $1
29
29
  url = "https:#{url}" if url.start_with?("//")
30
- if url =~ URI.regexp
30
+ if url =~ URI::DEFAULT_PARSER.make_regexp
31
31
  path = download_image(url)
32
32
  path ? block.call(make_illust_chuki(path)) : ""
33
33
  else
@@ -53,6 +53,8 @@ class Illustration
53
53
  if path = search_image(basename)
54
54
  return path
55
55
  end
56
+
57
+ url = transform_mitemin_url(url)
56
58
  URI.open(url, make_open_uri_options(allow_redirections: :safe)) do |fp|
57
59
  content_type = fp.meta["content-type"]
58
60
  ext = MIME[content_type] or raise UnknownMIMEType, content_type
@@ -77,6 +79,13 @@ class Illustration
77
79
  Dir.glob(path)[0]
78
80
  end
79
81
 
82
+ def transform_mitemin_url(url)
83
+ uri = URI.parse(url)
84
+ return url unless uri.host.end_with?(".mitemin.net")
85
+
86
+ url.sub("viewimagebig", "viewimage")
87
+ end
88
+
80
89
  def create_illust_path(basename)
81
90
  illust_abs_dir = File.join(@setting.archive_path, ILLUST_DIR)
82
91
  Dir.mkdir(illust_abs_dir) unless File.exist?(illust_abs_dir)
@@ -457,8 +457,8 @@ class NovelConverter
457
457
  processing_title = toc["title"]
458
458
  processing_title += "_#{index}" if index
459
459
  processed_title = decorate_title(processing_title)
460
- tempalte_name = (device && device.ibunko? ? NOVEL_TEXT_TEMPLATE_NAME_FOR_IBUNKO : NOVEL_TEXT_TEMPLATE_NAME)
461
- Template.get(tempalte_name, binding, 1.1)
460
+ template_name = (device && device.ibunko? ? NOVEL_TEXT_TEMPLATE_NAME_FOR_IBUNKO : NOVEL_TEXT_TEMPLATE_NAME)
461
+ Template.get(template_name, binding, 1.1)
462
462
  end
463
463
 
464
464
  #
@@ -5,5 +5,5 @@
5
5
  #
6
6
 
7
7
  module Narou
8
- VERSION = "3.5.0.1"
8
+ VERSION = "3.5.1"
9
9
  end
@@ -32,10 +32,12 @@ Gem::Specification.new do |gem|
32
32
  install_message = <<-EOS
33
33
  #{"*" * 60}
34
34
 
35
- 3.5.0: 2020/02/16
35
+ 3.5.1: 2020/03/21
36
36
  -----------------
37
37
  #### 修正内容
38
- - Ruby 2.7 に対応
38
+ - 小説家になろう系列の挿絵をダウンロード時に、サムネイル画像を取得するように
39
+ なってしまっていたのを修正
40
+ - Ruby 2.7 で narou setting -l を実行時に警告が大量に出ていたのを修正
39
41
 
40
42
  #{"*" * 60}
41
43
  EOS
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: narou
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0.1
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - whiteleaf7
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-16 00:00:00.000000000 Z
11
+ date: 2020-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: termcolorlight
@@ -661,10 +661,12 @@ metadata: {}
661
661
  post_install_message: |
662
662
  ************************************************************
663
663
 
664
- 3.5.0: 2020/02/16
664
+ 3.5.1: 2020/03/21
665
665
  -----------------
666
666
  #### 修正内容
667
- - Ruby 2.7 に対応
667
+ - 小説家になろう系列の挿絵をダウンロード時に、サムネイル画像を取得するように
668
+ なってしまっていたのを修正
669
+ - Ruby 2.7 で narou setting -l を実行時に警告が大量に出ていたのを修正
668
670
 
669
671
  ************************************************************
670
672
  rdoc_options: []