narou 1.2.6 → 1.2.7

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
  SHA1:
3
- metadata.gz: b354484b31f9039b4ef4b9fb16e52fbcc27b52d6
4
- data.tar.gz: 05ea451ee412bede621e8fcba2a8a48d23c00adf
3
+ metadata.gz: 463957e3d0b689f5ad9a4953dd3c5b277e599ce2
4
+ data.tar.gz: 26d961f89766158f70d9a432a75553ebd599fc3c
5
5
  SHA512:
6
- metadata.gz: 2bf754d516ee27457d0da57de396b174df34a7f90ba93f2a2138d7fa5f37121d7f80faf02cb537d3ba244dbeff04d16d488b1d91b512c4152de9f41e306c515f
7
- data.tar.gz: b73adc265e43418a5ab23b410e1c20187455c17cb794d69a8ceef47ec2663d6bacf02d9b3efcc091322d03ea8636af6aa892f5ec3fc7cf05f946320af2207b31
6
+ metadata.gz: f1818f095899f1d0c85aacf8e1d418676bcd43380c689274f97640afdab51ee6220a805ce8b0062323025c479806d84acfa8c22fc3fec8ab6c49e94bd15e1814
7
+ data.tar.gz: 597951c1472d4360c2156560a561ec30cfeca82ef429c0c54437d8d44802f5cbb43d1406ddc103a5ac3d2faaeecf900cd83e86e275df7efaf0b1c994606c4502
@@ -1,11 +1,18 @@
1
1
  
2
2
  更新履歴 - ChangeLog
3
3
  --------------------
4
+ 2013/06/12 : **1.2.7**
5
+ * 追加機能もしくは仕様変更
6
+ - 小説更新時及び `list` コマンドで新着話数があるかどうかを目視出来るようにした
7
+ + 更新時はタイトル横に (新着) 表示
8
+ + list コマンドでは当日に新着のあった小説の日付が紫になる
9
+ - 新着表示が優先で、新着がなくて更新だけの場合は緑になる
10
+
4
11
  2013/05/17 : **1.2.6**
5
12
  * Bug Fix
6
13
  - `convert` コマンドで直接テキストファイルを変換時に電子書籍デバイスへ送信できなかった不具合を修正
7
14
  * 追加機能もしくは仕様変更
8
- - `list` コマンドでその日に更新された小説の日付に色をつけてわかりやすくした
15
+ - `list` コマンドでその日に更新された小説の日付を緑にして分かりやすくした
9
16
  - 電子書籍デバイスへの自動送信で Kindle Fire/HD に対応(動作未確認)
10
17
 
11
18
  2013/05/08 : **1.2.5.1**
data/README.md CHANGED
@@ -20,6 +20,13 @@ Narou.rb ― 「小説家になろう」「小説を読もう!」ダウンロ
20
20
 
21
21
  更新履歴 - ChangeLog
22
22
  --------------------
23
+ 2013/06/12 : **1.2.7**
24
+ * 追加機能もしくは仕様変更
25
+ - 小説更新時及び `list` コマンドで新着話数があるかどうかを目視出来るようにした
26
+ + 更新時はタイトル横に (新着) 表示
27
+ + list コマンドでは当日に新着のあった小説の日付が紫になる
28
+ - 新着表示が優先で、新着がなくて更新だけの場合は緑になる
29
+
23
30
  2013/05/17 : **1.2.6**
24
31
  * Bug Fix
25
32
  - `convert` コマンドで直接テキストファイルを変換時に電子書籍デバイスへ送信できなかった不具合を修正
@@ -37,23 +44,6 @@ Narou.rb ― 「小説家になろう」「小説を読もう!」ダウンロ
37
44
  * 追加機能もしくは仕様変更
38
45
  - 連続空行の改ページ化設定をデフォルトでオフに変更
39
46
 
40
- 2013/04/20 : **1.2.4**
41
- * Bug Fix
42
- - 自動行頭字下げの判定方法を調整(括弧等を除いた行に対する割合で計算するように変更)
43
- - かぎ括弧内自動連結時に、行末が!?で次の行頭が漢数字だった場合に全角空白が入らなかった問題を修正加
44
- - 更新チェック時にサブタイトルもチェックするようにした
45
- - サブタイトルの中の2桁以下の半角アラビア数字を強制縦中横化するようにした
46
- + AozoraEpub3 の仕様で見出し内の自動縦中横化働かないため
47
- * 追加機能もしくは仕様変更
48
- - サブタイトルの数字は漢数字化しないように変更
49
- - 区切り記号にタブを追加(preset/bordersymbols.txt)
50
- - 手動折り返しの自動連結をしないパターンに、行頭三点リーダーおよび全角ダッシュを追加
51
- - `download --force` 時に強制上書きする以前の仕様に戻した
52
- - 連続した句読点を三点リーダーに変換するようにした
53
- - 一定以上連続する空行を改ページに変換
54
- + `setting.ini` に `enable_convert_page_break` 及び `to_page_break_threshold` を追加
55
- - 「Re:ゼロから始める異世界生活」用の変換設定を追加
56
-
57
47
  ----
