Class: Cruyff::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Cruyff::Generators::InstallGenerator
- Defined in:
- lib/generators/cruyff/install/install_generator.rb
Constant Summary collapse
- @@default_version =
"1.4.4"
Instance Method Summary collapse
- #download_cruyff ⇒ Object
- #download_jquery ⇒ Object
- #download_jquery_bbq ⇒ Object
- #download_jquery_form ⇒ Object
- #download_jquery_ui ⇒ Object
- #download_ujs_driver ⇒ Object
- #remove_prototype ⇒ Object
Instance Method Details
#download_cruyff ⇒ Object
37 38 39 40 |
# File 'lib/generators/cruyff/install/install_generator.rb', line 37 def download_cruyff say_status("fetching", "jQuery Cruyff plugin (github HEAD)", :green) get "https://github.com/andref5/cruyff/raw/master/lib/generators/cruyff/templates/jquery.cruyff.js", "public/javascripts/jquery.cruyff.js" end |
#download_jquery ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/generators/cruyff/install/install_generator.rb', line 15 def download_jquery say_status("fetching", "jQuery (#{.version})", :green) get_jquery(.version) rescue OpenURI::HTTPError say_status("warning", "could not find jQuery (#{.version})", :yellow) say_status("fetching", "jQuery (#{@@default_version})", :green) get_jquery(@@default_version) end |
#download_jquery_bbq ⇒ Object
42 43 44 45 |
# File 'lib/generators/cruyff/install/install_generator.rb', line 42 def download_jquery_bbq say_status("fetching", "jQuery BBQ plugin: Back Button & Query Library (github HEAD)", :green) get "https://github.com/cowboy/jquery-bbq/raw/master/jquery.ba-bbq.js", "public/javascripts/jquery.ba-bbq.js" end |
#download_jquery_form ⇒ Object
47 48 49 50 |
# File 'lib/generators/cruyff/install/install_generator.rb', line 47 def download_jquery_form say_status("fetching", "jQuery Form plugin (github HEAD)", :green) get "https://github.com/malsup/form/raw/master/jquery.form.js", "public/javascripts/jquery.form.js" end |
#download_jquery_ui ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/generators/cruyff/install/install_generator.rb', line 24 def download_jquery_ui if .ui? say_status("fetching", "jQuery UI (latest 1.x release)", :green) get "http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.js", "public/javascripts/jquery-ui.js" get "http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js", "public/javascripts/jquery-ui.min.js" end end |
#download_ujs_driver ⇒ Object
32 33 34 35 |
# File 'lib/generators/cruyff/install/install_generator.rb', line 32 def download_ujs_driver say_status("fetching", "jQuery UJS Cruyff adapter (github HEAD)", :green) get "https://github.com/andref5/cruyff/raw/master/lib/generators/cruyff/templates/rails.js", "public/javascripts/rails.js" end |
#remove_prototype ⇒ Object
9 10 11 12 13 |
# File 'lib/generators/cruyff/install/install_generator.rb', line 9 def remove_prototype %w(controls.js dragdrop.js effects.js prototype.js).each do |js| remove_file "public/javascripts/#{js}" end end |