Permalink
Browse files

Merge pull request #1 from mdp/master

Fix path, add gem dependency to Gemfile, update executable
  • Loading branch information...
2 parents df17c91 + d5aece2 commit 7764e18c80258f971078bc32cf14a7aed6b38673 @seizmo committed Nov 26, 2011
Showing with 20 additions and 11 deletions.
  1. +4 −0 .gitignore
  2. +2 −1 Gemfile
  3. +4 −0 Gemfile.lock
  4. +2 −0 bin/kte.rb
  5. +0 −2 bin/kte.sh
  6. +2 −2 config.yml.template
  7. +6 −6 lib/kte.rb
View
@@ -0,0 +1,4 @@
+config.yml
+bin/kindlegen
+tmp
+issues
View
@@ -4,5 +4,6 @@ gem 'mechanize'
gem 'rubyzip'
gem 'progressbar'
gem 'pony'
+gem 'psych'
gem 'subexec', :git => "git://github.com/nulayer/subexec.git"
-gem 'mini_magick', :git => "git://github.com/probablycorey/mini_magick.git"
+gem 'mini_magick', :git => "git://github.com/probablycorey/mini_magick.git"
View
@@ -27,11 +27,13 @@ GEM
mime-types (1.17.2)
net-http-digest_auth (1.1.1)
net-http-persistent (1.9)
+ nokogiri (1.5.0)
nokogiri (1.5.0-x86-mingw32)
polyglot (0.3.3)
pony (1.3)
mail (> 2.0)
progressbar (0.9.1)
+ psych (1.2.2)
rubyzip (0.9.4)
treetop (1.4.10)
polyglot
@@ -40,12 +42,14 @@ GEM
nokogiri (>= 1.4.4)
PLATFORMS
+ ruby
x86-mingw32
DEPENDENCIES
mechanize
mini_magick!
pony
progressbar
+ psych
rubyzip
subexec!
View
@@ -0,0 +1,2 @@
+#!/usr/bin/env ruby
+require './lib/kte.rb'
View
@@ -1,2 +0,0 @@
-#!/bin/sh
-ruby ../lib/kte.rb
View
@@ -8,8 +8,8 @@ credentials:
# Where to save the temporary files and the
# resulting epub and mobi files
directories:
- tmp: "../tmp"
- issues: "../issues"
+ tmp: "./tmp"
+ issues: "./issues"
# Optional: If you have the deliver_to section, the
# epub or mobi file will be sent to the addresses
View
@@ -287,12 +287,12 @@ def id_from_href(href)
class EpubWriter
def initialize(config)
@dirs = {
- :bin => File.join("..", "bin"),
- :templates => File.join("..", "templates")
+ :bin => File.join(File.dirname(__FILE__), '..', "bin"),
+ :templates => File.join(File.dirname(__FILE__), '..', "templates")
}
if config['directories']
- @dirs[:issues] = config['directories']['issues'] || File.join("..", "issues"),
- @dirs[:tmp_base] = config['directories']['tmp'] || File.join("..", "tmp")
+ @dirs[:issues] = config['directories']['issues'] || File.join(File.dirname(__FILE__), "..", "issues")
+ @dirs[:tmp_base] = config['directories']['tmp'] || File.join(File.dirname(__FILE__), "..", "tmp")
end
end
@@ -476,7 +476,7 @@ def send(issue, file)
class KindleTheEconomist
def initialize
- @config = Psych::parse_file(File.join('..', 'config.yml')).to_ruby
+ @config = Psych::parse_file(File.join(File.dirname(__FILE__), '..', 'config.yml')).to_ruby
@scraper = EconomistScraper.new(@config)
@writer = EpubWriter.new(@config)
@postman = PostMan.new(@config)
@@ -502,4 +502,4 @@ def process_issue(issue)
end
-KindleTheEconomist.new.main
+KindleTheEconomist.new.main

0 comments on commit 7764e18

Please sign in to comment.