narou 3.7.2 → 3.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19f8ca4a5c4225bab91baaf79b822783531ec9165aff057cd7711f8dd0836ab2
4
- data.tar.gz: 852f0b011c02a4a961b0944b4b563e56fb0513761090d07e98d7c47b42917c26
3
+ metadata.gz: e639fd7c7a2808c632f85812866ca9614978e152f177eedc69c8559f515af525
4
+ data.tar.gz: 8b406a232555c9e0625ac261183ab1017ebef6a50f6602ed9d694fce29db1307
5
5
  SHA512:
6
- metadata.gz: 975b3f44546689d96febb73ae0f624db9808fd48671b8bb991e12b66cfac3f604c0717a84a17ee0a383af899df58b9b4780101ee4d98d09398cd0187cdb88889
7
- data.tar.gz: 2cb5b7dc872a58f5e4312435967e62300c83ba013da3df7b3989dd12e8c96a88e61b493ef8f742bdc202e7143734a3d6ec19c9dd0dfc8121de18df4ae9b97936
6
+ metadata.gz: 9ec435fd5f1cd7b5f9c28a9a8e461450102e3083ebbbe04f4bcdc4cffcff1e5a90ef352a72c2f7c2d4e70f1bad1569403fc1c65309bee9e4e6137292ec19aaa3
7
+ data.tar.gz: 305f538e204dcdb0bb2ae02d5c8f770f40fd94e33913ab6b436de6db8d55f4ecb03e2cf8e22b03fcb3d14300031ec994e4ea4b094d7762a59dbeb0961f30055b
data/ChangeLog.md CHANGED
@@ -1,6 +1,26 @@
1
1
  更新履歴 - ChangeLog
2
2
  ====================
3
3
 
4
+ 3.8.2: 2022/09/10
5
+ -----------------
6
+ #### 修正内容
7
+ - フォルダが存在しない場合に自動で作成する様に修正
8
+
9
+
10
+ 3.8.1: 2021/12/27
11
+ -----------------
12
+ #### 修正内容
13
+ - ハーメルンのまえがき・あとがきが取得できなくなっていたのを修正
14
+
15
+
16
+ 3.8.0: 2021/06/27
17
+ -----------------
18
+ #### 修正内容
19
+ - タイトル名もしくは作者名に特定の記号を使うことで任意のコードを実行できて
20
+ しまう問題を修正 [CVE-2021-35514]
21
+ - この問題を発見した RyotaK に感謝します
22
+
23
+
4
24
  3.7.2: 2021/06/05
5
25
  -----------------
6
26
  #### 追加機能
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- narou (3.7.1)
4
+ narou (3.8.0)
5
5
  activesupport (>= 6.1, < 8.0)
6
6
  diff-lcs (~> 1.2, >= 1.2.5)
7
7
  erubis (~> 2.7)
@@ -25,7 +25,7 @@ PATH
25
25
  GEM
26
26
  remote: https://rubygems.org/
27
27
  specs:
28
- activesupport (6.1.3.2)
28
+ activesupport (6.1.4)
29
29
  concurrent-ruby (~> 1.0, >= 1.0.2)
30
30
  i18n (>= 1.6, < 2)
31
31
  minitest (>= 5.1)
@@ -34,13 +34,13 @@ GEM
34
34
  awesome_print (1.8.0)
35
35
  byebug (11.1.3)
36
36
  coderay (1.1.3)
37
- concurrent-ruby (1.1.8)
37
+ concurrent-ruby (1.1.9)
38
38
  diff-lcs (1.4.4)
39
39
  docile (1.3.5)
40
40
  erubis (2.7.0)
41
- ffi (1.14.2)
42
- ffi (1.14.2-java)
43
- haml (5.2.1)
41
+ ffi (1.15.3)
42
+ ffi (1.15.3-java)
43
+ haml (5.2.2)
44
44
  temple (>= 0.8.0)
45
45
  tilt
46
46
  i18n (1.8.10)
@@ -52,7 +52,7 @@ GEM
52
52
  method_source (1.0.0)
53
53
  mime-types (3.3.1)
54
54
  mime-types-data (~> 3.2015)
55
- mime-types-data (3.2021.0225)
55
+ mime-types-data (3.2021.0704)
56
56
  minitest (5.14.4)
57
57
  multi_json (1.15.0)
58
58
  mustermann (1.1.1)
@@ -70,11 +70,11 @@ GEM
70
70
  pry-byebug (3.9.0)
71
71
  byebug (~> 11.0)
72
72
  pry (~> 0.13.0)
73
- psych (4.0.0)
74
- psych (4.0.0-java)
73
+ psych (4.0.1)
74
+ psych (4.0.1-java)
75
75
  jar-dependencies (>= 0.1.7)
