brandeins 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brandeins (0.2.0)
4
+ brandeins (0.2.1)
5
5
  nokogiri
6
6
  prawn
7
7
  rake
data/README.md CHANGED
@@ -7,7 +7,7 @@ these fragmented PDFs, downloads and merges them into a single pdf.
7
7
 
8
8
 
9
9
  ## Requirements
10
- BrandEins Downloader uses *pdftk* and depends on *ruby*, *rubygems*, and
10
+ BrandEins Downloader uses [*pdftk*](http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) and depends on *ruby*, *rubygems*, and
11
11
  several ruby libraries (that you can get through rubygems)
12
12
 
13
13
 
@@ -23,4 +23,4 @@ Download just one magazine
23
23
 
24
24
  Download the whole collecion of a certain year
25
25
 
26
- `brandeins download_all --path=/Path/where/to/download/the/files --year=2011 --all`
26
+ `brandeins download --path=/Path/where/to/download/the/files --year=2011 --all`
data/brandeins.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "brandeins/version"
3
+ load File.expand_path("../lib/brandeins/version.rb", __FILE__)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "brandeins"
@@ -15,7 +15,7 @@ module BrandEins
15
15
  @url = 'http://www.brandeins.de'
16
16
  @dl_dir = path
17
17
  @tmp_dir = @dl_dir + '/brand-eins-tmp'
18
- @pdftool = BrandEins::Merger::PDFTools.get_pdf_tool
18
+ @pdftool = BrandEins::Merger::PdfTools.get_pdf_tool
19
19
  @archive = BrandEins::Parser::ArchiveSite.new(@url)
20
20
  create_tmp_dirs
21
21
  end
@@ -8,7 +8,7 @@ require 'brandeins/merger/templates/ghostscript_windows'
8
8
 
9
9
  module BrandEins
10
10
  module Merger
11
- class PDFTools
11
+ class PdfTools
12
12
 
13
13
  class << self
14
14
  def get_pdf_tool(env = nil)
@@ -34,7 +34,7 @@ module BrandEins
34
34
 
35
35
  def _cmd_available? (cmd, args)
36
36
  begin
37
- open("|#{cmd} #{args}").close
37
+ open("|#{cmd} #{args.join(' ')}").close
38
38
  rescue Exception
39
39
  return false
40
40
  end
@@ -5,7 +5,7 @@ module BrandEins
5
5
 
6
6
  def initialize(env = {})
7
7
  @os = env[:os] || RUBY_PLATFORM
8
- @pdf_tool = env[:pdf_tool] || BrandEins::Merging::PdfTools.get_pdf_tool(env)
8
+ @pdf_tool = env[:pdf_tool] || BrandEins::Merger::PdfTools.get_pdf_tool(env)
9
9
  end
10
10
 
11
11
  def run
@@ -1,3 +1,3 @@
1
1
  module BrandEins
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -4,6 +4,7 @@ require 'webmock/minitest'
4
4
  require File.expand_path('../../lib/brandeins', __FILE__)
5
5
 
6
6
  describe BrandEins do
7
+
7
8
  it "shows current version" do
8
9
  out = capture_stdout do
9
10
  BrandEins::CLI.start(['--version'])
@@ -11,6 +12,18 @@ describe BrandEins do
11
12
  assert_equal BrandEins::VERSION, out.string.chomp
12
13
  end
13
14
 
15
+ it "shows setup instructions" do
16
+ pdf_tool = Object.new
17
+ pdf_tool.define_singleton_method(:available?) do true; end
18
+ pdf_tool.define_singleton_method(:cmd) do "Funky Monkey" end
19
+
20
+ out = capture_stdout do
21
+ BrandEins::Setup.new( pdf_tool: pdf_tool ).run
22
+ end
23
+
24
+ assert !!out.string.chomp.match("you have Funky Monkey running"), "Missing Funky Monkey"
25
+ end
26
+
14
27
  it "runs pdftk" do
15
28
  # response_archiv = IO.read(File.expand_path('../../test_support/fixtures/brandeins_archiv.html', __FILE__))
16
29
  # jpgfile = IO.binread(File.expand_path('../../test_support/fixtures/cover.jpg', __FILE__))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brandeins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
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: 2013-02-07 00:00:00.000000000 Z
12
+ date: 2013-02-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -136,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  segments:
138
138
  - 0
139
- hash: 3071467476645633287
139
+ hash: 1329463463916465473
140
140
  required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  none: false
142
142
  requirements:
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  segments:
147
147
  - 0
148
- hash: 3071467476645633287
148
+ hash: 1329463463916465473
149
149
  requirements: []
150
150
  rubyforge_project:
151
151
  rubygems_version: 1.8.24