Skip to content
Browse files

support kindlegen command 2.5.

    replace tarball 2.4 to 2.5
    add executable attribute to kindlegen command
    variable bindir
    fix error under installing on rbenv
  • Loading branch information...
1 parent a22e352 commit eefcd43c0db57d98d5b121df64fe7e972ec3078f @tdtds committed Jul 19, 2012
Showing with 10 additions and 8 deletions.
  1. +9 −7 ext/kindlegen/extconf.rb
  2. +1 −1 lib/kindlegen/version.rb
View
16 ext/kindlegen/extconf.rb
@@ -7,22 +7,23 @@
tarball = case RbConfig::CONFIG['host_os']
when /mac|darwin/i
unzip = 'unzip'
- "KindleGen_Mac_i386_v2_4.zip"
+ "KindleGen_Mac_i386_v2_5.zip"
when /linux|cygwin/i
unzip = 'tar zxf'
- "kindlegen_linux_2.6_i386_v2_4.tar.gz"
+ "kindlegen_linux_2.6_i386_v2_5.tar.gz"
else
STDERR.puts "Host OS unsupported!"
exit(1)
end
- config = {
+ config = RbConfig::CONFIG.merge( {
"unzip" => unzip,
"tarball" => tarball
- }
+ } )
- if Dir::pwd.include? 'gems'
- w.puts RbConfig.expand(DATA.read, config.merge('bindir' => '../../../../bin') )
+ bindir = '../../../../bin'
+ if Dir::pwd.include?( 'gems' ) && FileTest.directory?( bindir )
+ w.puts RbConfig.expand(DATA.read, config.merge('bindir' => bindir) )
else
w.puts RbConfig.expand(DATA.read, config)
end
@@ -36,13 +37,14 @@
TARBALL = $(tarball)
CURL = curl
UNZIP = $(unzip)
-CP = cp
+CP = cp -a
all:
$(TARGET): $(TARBALL)
$(UNZIP) $(TARBALL)
touch $(TARGET)
+ chmod +x $(TARGET)
$(TARBALL):
$(CURL) $(AMAZON)/$(TARBALL) -o $(TARBALL)
View
2 lib/kindlegen/version.rb
@@ -1,3 +1,3 @@
module Kindlegen
- VERSION = "2.4.1"
+ VERSION = "2.5.0"
end

0 comments on commit eefcd43

Please sign in to comment.
Something went wrong with that request. Please try again.