kindlegen 2.5.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in kindlegen.gemspec
4
4
  gemspec
5
+
6
+ group :development, :test do
7
+ gem 'pry'
8
+ end
@@ -7,26 +7,22 @@ File::open('Makefile', 'w') do |w|
7
7
  tarball = case RbConfig::CONFIG['host_os']
8
8
  when /mac|darwin/i
9
9
  unzip = 'unzip'
10
- "KindleGen_Mac_i386_v2_5.zip"
10
+ "KindleGen_Mac_i386_v2_7.zip"
11
11
  when /linux|cygwin/i
12
12
  unzip = 'tar zxf'
13
- "kindlegen_linux_2.6_i386_v2_5.tar.gz"
13
+ "kindlegen_linux_2.6_i386_v2_7.tar.gz"
14
14
  else
15
15
  STDERR.puts "Host OS unsupported!"
16
16
  exit(1)
17
17
  end
18
18
 
19
- config = RbConfig::CONFIG.merge( {
19
+ config = RbConfig::CONFIG.merge({
20
20
  "unzip" => unzip,
21
21
  "tarball" => tarball
22
- } )
23
-
24
- bindir = '../../../../bin'
25
- if Dir::pwd.include?( 'gems' ) && FileTest.directory?( bindir )
26
- w.puts RbConfig.expand(DATA.read, config.merge('bindir' => bindir) )
27
- else
28
- w.puts RbConfig.expand(DATA.read, config)
29
- end
22
+ })
23
+
24
+ bindir = File.join(File.expand_path('../../..', __FILE__), "bin")
25
+ w.puts RbConfig.expand(DATA.read, config.merge('bindir' => bindir))
30
26
  end
31
27
 
32
28
 
@@ -38,6 +34,7 @@ TARBALL = $(tarball)
38
34
  CURL = curl
39
35
  UNZIP = $(unzip)
40
36
  CP = cp -a
37
+ MKDIR = mkdir -p
41
38
 
42
39
  all:
43
40
 
@@ -50,4 +47,5 @@ $(TARBALL):
50
47
  $(CURL) $(AMAZON)/$(TARBALL) -o $(TARBALL)
51
48
 
52
49
  install: $(TARGET)
50
+ $(MKDIR) $(BINDIR)
53
51
  $(CP) $(TARGET) $(BINDIR)
data/lib/kindlegen.rb CHANGED
@@ -3,17 +3,18 @@ require 'pathname'
3
3
  require 'systemu'
4
4
 
5
5
  module Kindlegen
6
+ Root = Pathname.new(File.expand_path('../..', __FILE__))
7
+ Bin = Root.join('bin')
8
+ Executables = Bin.children.inject({}) { |h, p|
9
+ h[p.basename.to_s.to_sym] = p.to_s
10
+ h
11
+ }
12
+
6
13
  #
7
14
  # Getting command path of kindlegen.
8
- # If it required under gem, returning path in the extension.
9
- # Not if, it return simply 'kindlegen' so you have to copy the command into $PATH.
10
15
  #
11
16
  def self.command
12
- if __FILE__.include? 'gems'
13
- (Pathname( __FILE__ ).parent + '../ext/kindlegen/kindlegen').to_s
14
- else
15
- 'kindlegen'
16
- end
17
+ Executables[:kindlegen]
17
18
  end
18
19
 
19
20
  #
@@ -1,3 +1,3 @@
1
1
  module Kindlegen
2
- VERSION = "2.5.0"
2
+ VERSION = "2.7.0"
3
3
  end
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: 2.5.0
4
+ version: 2.7.0
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: 2012-07-19 00:00:00.000000000 Z
12
+ date: 2012-11-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: systemu