Class: Labjs::Generators::InstallGenerator
- Inherits:
- 
      Rails::Generators::Base
      
        - Object
- Rails::Generators::Base
- Labjs::Generators::InstallGenerator
 
- Defined in:
- lib/generators/labjs/install/install_generator.rb
Constant Summary collapse
- @@default_version =
- "master"
- @@dist_url =
- "https://github.com/getify/LABjs/raw/{version}/{file}"
Instance Method Summary collapse
Instance Method Details
#download_labjs ⇒ Object
| 15 16 17 18 19 20 21 22 23 24 25 26 27 | # File 'lib/generators/labjs/install/install_generator.rb', line 15 def download_labjs say_status("fetching", "LABjs (#{.version})", :green) get_labjs(.version) rescue OpenURI::HTTPError say_status("warning", "could not find LABjs (#{.version})", :yellow) say_status("warning", labjs_url(.version, 'LAB.src.js'), :yellow) say_status("warning", labjs_url(.version, 'LAB.min.js'), :yellow) if @@default_version != .version say_status("fetching", "LABjs (#{@@default_version})", :green) get_labjs(@@default_version) end end | 
#remove_labjs ⇒ Object
| 9 10 11 12 13 | # File 'lib/generators/labjs/install/install_generator.rb', line 9 def remove_labjs %w(LAB.src.js LAB.min.js).each do |js| remove_file "public/javascripts/#{js}" end end |