Class: Sprout::System::OSXSystem
- Inherits:
-
UnixSystem
- Object
- BaseSystem
- UnixSystem
- Sprout::System::OSXSystem
- Defined in:
- sprout/lib/sprout/system/osx_system.rb,
flashsdk/lib/flashplayer/system_mixins.rb
Constant Summary
- LIBRARY =
'Library'
Instance Method Summary (collapse)
- - (Boolean) can_execute?(platform)
- - (Object) format_application_name(name)
- - (Object) library
-
- (Object) open_flashplayer_with(exe, swf)
Use AppleScript to open the specified Flash Player because, simply launching the executable does not focus it.
Methods inherited from UnixSystem
#attempt_to_repair_executable, #clean_path, #execute, #repair_executable, #should_repair_executable
Methods inherited from BaseSystem
#alt_separator?, #application_home, #clean_path, #env_home, #env_homedrive, #env_homedrive_and_homepath, #env_homepath, #env_userprofile, #execute, #execute_silent, #execute_thread, #find_home, #get_and_execute_process_runner, #get_process_runner, #home, #home=, #read_from, #tilde_home, #worst_case_home
Instance Method Details
- (Boolean) can_execute?(platform)
20 21 22 |
# File 'sprout/lib/sprout/system/osx_system.rb', line 20 def can_execute? platform [:mac, :osx, :macosx, :darwin].include?(platform) || super end |
- (Object) format_application_name(name)
16 17 18 |
# File 'sprout/lib/sprout/system/osx_system.rb', line 16 def format_application_name(name) return name.capitalize end |
- (Object) library
7 8 9 10 11 12 13 14 |
# File 'sprout/lib/sprout/system/osx_system.rb', line 7 def library lib = File.join(home, LIBRARY) if(File.exists?(lib)) return lib else return super end end |
- (Object) open_flashplayer_with(exe, swf)
Use AppleScript to open the specified Flash Player because, simply launching the executable does not focus it.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'flashsdk/lib/flashplayer/system_mixins.rb', line 21 def open_flashplayer_with exe, swf # Clean paths differently for this exectuable, # because we're forking out to AppleScript over # a new process, and spaces need to be escaped. @player_exe = exe.split(' ').join('\ ') wrapper = [] wrapper << "osascript" wrapper << open_flashplayer_script_path wrapper << @player_exe # Call the UnixSystem.open_flashplayer_with method: super wrapper.join(" "), File.(swf) end |