# -*- encoding: utf-8 -*-

begin
  require 'appscript'
rescue LoadError
  # Define a part of the Appscript gem so WatchTower is fully operational
  module ::Appscript
    CommandError = Class.new(Exception)
    def app(*args)
      raise ::WatchTower::AppscriptNotLoadedError
    end
  end

  module ::FindApp
    ApplicationNotFoundError = Class.new(Exception)
  end
end

# -*- encoding: utf-8 -*-

begin
  require 'rubygems'
  require 'appscript'
rescue LoadError
  require 'rbconfig'
  if RbConfig::CONFIG['target_os'] =~ /darwin/i
    STDERR.puts "Please install 'appscript' to use this gem with Textmate"
    STDERR.puts "gem install appscript"
  end

  # Define a part of the Appscript gem so WatchTower is fully operational
  module ::Appscript
    CommandError = Class.new(Exception)
    def app(*args)
      raise ::WatchTower::AppscriptNotLoadedError
    end
  end

  module ::FindApp
    ApplicationNotFoundError = Class.new(Exception)
  end
end

Revert "Appscript: Remove the useless message it is now included in the Gemspec."
Revert "Appscript: Remove the useless message it is now included in the Gemspec."

This reverts commit 5c6b9c92247a02183404c23a5a79da5638fbd518.
