KindleCG 0.0.1 → 0.0.2
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/README.md +12 -4
- data/lib/KindleCG/cli.rb +18 -3
- data/lib/KindleCG/version.rb +1 -1
- data/lib/KindleCG.rb +4 -0
- 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: 5dba61c07d74148ab1a3b0d9b004625423cf4831
|
4
|
+
data.tar.gz: a72e227abaff49aff4b0a11d0237ce753f9229c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c7c270658600bb6d58fd702640ef8b40d8ca7095ee4209a4bd94367b62f7cfe7535af39611c1d10c6075d95fe8e389e9ce8efb865eaaa724b7db1e3d3dcc7b3
|
7
|
+
data.tar.gz: ad693afa420cb751c2a2be31d9ea7de1ecf7fa7fa077e8cba3d2f18b2df26eadd70d479f807dc8143824ac438625de9e91120780e54244d76440ceed0b4dab8e
|
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
## Directory Tree to Kindle Collections generator
|
3
3
|
|
4
4
|
A command line ruby script that will generate collections in your kindle based on the directory structure of your ebooks.
|
5
|
-
The library to understand the mobi format are a straight port/refactor of the python plugin for calibre.
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
@@ -10,10 +9,19 @@ The library to understand the mobi format are a straight port/refactor of the py
|
|
10
9
|
|
11
10
|
## Usage
|
12
11
|
|
13
|
-
After installing the gem you will have access to
|
14
|
-
Just run it and will generate collections based on the directory structure of your ebooks in your kindle device.
|
12
|
+
After installing the gem you will have access to the command line tool **kindlecg**.
|
15
13
|
|
16
|
-
|
14
|
+
The kindlecg has just two commands available:
|
15
|
+
kindlecg check # check if a kindle is attached to the computer
|
16
|
+
kindlecg generate # generate and save the collections
|
17
|
+
|
18
|
+
Just run the kindlecg without any option to show the help.
|
19
|
+
|
20
|
+
By default, the commands assume that you are on a mac and the kindle mountpoint is /Volumes/Kindle but you can change that passing
|
21
|
+
the option *-m* followed by the mountpoint of the kindle on your computer.
|
22
|
+
|
23
|
+
The script override your kindle collections but can take a backup that you can manually restore if you pass the *-b* option.
|
24
|
+
The .bak file will be saved in your kindle device in the system folder.
|
17
25
|
|
18
26
|
## Contributing
|
19
27
|
|
data/lib/KindleCG/cli.rb
CHANGED
@@ -3,22 +3,37 @@ require 'KindleCG'
|
|
3
3
|
|
4
4
|
module KindleCG
|
5
5
|
class CLI < Thor
|
6
|
+
method_option :mountpoint, type: :string, aliases: "-m",
|
7
|
+
desc: "specify a different mountpoint for the kindle device"
|
8
|
+
method_option :backup, type: :boolean, aliases: "-b",
|
9
|
+
desc: "take a backup of the collections before overriding it"
|
6
10
|
desc 'generate', 'generate and save the collections'
|
7
11
|
def generate
|
12
|
+
if options[:mountpoint]
|
13
|
+
KindleCG.os_mountpoint = options[:mountpoint]
|
14
|
+
end
|
15
|
+
|
8
16
|
check
|
9
17
|
|
10
18
|
kindle = Generator.new
|
11
19
|
kindle.generate_collections
|
20
|
+
if options[:backup]
|
21
|
+
kindle.backup
|
22
|
+
end
|
12
23
|
kindle.save
|
13
24
|
end
|
14
25
|
|
26
|
+
method_option :mountpoint, type: :string, aliases: "-m",
|
27
|
+
desc: "specify a different mountpoint for the kindle device"
|
15
28
|
desc 'check', 'check if a kindle is attached to the computer'
|
16
29
|
def check
|
17
|
-
|
18
|
-
|
30
|
+
mountpoint = options[:mountpoint] || KindleCG.os_mountpoint
|
31
|
+
|
32
|
+
unless File.directory?(mountpoint)
|
33
|
+
raise Thor::Error, "Could not find any kindle attached to #{mountpoint}"
|
19
34
|
exit 1
|
20
35
|
else
|
21
|
-
say "Your kindle is attached to #{
|
36
|
+
say "Your kindle is attached to #{mountpoint}. Very good! :)", :green
|
22
37
|
end
|
23
38
|
end
|
24
39
|
end
|
data/lib/KindleCG/version.rb
CHANGED
data/lib/KindleCG.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: KindleCG
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Lorusso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|