Class: Launchy::Application::General
- Inherits:
-
Launchy::Application
- Object
- Launchy::Application
- Launchy::Application::General
- Defined in:
- lib/my_shows/launcher.rb
Overview
The class handling the browser application and all of its schemes
Class Method Summary collapse
Instance Method Summary collapse
-
#app_list ⇒ Object
use a call back mechanism to get the right app_list that is decided by the host_os_family class.
- #cmd ⇒ Object
- #cygwin_app_list ⇒ Object
- #darwin_app_list ⇒ Object
- #nix_app_list ⇒ Object
- #open(uri, options = {}) ⇒ Object
- #windows_app_list ⇒ Object
Class Method Details
.handles?(uri) ⇒ Boolean
8 9 10 |
# File 'lib/my_shows/launcher.rb', line 8 def self.handles?(uri) true end |
Instance Method Details
#app_list ⇒ Object
use a call back mechanism to get the right app_list that is decided by the host_os_family class.
30 31 32 |
# File 'lib/my_shows/launcher.rb', line 30 def app_list host_os_family.app_list(self) end |
#cmd ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/my_shows/launcher.rb', line 34 def cmd possibilities = app_list.flatten possibilities.each do |p| Launchy.log "#{self.class.name} : possibility : #{p}" end if (cmdline = possibilities.shift) Launchy.log "#{self.class.name} : Using browser value '#{cmdline}'" return cmdline end raise Launchy::CommandNotFoundError, "Unable to find a browser command. If this is unexpected, #{Launchy.}" end |
#cygwin_app_list ⇒ Object
16 17 18 |
# File 'lib/my_shows/launcher.rb', line 16 def cygwin_app_list ['cmd /C start /b'] end |
#darwin_app_list ⇒ Object
20 21 22 |
# File 'lib/my_shows/launcher.rb', line 20 def darwin_app_list [find_executable("open")] end |
#nix_app_list ⇒ Object
24 25 26 |
# File 'lib/my_shows/launcher.rb', line 24 def nix_app_list %w[ xdg-open ] end |
#open(uri, options = {}) ⇒ Object
47 48 49 |
# File 'lib/my_shows/launcher.rb', line 47 def open(uri, = {}) run(cmd, uri) end |
#windows_app_list ⇒ Object
12 13 14 |
# File 'lib/my_shows/launcher.rb', line 12 def windows_app_list ['start /b'] end |