76
- rack (2.2.3)
77
- rack-protection (2.1.0)
76
+ rack (2.2.3.1)
77
+ rack-protection (2.2.0)
78
78
  rack
79
79
  rspec (3.10.0)
80
80
  rspec-core (~> 3.10.0)
@@ -93,8 +93,8 @@ GEM
93
93
  rspec-support (3.10.1)
94
94
  rspec_junit_formatter (0.4.1)
95
95
  rspec-core (>= 2, < 4, != 2.12.0)
96
- ruby2_keywords (0.0.4)
97
- rubyzip (2.3.0)
96
+ ruby2_keywords (0.0.5)
97
+ rubyzip (2.3.2)
98
98
  sassc (2.4.0)
99
99
  ffi (~> 1.9)
100
100
  simplecov (0.21.2)
@@ -103,16 +103,16 @@ GEM
103
103
  simplecov_json_formatter (~> 0.1)
104
104
  simplecov-html (0.12.3)
105
105
  simplecov_json_formatter (0.1.2)
106
- sinatra (2.1.0)
106
+ sinatra (2.2.0)
107
107
  mustermann (~> 1.0)
108
108
  rack (~> 2.2)
109
- rack-protection (= 2.1.0)
109
+ rack-protection (= 2.2.0)
110
110
  tilt (~> 2.0)
111
- sinatra-contrib (2.1.0)
111
+ sinatra-contrib (2.2.0)
112
112
  multi_json
113
113
  mustermann (~> 1.0)
114
- rack-protection (= 2.1.0)
115
- sinatra (= 2.1.0)
114
+ rack-protection (= 2.2.0)
115
+ sinatra (= 2.2.0)
116
116
  tilt (~> 2.0)
117
117
  spoon (0.0.6)
118
118
  ffi
data/README.md CHANGED
@@ -34,15 +34,10 @@ Narou.rb - 小説家になろうのダウンローダ&縦書き整形&管理
34
34
  更新履歴 - ChangeLog
35
35
  --------------------
36
36
 
37
- 3.7.2: 2021/06/05
37
+ 3.8.2: 2022/09/10
38
38
  -----------------
39
- #### 追加機能
40
- - folder コマンドに --no-open (-n) オプションを追加しました
41
-
42
39
  #### 修正内容
43
- - gem update を行うとクラッシュする場合があったのを修正
44
- - psych 4.0 からの非互換に対応
45
- - その他軽微な修正
40
+ - フォルダが存在しない場合に自動で作成する様に修正
46
41
 
47
42
  ----
48
43
 
data/commitversion CHANGED
@@ -1 +1 @@
1
- 0b2b110
1
+ 4660df5
data/lib/downloader.rb CHANGED
@@ -778,6 +778,7 @@ class Downloader
778
778
  @setting["story"] = story_html.to_aozora
779
779
  end
780
780
  @setting["info"] = info
781
+ replace_external_properties_of_setting
781
782
 
782
783
  @setting["title"] = get_title
783
784
  if series_novel?
@@ -1303,4 +1304,9 @@ class Downloader
1303
1304
  Template.write(filename, novel_dir_path, binding, binary_version)
1304
1305
  end
1305
1306
  end
1307
+
1308
+ def replace_external_properties_of_setting
1309
+ @setting["title"] = @setting["title"].delete("\r\n")
1310
+ @setting["author"] = @setting["author"].delete("\r\n")
1311
+ end
1306
1312
  end
data/lib/extension.rb CHANGED
@@ -27,6 +27,7 @@ def File.write(path, string, *options, mode: nil)
27
27
  return super if mode
28
28
 
29
29
  dirpath = File.dirname(path)
30
+ FileUtils.makedirs(dirpath) unless Dir.exist?(dirpath)
30
31
  temp_path = File.join(dirpath, SecureRandom.hex(15))
31
32
  if File.extname(path) == ".yaml" && File.basename(dirpath) != Downloader::SECTION_SAVE_DIR_NAME
32
33
  backup = "#{path}.backup"
data/lib/loadconverter.rb CHANGED
@@ -10,7 +10,7 @@ BlankConverter = Class.new(ConverterBase) {}
10
10
 
11
11
  $latest_converter = nil
12
12
 
13
- def converter(title, &block)
13
+ def converter(_title = nil, &block)
14
14
  $latest_converter = Class.new(ConverterBase, &block)
15
15
  end
16
16
 
@@ -58,7 +58,7 @@ end
58
58
  # buffer
59
59
  # end
60
60
  # end
