From 2c13bb7f9a72709105ca64cb1605a9e32d0426cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 7 Oct 2020 16:58:14 +0200 Subject: [PATCH] Fix 'travis monitor' on Linux Just loading notification.rb causes the Dummy class constructor to fail, because of non-existing path in Asset. This seems to be caused by some recent changes in asset.rb, but the proper fix is to not rely on non-existing path. Before this fix the error message is: ``` Traceback (most recent call last): 18: from /home/user/bin/travis:23:in `
' 17: from /home/user/bin/travis:23:in `load' 16: from /home/user/.gem/ruby/gems/travis-1.10.0/bin/travis:18:in `' 15: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/cli.rb:62:in `run' 14: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/cli.rb:69:in `command' 13: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/cli.rb:69:in `const_get' 12: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require' 11: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require' 10: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/cli/monitor.rb:2:in `' 9: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require' 8: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require' 7: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/tools/notification.rb:6:in `' 6: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/tools/notification.rb:7:in `' 5: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/tools/notification.rb:8:in `' 4: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/tools/notification.rb:26:in `' 3: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/tools/notification.rb:27:in `' 2: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/tools/assets.rb:9:in `asset_path' 1: from /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/tools/assets.rb:9:in `tap' /home/user/.gem/ruby/gems/travis-1.10.0/lib/travis/tools/assets.rb:10:in `block in asset_path': Travis CI.app/Contents/MacOS/Travis CI (Travis::Client::AssetNotFound) ``` --- lib/travis/tools/notification.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/travis/tools/notification.rb b/lib/travis/tools/notification.rb index 4b02a0be..3065fc9d 100644 --- a/lib/travis/tools/notification.rb +++ b/lib/travis/tools/notification.rb @@ -24,7 +24,6 @@ def get(name) end class Dummy - BIN_PATH = Assets['Travis CI.app/Contents/MacOS/Travis CI'] def notify(title, body) end