narou 3.7.1 → 3.7.2

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: 80482340ee7d74119214a40ad48660c2348508340fdd93481efa53d99f5a3194
4
- data.tar.gz: b3a5a426b5ff095bfd9ab8bbfeccee6559c5aabf9969f753226f4911f3bb7bfd
3
+ metadata.gz: 19f8ca4a5c4225bab91baaf79b822783531ec9165aff057cd7711f8dd0836ab2
4
+ data.tar.gz: 852f0b011c02a4a961b0944b4b563e56fb0513761090d07e98d7c47b42917c26
5
5
  SHA512:
6
- metadata.gz: 7f5955fd8c737c0046e847a50b68677fdd34f2beb5b3f8301b22731a0db739b776a0ea6a30cf2616f5f8d67f0c9798d0d492a0bc08076dba582746b408790ee1
7
- data.tar.gz: 03a59c16cc0b43760e7eded2b30a4086d3b22b9edcb48854fb9bbd0f087926fc923c2b80b634808265d068280a601eb82d5b5e92ae4dbefd8bb24b6cdf837a79
6
+ metadata.gz: 975b3f44546689d96febb73ae0f624db9808fd48671b8bb991e12b66cfac3f604c0717a84a17ee0a383af899df58b9b4780101ee4d98d09398cd0187cdb88889
7
+ data.tar.gz: 2cb5b7dc872a58f5e4312435967e62300c83ba013da3df7b3989dd12e8c96a88e61b493ef8f742bdc202e7143734a3d6ec19c9dd0dfc8121de18df4ae9b97936
data/.circleci/config.yml CHANGED
@@ -3,7 +3,7 @@ jobs:
3
3
  build:
4
4
  working_directory: ~/circleci-narou
5
5
  docker:
6
- - image: circleci/ruby:2.5
6
+ - image: circleci/ruby:3.0
7
7
  environment:
8
8
  BUNDLE_JOBS: 1
9
9
  BUNDLE_RETRY: 3
data/ChangeLog.md CHANGED
@@ -1,6 +1,16 @@
1
1
  更新履歴 - ChangeLog
2
2
  ====================
3
3
 
4
+ 3.7.2: 2021/06/05
5
+ -----------------
6
+ #### 追加機能
7
+ - folder コマンドに --no-open (-n) オプションを追加しました
8
+
9
+ #### 修正内容
10
+ - gem update を行うとクラッシュする場合があったのを修正
11
+ - psych 4.0 からの非互換に対応
12
+ - その他軽微な修正
13
+
4
14
  3.7.1: 2021/04/01
5
15
  -----------------
6
16
  #### 修正内容
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- narou (3.7.0)
4
+ narou (3.7.1)
5
5
  activesupport (>= 6.1, < 8.0)
6
6
  diff-lcs (~> 1.2, >= 1.2.5)
7
7
  erubis (~> 2.7)
@@ -11,6 +11,7 @@ PATH
11
11
  memoist (~> 0.11.0)
12
12
  open_uri_redirections (~> 0.2, >= 0.2.1)
13
13
  pony (~> 1, >= 1.11)
14
+ psych (~> 4.0)
14
15
  rubyzip (~> 2.0, >= 2.0.0)
15
16
  sassc (~> 2.4)
16
17
  sinatra (~> 2.0, >= 2.0.8.1)
@@ -24,7 +25,7 @@ PATH
24
25
  GEM
25
26
  remote: https://rubygems.org/
26
27
  specs:
27
- activesupport (6.1.1)
28
+ activesupport (6.1.3.2)
28
29
  concurrent-ruby (~> 1.0, >= 1.0.2)
29
30
  i18n (>= 1.6, < 2)
30
31
  minitest (>= 5.1)
@@ -42,16 +43,17 @@ GEM
42
43
  haml (5.2.1)
43
44
  temple (>= 0.8.0)
44
45
  tilt
45
- i18n (1.8.7)
46
+ i18n (1.8.10)
46
47
  concurrent-ruby (~> 1.0)
