Skip to content

Commit

Permalink
Add Travis check to library
Browse files Browse the repository at this point in the history
  • Loading branch information
ezkl committed Apr 5, 2012
1 parent 44d2914 commit bcc2bdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ before_install:
- sudo apt-get install cutycapt -y
before_script:
- "export DISPLAY=:99.0"
- "export TRAVIS=true"
- "sh -e /etc/init.d/xvfb start"
- "which cutycapt"
6 changes: 5 additions & 1 deletion lib/capit/capture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,18 @@ def capture_command
cmd += " --min-height='#{@min_height}'"


if determine_os == :linux and check_xvfb
if determine_os == :linux and check_xvfb and not_travis
xvfb = 'xvfb-run --server-args="-screen 99, 1024x768x24" '
xvfb.concat(cmd)
else
cmd
end
end

def not_travis
!ENV.include? "TRAVIS"
end

def check_xvfb
!(`which xvfb-run`.empty?)
end
Expand Down

0 comments on commit bcc2bdf

Please sign in to comment.