kindlegen 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +23 -0
- data/ext/kindlegen/extconf.rb +15 -7
- data/lib/kindlegen/version.rb +1 -1
- metadata +3 -2
data/README.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Kindlegen
|
2
|
+
|
3
|
+
Easy to install kindlegen command via gem!
|
4
|
+
|
5
|
+
When you will run this gem, it will download tarball of kindlegen from amazon.com and extract it. Then you can find command file in "$GEMPATH/bin".
|
6
|
+
|
7
|
+
## Using from Ruby
|
8
|
+
|
9
|
+
Require kindlegen module, you can run kindlegen command without you know its path.
|
10
|
+
|
11
|
+
### Kindlegen.command
|
12
|
+
|
13
|
+
returning path of kindlegen command.
|
14
|
+
|
15
|
+
### Kindlegen.run( *args )
|
16
|
+
|
17
|
+
runing kindlegen command with specified parameters.
|
18
|
+
|
19
|
+
### Example
|
20
|
+
require 'kindlegen'
|
21
|
+
Kindlegen.run( "sample.opf", "-o sample.mobi" )
|
22
|
+
|
23
|
+
|
data/ext/kindlegen/extconf.rb
CHANGED
@@ -4,21 +4,30 @@
|
|
4
4
|
|
5
5
|
require 'rbconfig'
|
6
6
|
|
7
|
-
File::open(
|
7
|
+
File::open('Makefile', 'w') do |w|
|
8
|
+
tarball = case RbConfig::CONFIG['host_os']
|
9
|
+
when /mac|darwin/i then "KindleGen_Mac_i386_v1.2.zip"
|
10
|
+
when /linux|cygwin/i then "kindlegen_linux_2.6_i386_v1.2.tar.gz"
|
11
|
+
else
|
12
|
+
STDERR.puts "Host OS unsupported!"
|
13
|
+
exit(1)
|
14
|
+
end
|
15
|
+
|
16
|
+
config = {"tarball" => tarball}
|
17
|
+
|
8
18
|
if Dir::pwd.include? 'gems'
|
9
|
-
w.puts RbConfig.expand(
|
19
|
+
w.puts RbConfig.expand(DATA.read, config.merge('bindir' => '../../../../bin') )
|
10
20
|
else
|
11
|
-
w.puts RbConfig.expand(
|
21
|
+
w.puts RbConfig.expand(DATA.read, config)
|
12
22
|
end
|
13
23
|
end
|
14
24
|
|
25
|
+
|
15
26
|
__END__
|
16
27
|
AMAZON = http://s3.amazonaws.com/kindlegen
|
17
28
|
TARGET = kindlegen
|
18
29
|
BINDIR = $(bindir)
|
19
|
-
|
20
|
-
VERSION = 1.2
|
21
|
-
TARBALL = $(TARGET)_$(PLATFORM)_v$(VERSION).tar.gz
|
30
|
+
TARBALL = $(tarball)
|
22
31
|
CURL = curl
|
23
32
|
TARX = tar zxf
|
24
33
|
CP = cp
|
@@ -34,4 +43,3 @@ $(TARBALL):
|
|
34
43
|
|
35
44
|
install: $(TARGET)
|
36
45
|
$(CP) $(TARGET) $(BINDIR)
|
37
|
-
|
data/lib/kindlegen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kindlegen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-22 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Installing kindlegen command, downloading tar.gz file from amazon.com,
|
15
15
|
and extracting it and copy kindlegen command to bin.
|
@@ -22,6 +22,7 @@ extra_rdoc_files: []
|
|
22
22
|
files:
|
23
23
|
- .gitignore
|
24
24
|
- Gemfile
|
25
|
+
- README.md
|
25
26
|
- Rakefile
|
26
27
|
- ext/kindlegen/extconf.rb
|
27
28
|
- kindlegen.gemspec
|