48
+ jar-dependencies (0.4.1)
47
49
  mail (2.6.6)
48
50
  mime-types (>= 1.16, < 4)
49
51
  memoist (0.11.0)
50
52
  method_source (1.0.0)
51
53
  mime-types (3.3.1)
52
54
  mime-types-data (~> 3.2015)
53
- mime-types-data (3.2020.1104)
54
- minitest (5.14.3)
55
+ mime-types-data (3.2021.0225)
56
+ minitest (5.14.4)
55
57
  multi_json (1.15.0)
56
58
  mustermann (1.1.1)
57
59
  ruby2_keywords (~> 0.0.1)
@@ -68,6 +70,9 @@ GEM
68
70
  pry-byebug (3.9.0)
69
71
  byebug (~> 11.0)
70
72
  pry (~> 0.13.0)
73
+ psych (4.0.0)
74
+ psych (4.0.0-java)
75
+ jar-dependencies (>= 0.1.7)
71
76
  rack (2.2.3)
72
77
  rack-protection (2.1.0)
73
78
  rack
@@ -138,4 +143,4 @@ DEPENDENCIES
138
143
  timecop (~> 0.9)
139
144
 
140
145
  BUNDLED WITH
141
- 2.2.3
146
+ 2.2.15
data/README.md CHANGED
@@ -34,24 +34,15 @@ Narou.rb - 小説家になろうのダウンローダ&縦書き整形&管理
34
34
  更新履歴 - ChangeLog
35
35
  --------------------
36
36
 
37
- 3.7.1: 2021/04/01
37
+ 3.7.2: 2021/06/05
38
38
  -----------------
39
- #### 修正内容
40
- - その他の小説の最新話掲載日を確認しようとするとクラッシュする不具合を修正
41
-
39
+ #### 追加機能
40
+ - folder コマンドに --no-open (-n) オプションを追加しました
42
41
 
43
- 3.7.0: 2021/01/23
44
- -----------------
45
- #### 修正内容
46
- - Apple Silicon 搭載 Mac でも動く様にライブラリをアップデート
47
- - device を kobo に設定し、ebook-filename-length-limit でファイル名が制限され
48
- た場合に send コマンドが正常に実行できない不具合を修正
49
-
50
-
51
- 3.6.0: 2021/01/02
52
- -----------------
53
42
  #### 修正内容
54
- - Ruby 3.0 に対応
43
+ - gem update を行うとクラッシュする場合があったのを修正
44
+ - psych 4.0 からの非互換に対応
45
+ - その他軽微な修正
55
46
 
56
47
  ----
57
48
 
@@ -45,7 +45,7 @@ module Command
45
45
  if @options["vote"]
46
46
  # TODO: 最新話の場所をAPIで取得する
47
47
  data_dir = Downloader.get_novel_data_dir_by_target(data["id"])
48
- latest_index = YAML.load_file(File.join(data_dir, Downloader::TOC_FILE_NAME))["subtitles"].last["index"]
48
+ latest_index = YAML.unsafe_load_file(File.join(data_dir, Downloader::TOC_FILE_NAME))["subtitles"].last["index"]
49
49
  open_url = "#{toc_url + latest_index}/#my_novelpoint"
50
50
  else
51
51
  open_url = toc_url
data/lib/command/diff.rb CHANGED
@@ -212,8 +212,8 @@ module Command
212
212
  cache_sections = []
213
213
  cache_section_list.each do |path|
214
214
  match_latest_path = File.join(novel_dir, File.basename(path))
215
- latest_novel_sections << YAML.load_file(match_latest_path) if File.exist?(match_latest_path)
216
- cache_sections << YAML.load_file(path)
215
+ latest_novel_sections << YAML.unsafe_load_file(match_latest_path) if File.exist?(match_latest_path)
216
+ cache_sections << YAML.unsafe_load_file(path)
217
217
  end
218
218
 
219
219
  novel_info = Database.instance[id]
@@ -23,7 +23,12 @@ module Command
23
23
  narou folder musyoku
24
24
  narou folder 0