58
48
 
59
49
  「小説家になろう」は株式会社ヒナプロジェクトの登録商標です
@@ -61,7 +61,7 @@ module Command
61
61
  end
62
62
  next
63
63
  end
64
- unless Downloader.start(download_target, @options["force"])
64
+ unless Downloader.start(download_target, @options["force"], true)
65
65
  next
66
66
  end
67
67
  unless @options["no-convert"]
@@ -45,7 +45,9 @@ module Command
45
45
  puts [
46
46
  disp_id,
47
47
  novel["last_update"].strftime("%y/%m/%d").tap { |s|
48
- if s == today
48
+ if novel["new_arrivals_date"] && novel["new_arrivals_date"].strftime("%y/%m/%d") == today
49
+ s.replace "<bold><magenta>#{s}</magenta></bold>".termcolor
50
+ elsif s == today
49
51
  s.replace "<bold><green>#{s}</green></bold>".termcolor
50
52
  end
51
53
  },
@@ -32,7 +32,7 @@ class Downloader
32
32
  #
33
33
  # force が true なら全話強制ダウンロード
34
34
  #
35
- def self.start(target, force = false)
35
+ def self.start(target, force = false, from_download = false)
36
36
  setting = nil
37
37
  target = Narou.alias_to_id(target)
38
38
  case type = get_target_type(target)
@@ -60,7 +60,7 @@ class Downloader
60
60
  return false
61
61
  end
62
62
  end
63
- downloader = Downloader.new(setting, force)
63
+ downloader = Downloader.new(setting, force, from_download)
64
64
  result = downloader.start_download
65
65
  setting.clear
66
66
  result
@@ -271,10 +271,12 @@ class Downloader
271
271
  #
272
272
  # コンストラクタ
273
273
  #
274
- def initialize(site_setting, force = false)
274
+ def initialize(site_setting, force = false, from_download = false)
275
275
  @setting = site_setting
276
276
  @force = force
277
+ @from_download = from_download
277
278
  @cache_dir = nil
279
+ @new_arrivals = false
278
280
  @id = @@database.get_id("toc_url", @setting["toc_url"]) || @@database.get_new_id
279
281
  end
280
282
 
@@ -375,7 +377,8 @@ class Downloader
375
377
  "toc_url" => @setting["toc_url"],
376
378
  "sitename" => @setting["name"],
377
379
  "novel_type" => @novel_type,
378
- "last_update" => Time.now
380
+ "last_update" => Time.now,
381
+ "new_arrivals_date" => (@new_arrivals ? Time.now : @@database[@id]["new_arrivals_date"])
379
382
  }
380
383
  @@database.save_database
381
384
  end
@@ -514,7 +517,16 @@ class Downloader
514
517
  info["element"] = section_element
515
518
  section_file_name = "#{index} #{file_subtitle}.yaml"
516
519
  section_file_path = File.join(SECTION_SAVE_DIR_NAME, section_file_name)
517
- print " (更新あり)" if @force && different_section?(section_file_path, info)
520
+ if File.exists?(File.join(get_novel_data_dir, section_file_path))
521
+ if @force && different_section?(section_file_path, info)
522
+ print " (更新あり)"
523
+ end
524
+ else
525
+ if !@from_download || (@from_download && @force)
526
+ print " <bold><magenta>(新着)</magenta></bold>".termcolor
527
+ end
528
+ @new_arrivals = true
529
+ end
518
530
  move_to_cache_dir(section_file_path)
519
531
  save_novel_data(section_file_path, info)
520
532
  save_least_one = true
@@ -3,7 +3,7 @@
3
3
  # Copyright 2013 whiteleaf. All rights reserved.
4
4
  #
5
5
 
6
- Version = "1.2.6"
6
+ Version = "1.2.7"
7
7
 
8
8
  cv_path = File.expand_path(File.join(File.dirname(__FILE__), "../commitversion"))
9
9
  if File.exists?(cv_path)
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: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - whiteleaf7
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-17 00:00:00.000000000 Z
11
+ date: 2013-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: termcolor