narou 1.4.2.rc1 → 1.4.2.rc2
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 +4 -4
- data/lib/command/convert.rb +10 -0
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 106a0cab3c8db068920d8345df963ba43b088771
|
|
4
|
+
data.tar.gz: e379a8e63f7df81e51b08d565131ea60300560c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4678086165e0a898a5b0ab82da4d84c8981a52ce4e6ed990b7dca6d5dae7b5e7e01b12ac92ee8b3d06a45908b717c873e7f9482daa031117c32d852f88090ded
|
|
7
|
+
data.tar.gz: 568f57a6281ee6bfe8dad434a578af8616d3c63cf4683aece71408a2e3e38602be9792417867da72bd20be12699faa2447561ce012a66cd7cacc6698daeed4b4
|
data/lib/command/convert.rb
CHANGED
|
@@ -248,6 +248,7 @@ module Command
|
|
|
248
248
|
require "zip"
|
|
249
249
|
Zip.unicode_names = true
|
|
250
250
|
dirpath = File.dirname(@converted_txt_path)
|
|
251
|
+
translate_illust_chuki_to_img_tag
|
|
251
252
|
zipfile_path = @converted_txt_path.sub(/.txt$/, @device.ebook_file_ext)
|
|
252
253
|
File.delete(zipfile_path) if File.exists?(zipfile_path)
|
|
253
254
|
Zip::File.open(zipfile_path, Zip::File::CREATE) do |zip|
|
|
@@ -287,6 +288,15 @@ module Command
|
|
|
287
288
|
LocalSetting.get.save_settings("local_setting") if modified
|
|
288
289
|
end
|
|
289
290
|
|
|
291
|
+
#
|
|
292
|
+
# i文庫用に挿絵注記をimgタグに変換する
|
|
293
|
+
#
|
|
294
|
+
def translate_illust_chuki_to_img_tag
|
|
295
|
+
data = File.read(@converted_txt_path, encoding: Encoding::UTF_8)
|
|
296
|
+
data.gsub!(/[#挿絵((.+?))入る]/, "<img src=\"\\1\">")
|
|
297
|
+
File.write(@converted_txt_path, data)
|
|
298
|
+
end
|
|
299
|
+
|
|
290
300
|
#
|
|
291
301
|
# convert.copy_to で指定されたディレクトリに書籍データをコピーする
|
|
292
302
|
#
|
data/lib/version.rb
CHANGED
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.2.
|
|
4
|
+
version: 1.4.2.rc2
|
|
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-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: termcolor
|