lib/travis/tools/assets.rb in travis-1.9.2.travis.1236.9 vs lib/travis/tools/assets.rb in travis-1.9.2.travis.1254.9
- old
+ new
@@ -1,21 +1,24 @@
+require 'pathname'
module Travis
module Tools
module Assets
BASE = File.expand_path('../../../../assets', __FILE__)
extend self
def asset_path(file)
- File.expand_path(file, BASE)
+ Pathname.glob(File.expand_path(file, BASE)).tap do |x|
+ raise Travis::Client::AssetNotFound.new(file) if x.empty?
+ end
end
def asset(file)
- File.read(asset_path(file))
+ File.read(asset_path(file).first)
end
class << self
alias [] asset_path
alias read asset
end
end
end
-end
\ No newline at end of file
+end