ebook_tools 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,7 +1,11 @@
1
+ 0.1.3 2013.5.27
2
+ fix bug: 提取目录结构时目标路径为完整路径
3
+
1
4
  0.1.2 2013.5.27
2
5
  fix bug: 对没有检测到目录结构的书进行错误标注
3
6
  new: 新增异步导入paras
4
7
 
8
+
5
9
  0.1.1 2013.5.26
6
10
  fix bug: 提取目录结构时文本内容开始部分存在全角空格而无法正确提取目录结构
7
11
  fix bug: 无法提取文本目录中包含“?”等标点符号的目录
data/ebook_tools.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ebook_tools}
5
- s.version = '0.1.2'
5
+ s.version = '0.1.3'
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Aaron"]
data/lib/ebook_tools.rb CHANGED
@@ -234,12 +234,15 @@ module EbookTools
234
234
  # :format 指定需要提取结构的文件后缀名,例如要从所有txt文件中提取,通过:format=>'.txt'指定
235
235
  def batch_extract_from_dir(source,destination,options={})
236
236
  format = options.delete(:format)
237
- files = Utils.scan_file_from_dir(source,{:format=>format})
237
+ source_path = File.absolute_path(source)
238
+ dest_path = File.absolute_path(destination)
239
+
240
+ files = Utils.scan_file_from_dir(source_path,{:format=>format})
238
241
 
239
242
  files.each do |file|
240
243
  extname = File.extname(file)
241
244
  basename = File.basename(file,extname)
242
- dest_file = File.join(File.dirname(File.join(destination,file.gsub(source,''))),"#{basename}.xml")
245
+ dest_file = File.join(File.dirname(File.join(dest_path,file.gsub(source,''))),"#{basename}.xml")
243
246
  if allow_extract_struct?(file)
244
247
  puts "start extract #{file} ..."
245
248
  begin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ebook_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: