don't include FileTest in top-level, fixes #45
This commit is contained in:
parent
61d84c85c2
commit
9e88a3925c
@ -52,8 +52,7 @@ require 'net/http'
|
|||||||
|
|
||||||
# Code is run through [Pygments](http://pygments.org/) for syntax
|
# Code is run through [Pygments](http://pygments.org/) for syntax
|
||||||
# highlighting. If it's not installed, locally, use a webservice.
|
# highlighting. If it's not installed, locally, use a webservice.
|
||||||
include FileTest
|
if !ENV['PATH'].split(':').any? { |dir| File.executable?("#{dir}/pygmentize") }
|
||||||
if !ENV['PATH'].split(':').any? { |dir| executable?("#{dir}/pygmentize") }
|
|
||||||
warn "WARNING: Pygments not found. Using webservice."
|
warn "WARNING: Pygments not found. Using webservice."
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -159,7 +158,7 @@ class Rocco
|
|||||||
# Returns `true` if `pygmentize` is available locally, `false` otherwise.
|
# Returns `true` if `pygmentize` is available locally, `false` otherwise.
|
||||||
def pygmentize?
|
def pygmentize?
|
||||||
@_pygmentize ||= ENV['PATH'].split(':').
|
@_pygmentize ||= ENV['PATH'].split(':').
|
||||||
any? { |dir| executable?("#{dir}/pygmentize") }
|
any? { |dir| File.executable?("#{dir}/pygmentize") }
|
||||||
end
|
end
|
||||||
|
|
||||||
# If `pygmentize` is available, we can use it to autodetect a file's
|
# If `pygmentize` is available, we can use it to autodetect a file's
|
||||||
|
Loading…
Reference in New Issue
Block a user