25
25
  narou f 0
26
+
27
+ Options:
26
28
  EOS
29
+ @opt.on("-n", "--no-open", "フォルダを開かずにパスだけ表示する") {
30
+ @options["no-open"] = true
31
+ }
27
32
  end
28
33
 
29
34
  def execute(argv)
@@ -33,7 +38,7 @@ module Command
33
38
  argv.each do |target|
34
39
  dir = Downloader.get_novel_data_dir_by_target(target)
35
40
  if dir
36
- Helper.open_directory(dir)
41
+ Helper.open_directory(dir) unless @options["no-open"]
37
42
  puts dir
38
43
  else
39
44
  error "#{target} は存在しません"
data/lib/device.rb CHANGED
@@ -91,13 +91,12 @@ class Device
91
91
  end
92
92
 
93
93
  def eject
94
- if ejectable?
95
- begin
96
- Device.eject(@device_module::VOLUME_NAME)
97
- rescue CantEject => e
98
- error e.message
99
- end
100
- end
94
+ return unless ejectable?
95
+
96
+ Device.eject(@device_module::VOLUME_NAME)
97
+ yield if block_given?
98
+ rescue CantEject => e
99
+ error e.message
101
100
  end
102
101
 
103
102
  def self.support_eject?
data/lib/downloader.rb CHANGED
@@ -157,7 +157,7 @@ class Downloader
157
157
  # toc 読込
158
158
  #
159
159
  def self.get_toc_data(archive_path)
160
- YAML.load_file(File.join(archive_path, TOC_FILE_NAME))
160
+ YAML.unsafe_load_file(File.join(archive_path, TOC_FILE_NAME))
161
161
  end
162
162
 
163
163
  def self.get_toc_by_target(target)
@@ -801,6 +801,7 @@ class Downloader
801
801
  raise if through_error # エラー処理はしなくていいからそのまま例外を受け取りたい時用
802
802
  if e.message.include?("404")
803
803
  @stream.error "小説が削除されているか非公開な可能性があります"
804
+ sleep_for_download
804
805
  if database.novel_exists?(@id)
