Module: LFD::Env
- Included in:
- App
- Defined in:
- lib/lfd/env.rb
Instance Method Summary collapse
- #check_cmd(title, cmd_path) ⇒ Object
- #check_flash_player ⇒ Object
- #check_flex_sdk ⇒ Object
- #compc ⇒ Object
- #compc_path ⇒ Object
- #compc_ready? ⇒ Boolean
-
#env(opt = {}) ⇒ Object
Public: Check the flash developing environment.
- #executable?(cmd) ⇒ Boolean
- #executable_path(cmd) ⇒ Object
- #flash_player ⇒ Object
- #flash_player_path ⇒ Object (also: #fp_path)
- #flash_player_ready? ⇒ Boolean (also: #fp_ready?)
- #flex_sdk_ready? ⇒ Boolean
- #mm_cfg ⇒ Object
- #mxmlc ⇒ Object
- #mxmlc_path ⇒ Object
- #mxmlc_ready? ⇒ Boolean
- #trace_log_file ⇒ Object
Instance Method Details
#check_cmd(title, cmd_path) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/lfd/env.rb', line 17 def check_cmd title, cmd_path print "#{title}: ".capitalize.rjust(20) if cmd_path puts cmd_path.chomp.green else puts "✗".red end end |
#check_flash_player ⇒ Object
26 27 28 |
# File 'lib/lfd/env.rb', line 26 def check_flash_player check_cmd 'Flash Player', fp_path end |
#check_flex_sdk ⇒ Object
12 13 14 15 |
# File 'lib/lfd/env.rb', line 12 def check_flex_sdk check_cmd( "flex sdk - mxmlc", mxmlc_path ) check_cmd( "flex sdk - compc", compc_path ) end |
#compc ⇒ Object
59 60 61 |
# File 'lib/lfd/env.rb', line 59 def compc ENV['COMPC'] || 'compc' end |
#compc_path ⇒ Object
63 64 65 |
# File 'lib/lfd/env.rb', line 63 def compc_path @compc_path ||= executable_path( compc ) end |
#compc_ready? ⇒ Boolean
47 48 49 |
# File 'lib/lfd/env.rb', line 47 def compc_ready? executable? compc end |
#env(opt = {}) ⇒ Object
Public: Check the flash developing environment
7 8 9 10 |
# File 'lib/lfd/env.rb', line 7 def env(opt={}) check_flex_sdk check_flash_player end |
#executable?(cmd) ⇒ Boolean
38 39 40 |
# File 'lib/lfd/env.rb', line 38 def executable? cmd !!executable_path( cmd ) end |
#executable_path(cmd) ⇒ Object
42 43 44 45 |
# File 'lib/lfd/env.rb', line 42 def executable_path cmd path = `which #{Shellwords.escape(cmd)}` path.empty? ? nil : path.chomp end |
#flash_player ⇒ Object
73 74 75 |
# File 'lib/lfd/env.rb', line 73 def flash_player ENV['FLASH_PLAYER'] || 'flashplayer' end |
#flash_player_path ⇒ Object Also known as: fp_path
77 78 79 |
# File 'lib/lfd/env.rb', line 77 def flash_player_path @fp_path ||= executable_path( flash_player ) end |
#flash_player_ready? ⇒ Boolean Also known as: fp_ready?
67 68 69 |
# File 'lib/lfd/env.rb', line 67 def flash_player_ready? executable? flash_player end |
#flex_sdk_ready? ⇒ Boolean
30 31 32 |
# File 'lib/lfd/env.rb', line 30 def flex_sdk_ready? mxmlc_ready? && compc_ready? end |
#mm_cfg ⇒ Object
87 88 89 |
# File 'lib/lfd/env.rb', line 87 def mm_cfg File.join ENV['HOME'], 'mm.cfg' end |
#mxmlc ⇒ Object
51 52 53 |
# File 'lib/lfd/env.rb', line 51 def mxmlc ENV['MXMLC'] || 'mxmlc' end |
#mxmlc_path ⇒ Object
55 56 57 |
# File 'lib/lfd/env.rb', line 55 def mxmlc_path @mxmlc_path ||= executable_path( mxmlc ) end |
#mxmlc_ready? ⇒ Boolean
34 35 36 |
# File 'lib/lfd/env.rb', line 34 def mxmlc_ready? executable? mxmlc end |
#trace_log_file ⇒ Object
83 84 85 |
# File 'lib/lfd/env.rb', line 83 def trace_log_file File.join ENV['HOME'], '.macromedia/Flash_Player/Logs/flashlog.txt' end |