Module: Eyeballs::AppDetector
- Included in:
- AppGenerator, ControllerGenerator, ModelGenerator, ScaffoldGenerator
- Defined in:
- lib/eyeballs/app_detector.rb
Instance Method Summary collapse
- #app_path ⇒ Object
- #new_app_path ⇒ Object
- #prefix ⇒ Object
- #public_path ⇒ Object
- #rack_app? ⇒ Boolean
Instance Method Details
#app_path ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/eyeballs/app_detector.rb', line 14 def app_path @app_path ||= if rack_app? $stdout.puts "public folder detected, installing to public/javascripts" 'public/javascripts' else '.' end end |
#new_app_path ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/eyeballs/app_detector.rb', line 5 def new_app_path @new_app_path ||= if rack_app? $stdout.puts "public folder detected, installing to public/javascripts" 'public/javascripts' else name end end |
#prefix ⇒ Object
31 32 33 |
# File 'lib/eyeballs/app_detector.rb', line 31 def prefix '/public/' if rack_app? end |
#public_path ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/eyeballs/app_detector.rb', line 23 def public_path @public_path ||= if rack_app? 'public' else '.' end end |
#rack_app? ⇒ Boolean
35 36 37 |
# File 'lib/eyeballs/app_detector.rb', line 35 def rack_app? File.exists?('public') end |