narou 3.5.0.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: 95bf07d5d411dc375dc6fdef96d6539c2f3d66b63bd71f0f48ab883f16e42ffc
4
- data.tar.gz: 53e35c22ca89fb11c8c27945c23790f174e418ce353e818ff28d5374caf30cee
3
+ metadata.gz: 19f8ca4a5c4225bab91baaf79b822783531ec9165aff057cd7711f8dd0836ab2
4
+ data.tar.gz: 852f0b011c02a4a961b0944b4b563e56fb0513761090d07e98d7c47b42917c26
5
5
  SHA512:
6
- metadata.gz: 41a54f0b642fc2aea1a5e8d52b196c7b9ab6353bfd27bc3f0dbb5f8c5d867432a5783c1640bb64c37451a9ab84a41078f09b85cb5bd4b65043d4d302d248b7a8
7
- data.tar.gz: 84a52aff09cddeed454fcd07f6b25385c75a3f807145f59f1086fe611a03d966237a4fa5a9e0251158b33f30a76debf8e7033503bc010c98d06b01622bef1e47
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
@@ -12,8 +12,8 @@ jobs:
12
12
  - checkout
13
13
 
14
14
  - run:
15
- name: Which bundler?
16
- command: bundle -v
15
+ name: Install bundler 2.1.4
16
+ command: gem install bundler:2.1.4
17
17
 
18
18
  # Restore bundle cache
19
19
  - restore_cache:
data/.rubocop.yml CHANGED
@@ -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"
@@ -179,7 +176,7 @@ Style/StringLiterals:
179
176
  Style/SymbolProc:
180
177
  Enabled: true
181
178
 
182
- Layout/Tab:
179
+ Layout/IndentationStyle:
183
180
  Enabled: true
184
181
 
185
182
  Layout/TrailingEmptyLines:
@@ -241,3 +238,6 @@ Style/FormatStringToken:
241
238
 
242
239
  Layout/EmptyLineAfterGuardClause:
243
240
  Enabled: false
241
+
242
+ Style/StderrPuts:
243
+ Enabled: false
data/ChangeLog.md CHANGED
@@ -1,6 +1,43 @@
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
+
14
+ 3.7.1: 2021/04/01
15
+ -----------------
16
+ #### 修正内容
17
+ - その他の小説の最新話掲載日を確認しようとするとクラッシュする不具合を修正
18
+
19
+
20
+ 3.7.0: 2021/01/23
21
+ -----------------
22
+ #### 修正内容
23
+ - Apple Silicon 搭載 Mac でも動く様にライブラリをアップデート
24
+ - device を kobo に設定し、ebook-filename-length-limit でファイル名が制限され
25
+ た場合に send コマンドが正常に実行できない不具合を修正
26
+
27
+ 3.6.0: 2021/01/02
28
+ -----------------
29
+ #### 修正内容
30
+ - Ruby 3.0 に対応
31
+
32
+
33
+ 3.5.1: 2020/03/21
34
+ -----------------
35
+ #### 修正内容
36
+ - 小説家になろう系列の挿絵をダウンロード時に、サムネイル画像を取得するように
37
+ なってしまっていたのを修正
38
+ - Ruby 2.7 で narou setting -l を実行時に警告が大量に出ていたのを修正
39
+
40
+
4
41
  3.5.0: 2020/02/16
5
42
  -----------------
6
43
  #### 修正内容
data/Gemfile.lock CHANGED
@@ -1,119 +1,131 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- narou (3.5.0)
5
- activesupport (~> 5.2)
4
+ narou (3.7.1)
5
+ activesupport (>= 6.1, < 8.0)
6
6
  diff-lcs (~> 1.2, >= 1.2.5)
7
7
  erubis (~> 2.7)
8
+ ffi (~> 1.4, >= 1.4.2)
8
9
  haml (>= 5.1.2, < 6)
9
10
  mail (~> 2.6.0, >= 2.6.6)
10
11
  memoist (~> 0.11.0)
11
12
  open_uri_redirections (~> 0.2, >= 0.2.1)
12
13
  pony (~> 1, >= 1.11)
14
+ psych (~> 4.0)
13
15
  rubyzip (~> 2.0, >= 2.0.0)
14
- sass (~> 3.4, >= 3.4.18)
15
- sinatra (~> 1.4, >= 1.4.5)
16
- sinatra-contrib (~> 1.4, >= 1.4.2)
16
+ sassc (~> 2.4)
17
+ sinatra (~> 2.0, >= 2.0.8.1)
18
+ sinatra-contrib (~> 2.0, >= 2.0.8.1)
17
19
  systemu (~> 2.6, >= 2.6.5)
18
20
  termcolorlight (~> 1.0, >= 1.1.1)
19
21
  tilt (~> 2.0, >= 2.0.10)
20
22
  unicode-display_width (~> 1.4)
23
+ webrick (~> 1.7)
21
24
 
22
25
  GEM
