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
16 17 18 19 20 21 22 23 |
# File 'lib/lfd/env.rb', line 16 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
25 26 27 |
# File 'lib/lfd/env.rb', line 25 def check_flash_player check_cmd 'Flash Player', fp_path end |
#check_flex_sdk ⇒ Object
11 12 13 14 |
# File 'lib/lfd/env.rb', line 11 def check_flex_sdk check_cmd( "flex sdk - mxmlc", mxmlc_path ) check_cmd( "flex sdk - compc", compc_path ) end |
#compc ⇒ Object
58 59 60 |
# File 'lib/lfd/env.rb', line 58 def compc ENV['COMPC'] || 'compc' end |
#compc_path ⇒ Object
62 63 64 |
# File 'lib/lfd/env.rb', line 62 def compc_path @compc_path ||= executable_path( compc ) end |
#compc_ready? ⇒ Boolean
46 47 48 |
# File 'lib/lfd/env.rb', line 46 def compc_ready? executable? compc end |
#env(opt = {}) ⇒ Object
Public: Check the flash developing environment
6 7 8 9 |
# File 'lib/lfd/env.rb', line 6 def env(opt={}) check_flex_sdk check_flash_player end |
#executable?(cmd) ⇒ Boolean
37 38 39 |
# File 'lib/lfd/env.rb', line 37 def executable? cmd !!executable_path( cmd ) end |
#executable_path(cmd) ⇒ Object
41 42 43 44 |
# File 'lib/lfd/env.rb', line 41 def executable_path cmd path = `which #{Shellwords.escape(cmd)}` path.empty? ? nil : path.chomp end |
#flash_player ⇒ Object
72 73 74 |
# File 'lib/lfd/env.rb', line 72 def flash_player ENV['FLASH_PLAYER'] || 'flashplayer' end |
#flash_player_path ⇒ Object Also known as: fp_path
76 77 78 |
# File 'lib/lfd/env.rb', line 76 def flash_player_path @fp_path ||= executable_path( flash_player ) end |
#flash_player_ready? ⇒ Boolean Also known as: fp_ready?
66 67 68 |
# File 'lib/lfd/env.rb', line 66 def flash_player_ready? executable? flash_player end |
#flex_sdk_ready? ⇒ Boolean
29 30 31 |
# File 'lib/lfd/env.rb', line 29 def flex_sdk_ready? mxmlc_ready? && compc_ready? end |
#mm_cfg ⇒ Object
86 87 88 |
# File 'lib/lfd/env.rb', line 86 def mm_cfg File.join ENV['HOME'], 'mm.cfg' end |
#mxmlc ⇒ Object
50 51 52 |
# File 'lib/lfd/env.rb', line 50 def mxmlc ENV['MXMLC'] || 'mxmlc' end |
#mxmlc_path ⇒ Object
54 55 56 |
# File 'lib/lfd/env.rb', line 54 def mxmlc_path @mxmlc_path ||= executable_path( mxmlc ) end |
#mxmlc_ready? ⇒ Boolean
33 34 35 |
# File 'lib/lfd/env.rb', line 33 def mxmlc_ready? executable? mxmlc end |
#trace_log_file ⇒ Object
82 83 84 |
# File 'lib/lfd/env.rb', line 82 def trace_log_file File.join ENV['HOME'], '.macromedia/Flash_Player/Logs/flashlog.txt' end |