61
- def load_converter(title, archive_path)
61
+ def load_converter(archive_path)
62
62
  converter_path = File.join(archive_path, "converter.rb")
63
63
  if File.exist?(converter_path)
64
64
  $latest_converter = nil
@@ -71,9 +71,8 @@ def load_converter(title, archive_path)
71
71
  if conv
72
72
  return conv
73
73
  else
74
- title_for_converter = (title =~ /.txt\z/ ? title : File.basename(archive_path))
75
74
  error "converter.rbは見つかりましたが、`converter'で登録されていないようです。" +
76
- "変換処理は converter \"#{title_for_converter.gsub('"', '\\"')}\" として登録する必要があります"
75
+ "変換処理は converter do ... end として登録する必要があります"
77
76
  return BlankConverter
78
77
  end
79
78
  end
data/lib/narou.rb CHANGED
@@ -44,7 +44,7 @@ module Narou
44
44
  @@is_web = false
45
45
 
46
46
  def last_commit_year
47
- 2021
47
+ 2022
48
48
  end
49
49
 
50
50
  def root_dir
@@ -568,7 +568,7 @@ class NovelConverter
568
568
  # 各小説用の converter.rb 変換オブジェクトを生成
569
569
  #
570
570
  def create_converter
571
- load_converter(@novel_title, @setting.archive_path).new(@setting, @inspector, @illustration)
571
+ load_converter(@setting.archive_path).new(@setting, @inspector, @illustration)
572
572
  end
573
573
 
574
574
  #
data/lib/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
  #
6
6
 
7
7
  module Narou
8
- VERSION = "3.7.2"
8
+ VERSION = "3.8.2"
9
9
  end
data/narou.gemspec CHANGED
@@ -32,15 +32,10 @@ Gem::Specification.new do |gem|
32
32
  install_message = <<-EOS
33
33
  #{"*" * 60}
34
34
 
35
- 3.7.2: 2021/06/05
35
+ 3.8.2: 2022/09/10
36
36
  -----------------
37
- #### 追加機能
38
- - folder コマンドに --no-open (-n) オプションを追加しました
39
-
40
37
  #### 修正内容
41
- - gem update を行うとクラッシュする場合があったのを修正
42
- - psych 4.0 からの非互換に対応
43
- - その他軽微な修正
38
+ - フォルダが存在しない場合に自動で作成する様に修正
44
39
 
45
40
  #{"*" * 60}
46
41
  EOS
@@ -1,15 +1,8 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  <% Template.target_binary_version(1.0) -%>
3
3
 
4
- #
5
- # 対象小説情報
6
- # タイトル: <%= @setting["title"] %>
7
- # 作者: <%= @setting["author"] %>
8
- # URL: <%= @setting["toc_url"] %>
9
- #
10
4
  # 詳細については http://bit.ly/1vTEH04 を参照して下さい
11
- #
12
- converter "<%= file_title.gsub('"', '\"') %>" do
5
+ converter do
13
6
  # 各種変換処理がされる「前」の生データに対しての変換処理を記述
14
7
  def before(io, text_type)
15
8
  super
@@ -30,9 +30,9 @@ error_message: 投稿者が削除、もしくは間違ったアドレスを指
30
30
  body_pattern: |-
31
31
  <span style="font-size:120%">.+?</span><BR><BR>
32
32
  (?<body>.+?)
33
- (?:<div id=atogaki><BR><HR><BR>(?<postscript>.+?)</div>)?
33
+ (?:<div id="atogaki"><br><hr><br>(?<postscript>.+?)</div>)?
34
34
 
35
- introduction_pattern: <div id=maegaki>(?<introduction>.+)<BR><HR><BR></div>
35
+ introduction_pattern: <div id="maegaki">(?<introduction>.+)<br><hr><br></div><
36
36
  postscript_pattern: null
37
37
 
38
38
  illust_current_url: null
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.7.2
4
+ version: 3.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - whiteleaf7
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-05 00:00:00.000000000 Z
11
+ date: 2022-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: termcolorlight
@@ -709,15 +709,10 @@ metadata: {}
709
709
  post_install_message: |
710
710
  ************************************************************
711
711
 
712
- 3.7.2: 2021/06/05
712
+ 3.8.2: 2022/09/10
713
713
  -----------------
714
- #### 追加機能
715
- - folder コマンドに --no-open (-n) オプションを追加しました
716
-
717
714
  #### 修正内容
718
- - gem update を行うとクラッシュする場合があったのを修正
719
- - psych 4.0 からの非互換に対応
720
- - その他軽微な修正
715
+ - フォルダが存在しない場合に自動で作成する様に修正
721
716
 
722
717
  ************************************************************
723
718
  rdoc_options: []