23
26
  remote: https://rubygems.org/
24
27
  specs:
25
- activesupport (5.2.4.1)
28
+ activesupport (6.1.3.2)
26
29
  concurrent-ruby (~> 1.0, >= 1.0.2)
27
- i18n (>= 0.7, < 2)
28
- minitest (~> 5.1)
29
- tzinfo (~> 1.1)
30
+ i18n (>= 1.6, < 2)
31
+ minitest (>= 5.1)
32
+ tzinfo (~> 2.0)
33
+ zeitwerk (~> 2.3)
30
34
  awesome_print (1.8.0)
31
- backports (3.15.0)
32
- byebug (11.1.1)
33
- coderay (1.1.2)
34
- concurrent-ruby (1.1.5)
35
- diff-lcs (1.3)
36
- docile (1.3.2)
35
+ byebug (11.1.3)
36
+ coderay (1.1.3)
37
+ concurrent-ruby (1.1.8)
38
+ diff-lcs (1.4.4)
39
+ docile (1.3.5)
37
40
  erubis (2.7.0)
38
- ffi (1.12.2)
39
- haml (5.1.2)
41
+ ffi (1.14.2)
42
+ ffi (1.14.2-java)
43
+ haml (5.2.1)
40
44
  temple (>= 0.8.0)
41
45
  tilt
42
- i18n (1.7.0)
46
+ i18n (1.8.10)
43
47
  concurrent-ruby (~> 1.0)
48
+ jar-dependencies (0.4.1)
44
49
  mail (2.6.6)
45
50
  mime-types (>= 1.16, < 4)
46
51
  memoist (0.11.0)
47
- method_source (0.9.2)
52
+ method_source (1.0.0)
48
53
  mime-types (3.3.1)
49
54
  mime-types-data (~> 3.2015)
50
- mime-types-data (3.2019.1009)
51
- minitest (5.13.0)
52
- multi_json (1.14.1)
55
+ mime-types-data (3.2021.0225)
56
+ minitest (5.14.4)
57
+ multi_json (1.15.0)
58
+ mustermann (1.1.1)
59
+ ruby2_keywords (~> 0.0.1)
53
60
  open_uri_redirections (0.2.1)
54
61
  pony (1.13.1)
55
62
  mail (>= 2.0)
56
- pry (0.12.2)
57
- coderay (~> 1.1.0)
58
- method_source (~> 0.9.0)
59
- pry-byebug (3.8.0)
63
+ pry (0.13.1)
64
+ coderay (~> 1.1)
65
+ method_source (~> 1.0)
66
+ pry (0.13.1-java)
67
+ coderay (~> 1.1)
68
+ method_source (~> 1.0)
69
+ spoon (~> 0.0)
70
+ pry-byebug (3.9.0)
60
71
  byebug (~> 11.0)
61
- pry (~> 0.10)
62
- rack (1.6.12)
63
- rack-protection (1.5.5)
72
+ pry (~> 0.13.0)
73
+ psych (4.0.0)
74
+ psych (4.0.0-java)
75
+ jar-dependencies (>= 0.1.7)
76
+ rack (2.2.3)
77
+ rack-protection (2.1.0)
64
78
  rack
65
- rack-test (1.1.0)
66
- rack (>= 1.0, < 3)
67
- rb-fsevent (0.10.3)
68
- rb-inotify (0.10.1)
69
- ffi (~> 1.0)
70
- rspec (3.9.0)
71
- rspec-core (~> 3.9.0)
72
- rspec-expectations (~> 3.9.0)
73
- rspec-mocks (~> 3.9.0)
74
- rspec-core (3.9.1)
75
- rspec-support (~> 3.9.1)
76
- rspec-expectations (3.9.0)
79
+ rspec (3.10.0)
80
+ rspec-core (~> 3.10.0)
81
+ rspec-expectations (~> 3.10.0)
82
+ rspec-mocks (~> 3.10.0)
83
+ rspec-core (3.10.1)
84
+ rspec-support (~> 3.10.0)
85
+ rspec-expectations (3.10.1)
77
86
  diff-lcs (>= 1.2.0, < 2.0)
78
- rspec-support (~> 3.9.0)
79
- rspec-mocks (3.9.1)
87
+ rspec-support (~> 3.10.0)
88
+ rspec-mocks (3.10.1)
80
89
  diff-lcs (>= 1.2.0, < 2.0)
81
- rspec-support (~> 3.9.0)
90
+ rspec-support (~> 3.10.0)
82
91
  rspec-retry (0.6.2)
83
92
  rspec-core (> 3.3)
84
- rspec-support (3.9.2)
93
+ rspec-support (3.10.1)
85
94
  rspec_junit_formatter (0.4.1)
86
95
  rspec-core (>= 2, < 4, != 2.12.0)
