narou 1.3.5.1 → 1.4.0
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 +4 -4
- data/ChangeLog.md +5 -0
- data/README.md +8 -0
- data/lib/downloader.rb +1 -0
- data/lib/extensions/windows.rb +21 -51
- data/lib/version.rb +1 -1
- data/narou.gemspec +5 -13
- data/webnovel/ncode.syosetu.com.yaml +8 -7
- data/webnovel/novel18.syosetu.com.yaml +8 -7
- metadata +18 -11
- data/preset/xhtml_nav.vm +0 -110
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f889f3d5a5df83dbff3c259294b1931a9a4a079
|
4
|
+
data.tar.gz: 239b082318e0fa16107128ca38f55ce0121dea91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdd282614694a0f27441cc97049b2e77e9696f3768cc86d36a34f515fb99114c043c8a3add2a005fd968582db521baccb3f80ce039a7597fc013119226f81b2b
|
7
|
+
data.tar.gz: 66a387ce3d6268ae3cded70e841b041617dc4b9ccfd38da99fa5a1ae5dafae1be18d751e6fc92141e23361052f9b601c2b540c627a93d6e6c11e7cb86cced7cc
|
data/ChangeLog.md
CHANGED
data/README.md
CHANGED
@@ -21,6 +21,14 @@ Narou.rb ― 「小説家になろう」「小説を読もう!」ダウンロ
|
|
21
21
|
更新履歴 - ChangeLog
|
22
22
|
--------------------
|
23
23
|
|
24
|
+
2014/02/20 : **1.4.0**
|
25
|
+
* 重要な修正
|
26
|
+
- 小説家になろうのレイアウト変更によって更新処理ができなくなっていたものを修正しました
|
27
|
+
|
28
|
+
2014/02/03 : **1.3.5.1**
|
29
|
+
* Bug Fix
|
30
|
+
- 過去バージョンとの互換性維持のため、フォルダ名のみ末尾スペースを削除するように変更
|
31
|
+
|
24
32
|
2014/02/03 : **1.3.5**
|
25
33
|
* Bug Fix
|
26
34
|
- 小説を削除したあと再度ダウンロードしようとした場合にエラーが出ていたのを修正
|
data/lib/downloader.rb
CHANGED
@@ -483,6 +483,7 @@ class Downloader
|
|
483
483
|
@setting.multi_match(toc_source, "title", "author", "story", "tcode")
|
484
484
|
@title = @setting["title"]
|
485
485
|
@file_title = Helper.replace_filename_special_chars(@title).strip
|
486
|
+
@setting["story"] = @setting["story"].gsub("<br />", "")
|
486
487
|
toc_objects = {
|
487
488
|
"title" => @title,
|
488
489
|
"author" => @setting["author"],
|
data/lib/extensions/windows.rb
CHANGED
@@ -1,58 +1,28 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@@get_logical_drive_strings.call(buf_size, buffer)
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.SetConsoleTextAttribute(cons_handle, attr)
|
18
|
-
@@set_console_text_attribute ||=
|
19
|
-
Function.new(Kernel32["SetConsoleTextAttribute"], [-TYPE_INT, -TYPE_INT], -TYPE_INT)
|
20
|
-
@@set_console_text_attribute.call(cons_handle, attr)
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.GetConsoleScreenBufferInfo(cons_handle, lp_buffer)
|
24
|
-
@@get_console_screen_buffer_info ||=
|
25
|
-
Function.new(Kernel32["GetConsoleScreenBufferInfo"], [TYPE_LONG, TYPE_VOIDP], TYPE_INT)
|
26
|
-
@@get_console_screen_buffer_info.call(cons_handle, lp_buffer)
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.GetStdHandle(handle_type)
|
30
|
-
@@get_std_handle ||= Function.new(Kernel32["GetStdHandle"], [-TYPE_INT], -TYPE_INT)
|
31
|
-
@@get_std_handle.call(handle_type)
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.GetLastError
|
35
|
-
@@get_last_error ||= Function.new(Kernel32["GetLastError"], [], -TYPE_INT)
|
36
|
-
@@get_last_error.call
|
37
|
-
end
|
2
|
+
#
|
3
|
+
# Copyright 2013 whiteleaf. All rights reserved.
|
4
|
+
#
|
5
|
+
|
6
|
+
module WinAPI
|
7
|
+
begin
|
8
|
+
require "fiddle/import"
|
9
|
+
extend Fiddle::Importer
|
10
|
+
rescue LoadError
|
11
|
+
# Fiddle がない環境用(http://www.artonx.org/data/asr/ の1.9.3とか)
|
12
|
+
require "dl/import"
|
13
|
+
extend DL::Importer
|
38
14
|
end
|
39
|
-
rescue LoadError
|
40
|
-
# Fiddle がない環境用(http://www.artonx.org/data/asr/ の1.9.3とか)
|
41
|
-
require "dl/import"
|
42
15
|
|
43
16
|
class InvalidOS < StandardError; end
|
44
17
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
rescue DL::DLError
|
55
|
-
raise InvalidOS, "not Windows"
|
56
|
-
end
|
18
|
+
begin
|
19
|
+
dlload "kernel32"
|
20
|
+
extern "long GetLogicalDriveStrings(long, void*)"
|
21
|
+
extern "unsigned long SetConsoleTextAttribute(unsigned long, unsigned long)"
|
22
|
+
extern "unsigned long GetConsoleScreenBufferInfo(unsigned long, void*)"
|
23
|
+
extern "unsigned long GetStdHandle(unsigned long)"
|
24
|
+
extern "long GetLastError()"
|
25
|
+
rescue DL::DLError
|
26
|
+
raise InvalidOS, "not Windows"
|
57
27
|
end
|
58
28
|
end
|
data/lib/version.rb
CHANGED
data/narou.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |gem|
|
|
36
36
|
を違和感なく縦書で読むことが出来るようになります。
|
37
37
|
}.split("\n").join
|
38
38
|
|
39
|
-
|
39
|
+
install_message = <<-EOS
|
40
40
|
#{"*" * 79}
|
41
41
|
|
42
42
|
narou コマンドのインストール or アップデートが完了しました。
|
@@ -47,21 +47,13 @@ narou コマンドのインストール or アップデートが完了しまし
|
|
47
47
|
任意のフォルダで `narou init' を実行して下さい。
|
48
48
|
|
49
49
|
更新内容
|
50
|
-
2014/02/
|
51
|
-
*
|
52
|
-
-
|
53
|
-
- タイトル名の末端に半角スペースがある小説が正常にダウンロード出来ない問題を修正
|
54
|
-
* 追加機能もしくは仕様変更
|
55
|
-
- 小説変換プリセットに n2525bs (魔剣ゾルディの女主人公とっかえひっかえ成長記録) 追加
|
56
|
-
- ダウンロードが完了した時に同時に凍結させるオプションを追加
|
57
|
-
+ `download` コマンドに `--freeze` (短縮名 -z) オプションが追加されました
|
58
|
-
* コマンド例: `narou download --freeze n4029bs`
|
59
|
-
* コマンド例: `narou d n4029bs -z`
|
60
|
-
- Mac上での動作改善コードの取り込み(https://github.com/yossoy/narou)
|
61
|
-
+ java の動作不良対応、Kindle 対応
|
50
|
+
2014/02/20 : **1.4.0**
|
51
|
+
* 重要な修正
|
52
|
+
- 小説家になろうのレイアウト変更によって更新処理ができなくなっていたものを修正しました
|
62
53
|
|
63
54
|
#{"*" * 79}
|
64
55
|
EOS
|
56
|
+
gem.post_install_message = install_message.gsub("\t", " ")
|
65
57
|
|
66
58
|
gem.required_ruby_version = ">=1.9.3"
|
67
59
|
|
@@ -12,21 +12,22 @@ confirm_over18: no
|
|
12
12
|
# 書籍情報取得設定
|
13
13
|
title: <title>(?<title>.+?)</title>
|
14
14
|
author: 作者:(?:<a href="http://mypage.syosetu.com/\d+/">)?(?<author>.+?)(?:</a>)?$
|
15
|
-
story: <div
|
15
|
+
story: <div id="novel_ex">(?<story>.+?)</div>
|
16
16
|
|
17
17
|
# ------------------------------------------------------------
|
18
18
|
# 目次取得設定
|
19
19
|
toc_url: \\k<top_url>/\\k<ncode>/
|
20
20
|
subtitles: |-
|
21
|
-
(?:<
|
22
|
-
|
23
|
-
)?<
|
24
|
-
<
|
21
|
+
(?:<div class="chapter_title">(?<chapter>.+?)</div>
|
22
|
+
|
23
|
+
)?<dl class="novel_sublist2" onclick="javascript:location.href='(?<href>/.+?/(?<index>\d+?)/)'">
|
24
|
+
<dd class="subtitle"><a href=".+?">(?<subtitle>.+?)</a></dd>
|
25
|
+
<dt class="long_update">
|
25
26
|
(?<subdate>.+?)(?:
|
26
27
|
<span title="(?<subupdate>.+?) 改稿">
|
27
28
|
(<u>改</u>)</span>)?
|
28
|
-
</
|
29
|
-
</
|
29
|
+
</dt>
|
30
|
+
</dl>
|
30
31
|
|
31
32
|
tcode: <li><a href="\\k<top_url>/txtdownload/top/ncode/(?<tcode>\d+?)/" onclick
|
32
33
|
txtdownload_url: \\k<top_url>/txtdownload/dlstart/ncode/\\k<tcode>/?no=\\k<index>
|
@@ -12,21 +12,22 @@ confirm_over18: yes
|
|
12
12
|
# 書籍情報取得設定
|
13
13
|
title: <title>(?<title>.+?)</title>
|
14
14
|
author: 作者:(?:<a href="http://xmypage.syosetu.com/.+?/">)?(?<author>.+?)(?:</a>)?$
|
15
|
-
story: <div
|
15
|
+
story: <div id="novel_ex">(?<story>.+?)</div>
|
16
16
|
|
17
17
|
# ------------------------------------------------------------
|
18
18
|
# 目次取得設定
|
19
19
|
toc_url: \\k<top_url>/\\k<ncode>/
|
20
20
|
subtitles: |-
|
21
|
-
(?:<
|
22
|
-
|
23
|
-
)?<
|
24
|
-
<
|
21
|
+
(?:<div class="chapter_title">(?<chapter>.+?)</div>
|
22
|
+
|
23
|
+
)?<dl class="novel_sublist2" onclick="javascript:location.href='(?<href>/.+?/(?<index>\d+?)/)'">
|
24
|
+
<dd class="subtitle"><a href=".+?">(?<subtitle>.+?)</a></dd>
|
25
|
+
<dt class="long_update">
|
25
26
|
(?<subdate>.+?)(?:
|
26
27
|
<span title="(?<subupdate>.+?) 改稿">
|
27
28
|
(<u>改</u>)</span>)?
|
28
|
-
</
|
29
|
-
</
|
29
|
+
</dt>
|
30
|
+
</dl>
|
30
31
|
|
31
32
|
tcode: <li><a href="\\k<top_url>/txtdownload/top/ncode/(?<tcode>\d+?)/" onclick
|
32
33
|
txtdownload_url: \\k<top_url>/txtdownload/dlstart/ncode/\\k<tcode>/?no=\\k<index>
|
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.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- whiteleaf7
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: termcolor
|
@@ -106,7 +106,6 @@ files:
|
|
106
106
|
- preset/ncode.syosetu.com/n9669bk/converter.rb
|
107
107
|
- preset/ncode.syosetu.com/n9669bk/setting.ini
|
108
108
|
- preset/vertical_font.css
|
109
|
-
- preset/xhtml_nav.vm
|
110
109
|
- template/converter.rb.erb
|
111
110
|
- template/diff.txt.erb
|
112
111
|
- template/novel.txt.erb
|
@@ -124,14 +123,22 @@ homepage: http://whiteleaf.hatenablog.com/
|
|
124
123
|
licenses:
|
125
124
|
- MIT
|
126
125
|
metadata: {}
|
127
|
-
post_install_message:
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
126
|
+
post_install_message: |
|
127
|
+
*******************************************************************************
|
128
|
+
|
129
|
+
narou コマンドのインストール or アップデートが完了しました。
|
130
|
+
詳しい説明は `narou help' コマンドをご覧下さい。
|
131
|
+
|
132
|
+
NOTICE
|
133
|
+
初めてこのアプリケーションを使う場合、小説管理用のフォルダを初期化する必要があります。
|
134
|
+
任意のフォルダで `narou init' を実行して下さい。
|
135
|
+
|
136
|
+
更新内容
|
137
|
+
2014/02/20 : **1.4.0**
|
138
|
+
* 重要な修正
|
139
|
+
- 小説家になろうのレイアウト変更によって更新処理ができなくなっていたものを修正しました
|
140
|
+
|
141
|
+
*******************************************************************************
|
135
142
|
rdoc_options: []
|
136
143
|
require_paths:
|
137
144
|
- lib
|
data/preset/xhtml_nav.vm
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE html>
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2011/epub" lang="ja" xml:lang="ja">
|
4
|
-
<head>
|
5
|
-
<title>${title}</title>
|
6
|
-
<style type="text/css">
|
7
|
-
.hidden { display: none; }
|
8
|
-
#if (${bookInfo.TocVertical})
|
9
|
-
@page {margin:.5em .5em 0 0;}
|
10
|
-
html {
|
11
|
-
writing-mode: vertical-rl;
|
12
|
-
-webkit-writing-mode: vertical-rl;
|
13
|
-
-epub-writing-mode: vertical-rl;
|
14
|
-
}
|
15
|
-
h1 {font-size:1.5em; padding-top:1em;}
|
16
|
-
li {list-style:disc; list-style-type: none; padding:0 .25em 0 0; line-height:1.75em;}
|
17
|
-
li a {text-decoration:none; border-right-width:1px; border-right-style:solid; padding-right: 1px;}
|
18
|
-
.tcy span {
|
19
|
-
width: 1em;
|
20
|
-
text-combine: horizontal;
|
21
|
-
-webkit-text-combine: horizontal;
|
22
|
-
-epub-text-combine: horizontal;
|
23
|
-
}
|
24
|
-
#else
|
25
|
-
@page {margin:.5em 0 0 .5em;}
|
26
|
-
html {
|
27
|
-
writing-mode:horizontal-tb;
|
28
|
-
-webkit-writing-mode:horizontal-tb;
|
29
|
-
-epub-writing-mode:horizontal-tb;
|
30
|
-
}
|
31
|
-
h1 {font-size:1.5em; text-align:center;}
|
32
|
-
li {padding:.25em 0 0 0; list-style:disc; list-style-type: none; line-height:1.75em;}
|
33
|
-
li a {text-decoration:none; border-bottom-width:1px; border-bottom-style:solid; padding-right: 1px;}
|
34
|
-
#end
|
35
|
-
</style>
|
36
|
-
</head>
|
37
|
-
|
38
|
-
<body>
|
39
|
-
## epub3 landmarks nav ==========================
|
40
|
-
<nav epub:type="landmarks" id="landmarks" hidden="" class="hidden">
|
41
|
-
<ol>
|
42
|
-
#if (${bookInfo.InsertCoverPage})
|
43
|
-
<li><a epub:type="cover" href="cover.xhtml">表紙</a></li>
|
44
|
-
#end
|
45
|
-
#if (${bookInfo.InsertTocPage})
|
46
|
-
<li><a epub:type="toc" href="nav.xhtml">目次</a></li>
|
47
|
-
#end
|
48
|
-
#foreach (${chapter} in ${chapters})
|
49
|
-
#if (${chapter.SectionId} == "title")
|
50
|
-
<li><a epub:type="title-page" href="title.xhtml">扉</a></li>
|
51
|
-
#else
|
52
|
-
<li><a epub:type="bodymatter" href="${chapter.SectionId}.xhtml">本文</a></li>
|
53
|
-
#break
|
54
|
-
#end
|
55
|
-
#end
|
56
|
-
</ol>
|
57
|
-
</nav>
|
58
|
-
## epub3 toc nav ================================
|
59
|
-
<nav epub:type="toc" id="toc">
|
60
|
-
<h1>目 次</h1>
|
61
|
-
<ol>
|
62
|
-
#if (${bookInfo.InsertCoverPage} && ${bookInfo.InsertCoverPageToc})
|
63
|
-
<li class="chapter" id="toccover"><a href="cover.xhtml">${cover_name}</a></li>
|
64
|
-
#end
|
65
|
-
#set ($idx=0)
|
66
|
-
#set ($nest_level=0)
|
67
|
-
#foreach(${chapter} in ${chapters})
|
68
|
-
#if ($chapter.ChapterName)
|
69
|
-
#set ($idx=$idx+1)
|
70
|
-
#if ($chapter.ChapterId)
|
71
|
-
#set ($chapter_anchor="#"+$chapter.ChapterId)
|
72
|
-
#else
|
73
|
-
#set ($chapter_anchor="")
|
74
|
-
#end
|
75
|
-
## enable nested toc ------------------------
|
76
|
-
#if (${navNest})
|
77
|
-
#if (${idx} > 1)
|
78
|
-
#if (${chapter.ChapterLevel} > ${nest_level})
|
79
|
-
<ol>
|
80
|
-
#elseif (${chapter.ChapterLevel} == ${nest_level})
|
81
|
-
</li>
|
82
|
-
#elseif (${chapter.ChapterLevel} < ${nest_level})
|
83
|
-
#set ($loop_count=$nest_level - $chapter.ChapterLevel - 1)
|
84
|
-
#foreach (${i} in [0..${loop_count}])
|
85
|
-
</li>
|
86
|
-
</ol>
|
87
|
-
#end
|
88
|
-
</li>
|
89
|
-
#end
|
90
|
-
#end
|
91
|
-
<li class="chapter" id="toc${idx}"><a href="${chapter.SectionId}.xhtml$!{chapter_anchor}">${chapter.ChapterName}</a>
|
92
|
-
#set ($nest_level=$chapter.ChapterLevel)
|
93
|
-
## disable nested toc -----------------------
|
94
|
-
#else
|
95
|
-
<li class="chapter" id="toc${idx}"><a href="${chapter.SectionId}.xhtml$!{chapter_anchor}">${chapter.ChapterName}</a></li>
|
96
|
-
#end
|
97
|
-
#end
|
98
|
-
#end
|
99
|
-
#if (${navNest})
|
100
|
-
#set ($tag_close_count=$nest_level - 1)
|
101
|
-
#foreach (${n} in [${tag_close_count}..0])
|
102
|
-
</li>
|
103
|
-
</ol>
|
104
|
-
#end
|
105
|
-
#else
|
106
|
-
</ol>
|
107
|
-
#end
|
108
|
-
</nav>
|
109
|
-
</body>
|
110
|
-
</html>
|