[ci] Fixes CI Build

pull/7/head
Nemo 3 years ago
parent f4cf8ce97c
commit 18a051e20f
  1. 5
      .travis.yml
  2. 4
      spec/pdftk_spec.cr
  3. 7
      src/pdftk.cr

@ -3,3 +3,8 @@ language: crystal
script:
- crystal spec
- crystal tool format --check
addons:
apt:
packages:
- pdftk

@ -3,8 +3,6 @@ require "./spec_helper"
describe Muse::Dl::Pdftk do
it "should find pdftk binary" do
pdftk = Muse::Dl::Pdftk.new
if pdftk.binary
pdftk.binary.should eq "/usr/sbin/pdftk"
end
pdftk.ready?.should eq true
end
end

@ -7,14 +7,15 @@ require "dir"
module Muse::Dl
class Pdftk
PDFTK_BINARY_NAME = "pdftk"
@binary = "/usr/sbin/pdftk"
@binary : String | Nil
@tmp_file_path : String
getter :binary
def ready?
@binary != nil
end
def initialize(tmp_file_path : String = Dir.tempdir)
@tmp_file_path = tmp_file_path
possible_binary = Process.find_executable(Pdftk::PDFTK_BINARY_NAME)
if possible_binary
@binary = possible_binary

Loading…
Cancel
Save