pdf2nook 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +18 -0
- data/Gemfile.lock +57 -0
- data/LICENSE.txt +20 -0
- data/README.md +125 -0
- data/Rakefile +56 -0
- data/VERSION +1 -0
- data/bin/pdf2nook +143 -0
- data/lib/pdf2nook.rb +0 -0
- data/pdf2nook.gemspec +88 -0
- data/test/helper.rb +18 -0
- data/test/test_pdf2nook.rb +7 -0
- metadata +274 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem 'clamp'
|
4
|
+
gem 'rmagick'
|
5
|
+
gem 'ruby-progressbar'
|
6
|
+
gem 'colored'
|
7
|
+
gem 'rake'
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
gem "shoulda", ">= 0"
|
11
|
+
gem "rdoc", "~> 3.12"
|
12
|
+
gem "bundler"
|
13
|
+
gem "awesome_print"
|
14
|
+
gem "jeweler", "~> 1.8.4"
|
15
|
+
gem "simplecov", ">= 0"
|
16
|
+
gem 'simplecov', :platforms => :mri_19
|
17
|
+
gem 'rcov'
|
18
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (3.2.9)
|
5
|
+
i18n (~> 0.6)
|
6
|
+
multi_json (~> 1.0)
|
7
|
+
awesome_print (1.1.0)
|
8
|
+
bourne (1.1.2)
|
9
|
+
mocha (= 0.10.5)
|
10
|
+
clamp (0.5.0)
|
11
|
+
colored (1.2)
|
12
|
+
git (1.2.5)
|
13
|
+
i18n (0.6.1)
|
14
|
+
jeweler (1.8.4)
|
15
|
+
bundler (~> 1.0)
|
16
|
+
git (>= 1.2.5)
|
17
|
+
rake
|
18
|
+
rdoc
|
19
|
+
json (1.7.5)
|
20
|
+
metaclass (0.0.1)
|
21
|
+
mocha (0.10.5)
|
22
|
+
metaclass (~> 0.0.1)
|
23
|
+
multi_json (1.5.0)
|
24
|
+
rake (10.0.3)
|
25
|
+
rcov (0.9.11)
|
26
|
+
rdoc (3.12)
|
27
|
+
json (~> 1.4)
|
28
|
+
rmagick (2.13.1)
|
29
|
+
ruby-progressbar (1.0.2)
|
30
|
+
shoulda (3.3.2)
|
31
|
+
shoulda-context (~> 1.0.1)
|
32
|
+
shoulda-matchers (~> 1.4.1)
|
33
|
+
shoulda-context (1.0.1)
|
34
|
+
shoulda-matchers (1.4.2)
|
35
|
+
activesupport (>= 3.0.0)
|
36
|
+
bourne (~> 1.1.2)
|
37
|
+
simplecov (0.7.1)
|
38
|
+
multi_json (~> 1.0)
|
39
|
+
simplecov-html (~> 0.7.1)
|
40
|
+
simplecov-html (0.7.1)
|
41
|
+
|
42
|
+
PLATFORMS
|
43
|
+
ruby
|
44
|
+
|
45
|
+
DEPENDENCIES
|
46
|
+
awesome_print
|
47
|
+
bundler
|
48
|
+
clamp
|
49
|
+
colored
|
50
|
+
jeweler (~> 1.8.4)
|
51
|
+
rake
|
52
|
+
rcov
|
53
|
+
rdoc (~> 3.12)
|
54
|
+
rmagick
|
55
|
+
ruby-progressbar
|
56
|
+
shoulda
|
57
|
+
simplecov
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 Smile @rT
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
PDF2Nook
|
2
|
+
=========
|
3
|
+
|
4
|
+
PDF2Nook is a Ruby-based CLI tool designed to convert regular PDF files and make them more readable on Barnes & Nobel Simple Touch Nook reader and maybe some other small 6-inch e-ink readers…
|
5
|
+
|
6
|
+
What PDF2Nook actually does
|
7
|
+
-----------
|
8
|
+
|
9
|
+
- reads PDF book from the original file
|
10
|
+
- splits every single page into the top and bottom parts
|
11
|
+
- rotates pages to landscape format (90 or 270 degrees to match page turn buttons)
|
12
|
+
- trims pages' empty margins to increase small fonts readability
|
13
|
+
- converts pages to grayscale colorspace
|
14
|
+
- increases pages' contrast to make text more readable
|
15
|
+
- resizes pages to fit reader screen density (actually 167 DPI for Nook)
|
16
|
+
- exports all pre-rendered pages to a new PDF file ready to read on Nook
|
17
|
+
|
18
|
+
What it looks like
|
19
|
+
-----------
|
20
|
+
|
21
|
+
Not readable PDF page in portrait mode:
|
22
|
+
|
23
|
+
![Not readable PDF page in portrait mode…](http://i.imgur.com/3TG53.png "Not readable PDF page in portrait mode…")
|
24
|
+
|
25
|
+
Converted to two more readable pages in landscape mode with preservation of key bindings:
|
26
|
+
|
27
|
+
![More readable PDF page in landscape mode…](http://i.imgur.com/XuBxf.png "More readable PDF page in landscape mode…")
|
28
|
+
|
29
|
+
![More readable PDF page in landscape mode…](http://i.imgur.com/iI3Ry.png "More readable PDF page in landscape mode…")
|
30
|
+
|
31
|
+
|
32
|
+
Dependencies
|
33
|
+
-----------
|
34
|
+
|
35
|
+
Under the hood PDF2Nook uses a bunch of tools and libraries to work with PDF and to make all this kind of magic, so it has some dependencies:
|
36
|
+
|
37
|
+
- [**RMagick**](http://rmagick.rubyforge.org/) — Ruby ImageMagick® and GraphicsMagick binding, the heart of tool
|
38
|
+
- [**Clamp**](https://github.com/mdub/clamp) — easy to use and quite flexible Ruby CLI framework for command-line interface
|
39
|
+
- [**Ruby-progressbar**](https://github.com/jfelchner/ruby-progressbar) — a customizable text progress bar Ruby library to indicate rendering
|
40
|
+
- [**Rainbow**](https://github.com/sickill/rainbow) — a little but pretty useful Ruby tool-library for pretty printed CLI output
|
41
|
+
|
42
|
+
Installation
|
43
|
+
-----------
|
44
|
+
|
45
|
+
To install PDF2Nook just run:
|
46
|
+
`[sudo] gem install pdf2nook`
|
47
|
+
|
48
|
+
In addition, if you had any problems with building native extension for RMagick, try installing the following stuff (tested on Ubuntu 12.04) and reattempt PDF2Nook installation after that:
|
49
|
+
|
50
|
+
sudo apt-get install ruby1.9.3
|
51
|
+
sudo apt-get install librmagick-ruby libmagickcore-dev libmagickwand-dev
|
52
|
+
sudo gem install rmagick
|
53
|
+
|
54
|
+
or following on OS X:
|
55
|
+
|
56
|
+
brew install imagemagick
|
57
|
+
|
58
|
+
Usage
|
59
|
+
-----------
|
60
|
+
|
61
|
+
pdf2nook.rb [OPTIONS] PATH
|
62
|
+
|
63
|
+
Parameters:
|
64
|
+
PATH PDF file path to convert it
|
65
|
+
|
66
|
+
Options:
|
67
|
+
-c, --colors COLORS output grayscale colors count (default: 16)
|
68
|
+
--rotate set this flag if you set up your bottom buttons to flip pages forward
|
69
|
+
--cleanup set this flag if you want to clear tmp files after converting
|
70
|
+
-h, --help print help
|
71
|
+
|
72
|
+
Examples
|
73
|
+
-----------
|
74
|
+
|
75
|
+
+ The easiest way to convert a book is to execute this command:
|
76
|
+
`$ pdf2nook ./book_name.pdf` — it will process your file with default settings and put the result right in the same folder as your original file, named as `nook_book_name.pdf`
|
77
|
+
|
78
|
+
+ To cleanup temporary files after converting, just add `--cleanup` flag:
|
79
|
+
`$ pdf2nook --cleanup ./book_name.pdf`
|
80
|
+
|
81
|
+
+ If you prefer to set your Nook to flip pages forward with the bottom hardware button and back with the top button, set the `--rotate` flag to rotate landscape pages to the proper side:
|
82
|
+
`$ pdf2nook --cleanup --rotate ./book_name.pdf`
|
83
|
+
|
84
|
+
+ To change default colors count of the output pages, use `--colors` option like this:
|
85
|
+
`$ pdf2nook --cleanup -c 256 ./book_name.pdf`
|
86
|
+
|
87
|
+
|
88
|
+
Known issues
|
89
|
+
-----------
|
90
|
+
Here I want to note the known problems. Some of them I will try to fix in the future, but some of them do not seem so problematic, to complicate the code because of them and invent bicycles…
|
91
|
+
|
92
|
+
* **Clipped lines** (see screenshots above) — the algorithm of bisection is quite simple and stupid. It just cuts the page right in the middle no matter whether there is some content or not. If the mean happens to go through a text line or an image, it will split that content. It seems a big deal, but I know that human brain can recognize text even split in halves, so just use your brain and leave the machine alone, you'll see, it's not really hard to do.
|
93
|
+
|
94
|
+
* **Different scales of trimmed pages** (see screenshots above) — pages could be trimmed in using different scales because of padding of footer or header or side column typographic elements, such as page numbers, information blocks and text boxes located outside of the main paragraphs layout. But at the same time blank edges trimming is an important part of improving readability of the text.
|
95
|
+
|
96
|
+
* **High CPU and memory usage** — your machine can become quite slowly while the tool is processing your file. Be patient and if you can, just let it do its thing, to get quickest result with no annoyance.
|
97
|
+
|
98
|
+
* **There is no magic** — if your PDF book is get up using a terribly microscopic font size or scanned with low quality, PDF2Nook will not be able to make it better, I'm sorry.
|
99
|
+
|
100
|
+
Help and contribution
|
101
|
+
-----------
|
102
|
+
As you can see, English and even Ruby are not my native languages :) So I understand that here I might have a ton of mistakes and stylistic problems. I will be very grateful to get any assistance with typo and grammar correction in README. And it will make it even happier if I get your help with improvement of code quality for the output pdfs. So feel free to make Pull requests and/or bug report issues.
|
103
|
+
|
104
|
+
Contributing to pdf2nook
|
105
|
+
-----------
|
106
|
+
|
107
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
108
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
109
|
+
* Fork the project.
|
110
|
+
* Start a feature/bugfix branch.
|
111
|
+
* Commit and push until you are happy with your contribution.
|
112
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
113
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
114
|
+
|
115
|
+
|
116
|
+
Special thanks
|
117
|
+
-----------
|
118
|
+
|
119
|
+
* Vera Surkova (https://github.com/surkova) for the spelling and translation.
|
120
|
+
|
121
|
+
|
122
|
+
Copyright
|
123
|
+
-----------
|
124
|
+
|
125
|
+
Copyright (c) 2012 Smile @rT. See LICENSE.txt for further details.
|
data/Rakefile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "pdf2nook"
|
18
|
+
gem.homepage = "https://github.com/smileart/pdf2nook"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.description = %q{Tool to convert PDF files, to make them more readable
|
21
|
+
on Barnes & Nobel Simple Touch Nook reader and maybe
|
22
|
+
some other small e-ink readers with 6" screen…}
|
23
|
+
gem.summary = %q{pdf2nook is a tool to convert PDF files, to make them more readable}
|
24
|
+
gem.email = ["smileart21@gmail.com"]
|
25
|
+
gem.authors = ["Smile @rT"]
|
26
|
+
|
27
|
+
# dependencies defined in Gemfile
|
28
|
+
end
|
29
|
+
Jeweler::RubygemsDotOrgTasks.new
|
30
|
+
|
31
|
+
require 'rake/testtask'
|
32
|
+
Rake::TestTask.new(:test) do |test|
|
33
|
+
test.libs << 'lib' << 'test'
|
34
|
+
test.pattern = 'test/**/test_*.rb'
|
35
|
+
test.verbose = true
|
36
|
+
end
|
37
|
+
|
38
|
+
require 'rcov/rcovtask'
|
39
|
+
Rcov::RcovTask.new do |test|
|
40
|
+
test.libs << 'test'
|
41
|
+
test.pattern = 'test/**/test_*.rb'
|
42
|
+
test.verbose = true
|
43
|
+
test.rcov_opts << '--exclude "gems/*"'
|
44
|
+
end
|
45
|
+
|
46
|
+
task :default => :test
|
47
|
+
|
48
|
+
require 'rdoc/task'
|
49
|
+
Rake::RDocTask.new do |rdoc|
|
50
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
51
|
+
|
52
|
+
rdoc.rdoc_dir = 'rdoc'
|
53
|
+
rdoc.title = "pdf2nook #{version}"
|
54
|
+
rdoc.rdoc_files.include('README*')
|
55
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
56
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/bin/pdf2nook
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
#! encoding: UTF-8
|
3
|
+
|
4
|
+
require 'clamp'
|
5
|
+
require 'RMagick'
|
6
|
+
require 'ruby-progressbar'
|
7
|
+
require 'colored'
|
8
|
+
require 'fileutils'
|
9
|
+
|
10
|
+
class Pdf2NookCommand < Clamp::Command
|
11
|
+
|
12
|
+
self.description = %{
|
13
|
+
==========================================================
|
14
|
+
Tool to convert PDF files, to make them more readable
|
15
|
+
on Barnes & Nobel Simple Touch Nook reader and maybe
|
16
|
+
some other small e-ink readers with 6" screen…
|
17
|
+
==========================================================
|
18
|
+
}
|
19
|
+
|
20
|
+
parameter "PATH", "PDF file path to convert it"
|
21
|
+
|
22
|
+
option ["-c", "--colors"], "COLORS", "output grayscale colors count", :attribute_name => :colors_count, :default => 16 do |c|
|
23
|
+
Integer(c)
|
24
|
+
end
|
25
|
+
|
26
|
+
option "--rotate", :flag, "set this flag if you set up your bottom buttons to flip pages forward"
|
27
|
+
option "--cleanup", :flag, "set this flag if you want to clear tmp files after converting"
|
28
|
+
|
29
|
+
def clear_tmp
|
30
|
+
if Dir.exists?('/tmp/pdf2nook/')
|
31
|
+
if Dir.entries('/tmp/pdf2nook/').length > 2
|
32
|
+
FileUtils.rm Dir.glob('/tmp/pdf2nook/*.png')
|
33
|
+
FileUtils.rm Dir.glob('/tmp/pdf2nook/*.pdf')
|
34
|
+
end
|
35
|
+
else
|
36
|
+
Dir.mkdir('/tmp/pdf2nook/');
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
def render_page(img, part)
|
42
|
+
part = (part == :top) ? Magick::NorthWestGravity : Magick::SouthEastGravity
|
43
|
+
|
44
|
+
img.resize_to_fill(img.columns, img.rows / 2, part)
|
45
|
+
.rotate(@degree)
|
46
|
+
.trim!(true)
|
47
|
+
.resize_to_fit(600,750)
|
48
|
+
.quantize(Integer(colors_count), Magick::GRAYColorspace)
|
49
|
+
.contrast(true)
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
def execute
|
54
|
+
|
55
|
+
clear_tmp
|
56
|
+
|
57
|
+
@degree = (rotate?) ? 90 : 270
|
58
|
+
filename = File.basename(path)
|
59
|
+
|
60
|
+
puts "Loading document…".yellow
|
61
|
+
|
62
|
+
pdf = Magick::ImageList.new
|
63
|
+
pdf.ping(path)
|
64
|
+
|
65
|
+
pages_count = pdf.scene
|
66
|
+
odd_pages_count = pages_count % 10
|
67
|
+
|
68
|
+
puts "#{pages_count+1} pages readed!".yellow
|
69
|
+
|
70
|
+
decade = 0
|
71
|
+
|
72
|
+
progress = ProgressBar.create(
|
73
|
+
:title => "Rendering…",
|
74
|
+
:format => '%t |%b>%i| %p%% done',
|
75
|
+
:starting_at => 0,
|
76
|
+
:total => (pages_count / 10) + 1,
|
77
|
+
:length => 60
|
78
|
+
)
|
79
|
+
|
80
|
+
(0..pages_count).step(10){|from|
|
81
|
+
|
82
|
+
new_pdf = Magick::ImageList.new()
|
83
|
+
decade += 1
|
84
|
+
|
85
|
+
progress.increment
|
86
|
+
|
87
|
+
if(from == pages_count - odd_pages_count)
|
88
|
+
to = from + odd_pages_count
|
89
|
+
else
|
90
|
+
to = from + 10
|
91
|
+
end
|
92
|
+
|
93
|
+
pdf = Magick::ImageList.new("#{path}[#{from}-#{to}]") do
|
94
|
+
self.density = "167.0x167.0"
|
95
|
+
self.background_color = "white"
|
96
|
+
end
|
97
|
+
|
98
|
+
pdf.each_with_index{|img, i|
|
99
|
+
img.opacity = 0
|
100
|
+
img.background_color = "white"
|
101
|
+
|
102
|
+
new_pdf << render_page(img, :top)
|
103
|
+
new_pdf << render_page(img, :bottom)
|
104
|
+
}
|
105
|
+
|
106
|
+
# replace spaces to avoid xargs problems
|
107
|
+
@tmp_filename = filename.gsub(/\s/,'_')
|
108
|
+
|
109
|
+
new_pdf.write("/tmp/pdf2nook/#{@tmp_filename}#{decade}.png") do
|
110
|
+
self.quality = 100
|
111
|
+
self.density = "167.0x167.0"
|
112
|
+
self.compression = Magick::NoCompression
|
113
|
+
self.colorspace = Magick::GRAYColorspace
|
114
|
+
self.gravity = Magick::NorthWestGravity
|
115
|
+
end
|
116
|
+
|
117
|
+
new_pdf = nil
|
118
|
+
pdf = nil
|
119
|
+
|
120
|
+
GC.start
|
121
|
+
}
|
122
|
+
|
123
|
+
puts 'Compiling final document…'.yellow
|
124
|
+
|
125
|
+
render = Thread.new do
|
126
|
+
if(`convert --version`.include? 'OpenMP')
|
127
|
+
system("find /tmp/pdf2nook/ -name '*.png' | sort -V | xargs convert -limit thread 16 -limit memory 2GB -write '/tmp/pdf2nook/#{filename}'")
|
128
|
+
else
|
129
|
+
system("find /tmp/pdf2nook/ -name '*.png' | sort -V | xargs convert -limit memory 2GB -write '/tmp/pdf2nook/#{filename}'")
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
render.join
|
134
|
+
|
135
|
+
FileUtils.copy_file("/tmp/pdf2nook/#{filename}", "#{File.dirname(path)}/nook_#{filename}")
|
136
|
+
|
137
|
+
clear_tmp if cleanup?
|
138
|
+
|
139
|
+
puts "Done! Your book located in #{File.dirname(path)}/nook_#{filename}".green
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
Pdf2NookCommand.run
|
data/lib/pdf2nook.rb
ADDED
File without changes
|
data/pdf2nook.gemspec
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "pdf2nook"
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Smile @rT"]
|
12
|
+
s.date = "2012-12-18"
|
13
|
+
s.description = "Tool to convert PDF files, to make them more readable\n on Barnes & Nobel Simple Touch Nook reader and maybe\n some other small e-ink readers with 6\" screen\u{2026}"
|
14
|
+
s.email = ["smileart21@gmail.com"]
|
15
|
+
s.executables = ["pdf2nook"]
|
16
|
+
s.extra_rdoc_files = [
|
17
|
+
"LICENSE.txt",
|
18
|
+
"README.md"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".document",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.md",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"bin/pdf2nook",
|
29
|
+
"lib/pdf2nook.rb",
|
30
|
+
"pdf2nook.gemspec",
|
31
|
+
"test/helper.rb",
|
32
|
+
"test/test_pdf2nook.rb"
|
33
|
+
]
|
34
|
+
s.homepage = "https://github.com/smileart/pdf2nook"
|
35
|
+
s.licenses = ["MIT"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = "1.8.24"
|
38
|
+
s.summary = "pdf2nook is a tool to convert PDF files, to make them more readable"
|
39
|
+
|
40
|
+
if s.respond_to? :specification_version then
|
41
|
+
s.specification_version = 3
|
42
|
+
|
43
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
44
|
+
s.add_runtime_dependency(%q<clamp>, [">= 0"])
|
45
|
+
s.add_runtime_dependency(%q<rmagick>, [">= 0"])
|
46
|
+
s.add_runtime_dependency(%q<ruby-progressbar>, [">= 0"])
|
47
|
+
s.add_runtime_dependency(%q<colored>, [">= 0"])
|
48
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
49
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
51
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
52
|
+
s.add_development_dependency(%q<awesome_print>, [">= 0"])
|
53
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
54
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
55
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
56
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
57
|
+
else
|
58
|
+
s.add_dependency(%q<clamp>, [">= 0"])
|
59
|
+
s.add_dependency(%q<rmagick>, [">= 0"])
|
60
|
+
s.add_dependency(%q<ruby-progressbar>, [">= 0"])
|
61
|
+
s.add_dependency(%q<colored>, [">= 0"])
|
62
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
63
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
64
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
65
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
66
|
+
s.add_dependency(%q<awesome_print>, [">= 0"])
|
67
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
68
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
69
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
70
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
71
|
+
end
|
72
|
+
else
|
73
|
+
s.add_dependency(%q<clamp>, [">= 0"])
|
74
|
+
s.add_dependency(%q<rmagick>, [">= 0"])
|
75
|
+
s.add_dependency(%q<ruby-progressbar>, [">= 0"])
|
76
|
+
s.add_dependency(%q<colored>, [">= 0"])
|
77
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
78
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
79
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
80
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
81
|
+
s.add_dependency(%q<awesome_print>, [">= 0"])
|
82
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
83
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
84
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
85
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'pdf2nook'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,274 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pdf2nook
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Smile @rT
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: clamp
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rmagick
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: ruby-progressbar
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: colored
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rake
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: shoulda
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: rdoc
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.12'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '3.12'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: bundler
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: awesome_print
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: jeweler
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ~>
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 1.8.4
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ~>
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 1.8.4
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: simplecov
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
178
|
+
requirements:
|
179
|
+
- - ! '>='
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
type: :development
|
183
|
+
prerelease: false
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ! '>='
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0'
|
190
|
+
- !ruby/object:Gem::Dependency
|
191
|
+
name: simplecov
|
192
|
+
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
194
|
+
requirements:
|
195
|
+
- - ! '>='
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '0'
|
198
|
+
type: :development
|
199
|
+
prerelease: false
|
200
|
+
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
202
|
+
requirements:
|
203
|
+
- - ! '>='
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '0'
|
206
|
+
- !ruby/object:Gem::Dependency
|
207
|
+
name: rcov
|
208
|
+
requirement: !ruby/object:Gem::Requirement
|
209
|
+
none: false
|
210
|
+
requirements:
|
211
|
+
- - ! '>='
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '0'
|
214
|
+
type: :development
|
215
|
+
prerelease: false
|
216
|
+
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
none: false
|
218
|
+
requirements:
|
219
|
+
- - ! '>='
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
222
|
+
description: ! "Tool to convert PDF files, to make them more readable\n on
|
223
|
+
Barnes & Nobel Simple Touch Nook reader and maybe\n some other
|
224
|
+
small e-ink readers with 6\" screen…"
|
225
|
+
email:
|
226
|
+
- smileart21@gmail.com
|
227
|
+
executables:
|
228
|
+
- pdf2nook
|
229
|
+
extensions: []
|
230
|
+
extra_rdoc_files:
|
231
|
+
- LICENSE.txt
|
232
|
+
- README.md
|
233
|
+
files:
|
234
|
+
- .document
|
235
|
+
- Gemfile
|
236
|
+
- Gemfile.lock
|
237
|
+
- LICENSE.txt
|
238
|
+
- README.md
|
239
|
+
- Rakefile
|
240
|
+
- VERSION
|
241
|
+
- bin/pdf2nook
|
242
|
+
- lib/pdf2nook.rb
|
243
|
+
- pdf2nook.gemspec
|
244
|
+
- test/helper.rb
|
245
|
+
- test/test_pdf2nook.rb
|
246
|
+
homepage: https://github.com/smileart/pdf2nook
|
247
|
+
licenses:
|
248
|
+
- MIT
|
249
|
+
post_install_message:
|
250
|
+
rdoc_options: []
|
251
|
+
require_paths:
|
252
|
+
- lib
|
253
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
254
|
+
none: false
|
255
|
+
requirements:
|
256
|
+
- - ! '>='
|
257
|
+
- !ruby/object:Gem::Version
|
258
|
+
version: '0'
|
259
|
+
segments:
|
260
|
+
- 0
|
261
|
+
hash: -3621324955383807154
|
262
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
263
|
+
none: false
|
264
|
+
requirements:
|
265
|
+
- - ! '>='
|
266
|
+
- !ruby/object:Gem::Version
|
267
|
+
version: '0'
|
268
|
+
requirements: []
|
269
|
+
rubyforge_project:
|
270
|
+
rubygems_version: 1.8.24
|
271
|
+
signing_key:
|
272
|
+
specification_version: 3
|
273
|
+
summary: pdf2nook is a tool to convert PDF files, to make them more readable
|
274
|
+
test_files: []
|