805
806
  Command::Tag.execute!(%W(#{@id} --add 404 --color white --no-overwrite-color), io: Narou::NullIO.new)
806
807
  Command::Freeze.execute!(@id, "--on")
@@ -1042,7 +1043,7 @@ class Downloader
1042
1043
  def different_section?(old_relative_path, new_subtitle_info)
1043
1044
  path = get_novel_data_dir.join(old_relative_path)
1044
1045
  return true unless path.exist?
1045
- YAML.load_file(path)["element"] != new_subtitle_info["element"]
1046
+ YAML.unsafe_load_file(path)["element"] != new_subtitle_info["element"]
1046
1047
  end
1047
1048
 
1048
1049
  #
@@ -1267,7 +1268,7 @@ class Downloader
1267
1268
  #
1268
1269
  # 小説データの格納ディレクトリから読み込む
1269
1270
  def load_novel_data(filename)
1270
- YAML.load_file(get_novel_data_dir.join(filename))
1271
+ YAML.unsafe_load_file(get_novel_data_dir.join(filename))
1271
1272
  rescue Errno::ENOENT
1272
1273
  nil
1273
1274
  end
data/lib/helper.rb CHANGED
@@ -375,7 +375,7 @@ module Helper
375
375
  #
376
376
  def erb_copy(src, dst, _binding)
377
377
  data = File.read(src, mode: "r:BOM|UTF-8")
378
- result = ERB.new(data, nil, "-").result(_binding)
378
+ result = ERB.new(data, trim_mode: "-").result(_binding)
379
379
  File.write(dst, result)
380
380
  end
381
381
 
data/lib/inventory.rb CHANGED
@@ -44,13 +44,13 @@ module Inventory
44
44
  return unless File.exist?(@inventory_file_path)
45
45
  self.merge!(Helper::CacheLoader.memo(@inventory_file_path) { |yaml|
46
46
  begin
47
- YAML.load(yaml)
47
+ YAML.unsafe_load(yaml)
48
48
  rescue Psych::SyntaxError
49
49
  unless restore(@inventory_file_path)
50
50
  error "#{@inventory_file_path} が壊れてるっぽい"
51
51
  raise
52
52
  end
53
- YAML.load_file(@inventory_file_path)
53
+ YAML.unsafe_load_file(@inventory_file_path)
54
54
  end
55
55
  })
56
56
  end
data/lib/mailer.rb CHANGED
@@ -23,7 +23,7 @@ class Mailer
23
23
  this.clear
24
24
  setting_file_path = File.join(Narou.root_dir, SETTING_FILE)
25
25
  if File.exist?(setting_file_path)
26
- options = YAML.load_file(setting_file_path)
26
+ options = YAML.unsafe_load_file(setting_file_path)
27
27
  unless options.delete(:complete)
28
28
  raise SettingUncompleteError, "設定ファイルの書き換えが終了していないようです。\n" +
29
29
  "設定ファイルは #{setting_file_path} にあります"
@@ -436,7 +436,7 @@ class NovelConverter
436
436
  def load_novel_section(subtitle_info, section_save_dir)
437
437
  file_subtitle = subtitle_info["file_subtitle"] || subtitle_info["subtitle"] # 互換性維持のため
438
438
  path = section_save_dir.join("#{subtitle_info["index"]} #{file_subtitle}.yaml")
439
- YAML.load_file(path)
439
+ YAML.unsafe_load_file(path)
440
440
  rescue Errno::ENOENT => e
441
441
  stream_io.puts
442
442
  stream_io.error(<<~MSG.termcolor)
data/lib/sitesetting.rb CHANGED
@@ -72,7 +72,7 @@ class SiteSetting
72
72
 
73
73
  def initialize(path)
74
74
  @match_values = {}
75
- @yaml = YAML.load_file(path)
75
+ @yaml = YAML.unsafe_load_file(path)
76
76
  @path = path
77
77
  end
78
78
 
data/lib/template.rb CHANGED
@@ -50,7 +50,7 @@ class Template
50
50
  path = dir.join(TEMPLATE_DIR, src_filename + ".erb")
51
51
  next unless path.exist?
52
52
  src = Helper::CacheLoader.load(path)
53
- result = ERB.new(src, nil, "-").result(_binding)
53
+ result = ERB.new(src, trim_mode: "-").result(_binding)
54
54
  return result
55
55
  end
56
56
  raise LoadError, "テンプレートファイルが見つかりません。(#{src_filename}.erb)"
data/lib/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
  #
6
6
 
7
7
  module Narou
8
- VERSION = "3.7.1"
8
+ VERSION = "3.7.2"
9
9
  end
data/lib/web/appserver.rb CHANGED
@@ -422,7 +422,7 @@ class Narou::AppServer < Sinatra::Base
422
422
  postscripts_count = 0
423
423
  toc["subtitles"].each do |sub|
424
424
  begin
425
- element = YAML.load_file(downloader.section_file_path(sub))["element"]
425
+ element = YAML.unsafe_load_file(downloader.section_file_path(sub))["element"]
426
426
  data_type = element["data_type"] || "text"
427
427
  introduction = element["introduction"] || ""
428
428
  postscript = element["postscript"] || ""
@@ -893,8 +893,9 @@ class Narou::AppServer < Sinatra::Base
893
893
  post "/api/eject" do
894
894
  do_eject = proc do
895
895
  device = Narou.get_device
896
- device.eject if device
897
- puts "<bold><green>端末を取り外しました</green></bold>".termcolor
896
+ device&.eject do
897
+ puts "<bold><green>端末を取り外しました</green></bold>".termcolor
898
+ end
898
899
  end
899
900
  if params["enqueue"] == "true"
900
901
  Narou::WebWorker.push do
data/narou.gemspec CHANGED
@@ -32,18 +32,15 @@ Gem::Specification.new do |gem|
32
32
  install_message = <<-EOS
33
33
  #{"*" * 60}
34
34
 
35
- 3.7.1: 2021/04/01
35
+ 3.7.2: 2021/06/05
36
36
  -----------------
37
- #### 修正内容
38
- - その他の小説の最新話掲載日を確認しようとするとクラッシュする不具合を修正
39
-
37
+ #### 追加機能
38
+ - folder コマンドに --no-open (-n) オプションを追加しました
40
39
 
41
- 3.7.0: 2021/01/23
42
- -----------------
43
40
  #### 修正内容
44
- - Apple Silicon 搭載 Mac でも動く様にライブラリをアップデート
45
- - device kobo に設定し、ebook-filename-length-limit でファイル名が制限され
46
- た場合に send コマンドが正常に実行できない不具合を修正
41
+ - gem update を行うとクラッシュする場合があったのを修正
42
+ - psych 4.0 からの非互換に対応
43
+ - その他軽微な修正
47
44
 
48
45
  #{"*" * 60}
49
46
  EOS
@@ -72,6 +69,7 @@ Gem::Specification.new do |gem|
72
69
  gem.add_runtime_dependency 'activesupport', '>= 6.1', '< 8.0'
73
70
  gem.add_runtime_dependency 'unicode-display_width', '~> 1.4'
74
71
  gem.add_runtime_dependency 'webrick', '~> 1.7'
72
+ gem.add_runtime_dependency 'psych', '~> 4.0'
75
73
 
76
74
  gem.add_development_dependency 'rspec', '~> 3.10'
77
75
  gem.add_development_dependency 'rspec-retry', '~> 0.6'
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.1
4
+ version: 3.7.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-04-01 00:00:00.000000000 Z
11
+ date: 2021-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: termcolorlight
@@ -340,6 +340,20 @@ dependencies:
340
340
  - - "~>"
341
341
  - !ruby/object:Gem::Version
342
342
  version: '1.7'
343
+ - !ruby/object:Gem::Dependency
344
+ name: psych
345
+ requirement: !ruby/object:Gem::Requirement
346
+ requirements:
347
+ - - "~>"
348
+ - !ruby/object:Gem::Version
349
+ version: '4.0'
350
+ type: :runtime
351
+ prerelease: false
352
+ version_requirements: !ruby/object:Gem::Requirement
353
+ requirements:
354
+ - - "~>"
355
+ - !ruby/object:Gem::Version
356
+ version: '4.0'
343
357
  - !ruby/object:Gem::Dependency
344
358
  name: rspec
345
359
  requirement: !ruby/object:Gem::Requirement
@@ -695,18 +709,15 @@ metadata: {}
695
709
  post_install_message: |
696
710
  ************************************************************
697
711
 
698
- 3.7.1: 2021/04/01
712
+ 3.7.2: 2021/06/05
699
713
  -----------------
700
- #### 修正内容
701
- - その他の小説の最新話掲載日を確認しようとするとクラッシュする不具合を修正
702
-
714
+ #### 追加機能
715
+ - folder コマンドに --no-open (-n) オプションを追加しました
703
716
 
704
- 3.7.0: 2021/01/23
705
- -----------------
706
717
  #### 修正内容
707
- - Apple Silicon 搭載 Mac でも動く様にライブラリをアップデート
708
- - device kobo に設定し、ebook-filename-length-limit でファイル名が制限され
709
- た場合に send コマンドが正常に実行できない不具合を修正
718
+ - gem update を行うとクラッシュする場合があったのを修正
719
+ - psych 4.0 からの非互換に対応
720
+ - その他軽微な修正
710
721
 
711
722
  ************************************************************
712
723
  rdoc_options: []
@@ -723,7 +734,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
723
734
  - !ruby/object:Gem::Version
724
735
  version: '0'
725
736
  requirements: []
726
- rubygems_version: 3.2.3
737
+ rubygems_version: 3.2.15
727
738
  signing_key:
728
739
  specification_version: 4
729
740
  summary: Narou.rb ― 小説家になろうダウンローダ&縦書用整形スクリプト