87
- rubyzip (2.0.0)
88
- sass (3.7.4)
89
- sass-listen (~> 4.0.0)
90
- sass-listen (4.0.0)
91
- rb-fsevent (~> 0.9, >= 0.9.4)
92
- rb-inotify (~> 0.9, >= 0.9.7)
93
- simplecov (0.18.2)
96
+ ruby2_keywords (0.0.4)
97
+ rubyzip (2.3.0)
98
+ sassc (2.4.0)
99
+ ffi (~> 1.9)
100
+ simplecov (0.21.2)
94
101
  docile (~> 1.1)
95
102
  simplecov-html (~> 0.11)
96
- simplecov-html (0.12.0)
97
- sinatra (1.4.8)
98
- rack (~> 1.5)
99
- rack-protection (~> 1.4)
100
- tilt (>= 1.3, < 3)
101
- sinatra-contrib (1.4.7)
102
- backports (>= 2.0)
103
+ simplecov_json_formatter (~> 0.1)
104
+ simplecov-html (0.12.3)
105
+ simplecov_json_formatter (0.1.2)
106
+ sinatra (2.1.0)
107
+ mustermann (~> 1.0)
108
+ rack (~> 2.2)
109
+ rack-protection (= 2.1.0)
110
+ tilt (~> 2.0)
111
+ sinatra-contrib (2.1.0)
103
112
  multi_json
104
- rack-protection
105
- rack-test
106
- sinatra (~> 1.4.0)
107
- tilt (>= 1.3, < 3)
113
+ mustermann (~> 1.0)
114
+ rack-protection (= 2.1.0)
115
+ sinatra (= 2.1.0)
116
+ tilt (~> 2.0)
117
+ spoon (0.0.6)
118
+ ffi
108
119
  systemu (2.6.5)
109
120
  temple (0.8.2)
110
121
  termcolorlight (1.1.1)
111
- thread_safe (0.3.6)
112
122
  tilt (2.0.10)
113
- timecop (0.9.1)
114
- tzinfo (1.2.6)
115
- thread_safe (~> 0.1)
116
- unicode-display_width (1.6.0)
123
+ timecop (0.9.2)
124
+ tzinfo (2.0.4)
125
+ concurrent-ruby (~> 1.0)
126
+ unicode-display_width (1.7.0)
127
+ webrick (1.7.0)
128
+ zeitwerk (2.4.2)
117
129
 
118
130
  PLATFORMS
119
131
  java
@@ -124,11 +136,11 @@ DEPENDENCIES
124
136
  narou!
125
137
  pry (~> 0.12)
126
138
  pry-byebug (~> 3.8)
127
- rspec (~> 3.9)
139
+ rspec (~> 3.10)
128
140
  rspec-retry (~> 0.6)
129
141
  rspec_junit_formatter (~> 0.4)
130
- simplecov (~> 0.18)
142
+ simplecov (~> 0.20)
131
143
  timecop (~> 0.9)
132
144
 
133
145
  BUNDLED WITH
134
- 1.17.3
146
+ 2.2.15
data/README.md CHANGED
@@ -34,10 +34,15 @@ Narou.rb - 小説家になろうのダウンローダ&縦書き整形&管理
34
34
  更新履歴 - ChangeLog
35
35
  --------------------
36
36
 
37
- 3.5.0: 2020/02/16
37
+ 3.7.2: 2021/06/05
38
38
  -----------------
39
+ #### 追加機能
40
+ - folder コマンドに --no-open (-n) オプションを追加しました
41
+
39
42
  #### 修正内容
40
- - Ruby 2.7 に対応
43
+ - gem update を行うとクラッシュする場合があったのを修正
44
+ - psych 4.0 からの非互換に対応
45
+ - その他軽微な修正
41
46
 
42
47
  ----
43
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} は存在しません"
@@ -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
@@ -537,8 +537,8 @@ module Command
537
537
  "webui.theme" => {
538
538
  type: :select, help: "WEB UI 用テーマ選択",
539
539
  invisible: true,
540
- select_keys: Narou.get_theme_names,
541
- select_summaries: Narou.get_theme_names,
540
+ select_keys: Narou.theme_names,
541
+ select_summaries: Narou.theme_names,
542
542
  tab: :webui
543
543
  },
544
544
  "webui.table.reload-timing" => {
@@ -4,6 +4,7 @@
4
4
  # Copyright 2013 whiteleaf. All rights reserved.
5
5
  #
6
6
 
7
+ require "net/http"
7
8
  require_relative "../../narou/api"
8
9
 
9
10
  module Command
@@ -63,7 +64,7 @@ module Command
63
64
  interval.wait
64
65
  begin
65
66
  downloader = Downloader.new(id)
66
- next unless downloader.get_latest_table_of_contents(through_error: true)
67
+ next unless downloader.get_latest_table_of_contents(downloader.load_toc_file, through_error: true)
67
68
  dates = {
68
69
  "novelupdated_at" => downloader.get_novelupdated_at,
69
70
  "general_lastup" => downloader.get_general_lastup,
data/lib/converterbase.rb CHANGED
@@ -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
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?