Class: Gmaps4rails::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Gmaps4rails::Generators::InstallGenerator
- Defined in:
- lib/generators/gmaps4rails/install_generator.rb
Instance Method Summary collapse
- #copy_locale ⇒ Object
- #destination_assets_base_path ⇒ Object
- #destination_js_base_path ⇒ Object
- #show_readme ⇒ Object
- #source_assets_base_path ⇒ Object
- #source_js_base_path ⇒ Object
Instance Method Details
#copy_locale ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/generators/gmaps4rails/install_generator.rb', line 8 def copy_locale if Rails::VERSION::MINOR >= 1 copy_file "#{source_assets_base_path}gmaps4rails.base.js.coffee", "#{destination_assets_base_path}gmaps4rails.base.js.coffee" copy_file "#{source_assets_base_path}gmaps4rails.googlemaps.js.coffee", "#{destination_assets_base_path}gmaps4rails.googlemaps.js.coffee" copy_file "#{source_assets_base_path}gmaps4rails.openlayers.js.coffee", "#{destination_assets_base_path}gmaps4rails.openlayers.js.coffee" copy_file "#{source_assets_base_path}gmaps4rails.bing.js.coffee", "#{destination_assets_base_path}gmaps4rails.bing.js.coffee" copy_file "#{source_assets_base_path}gmaps4rails.mapquest.js.coffee", "#{destination_assets_base_path}gmaps4rails.mapquest.js.coffee" copy_file "../../../public/stylesheets/gmaps4rails.css", "app/assets/stylesheets/gmaps4rails.css" else #I don't copy manifests, kind of useless copy_file "#{source_js_base_path}gmaps4rails.base.js", "#{destination_js_base_path}gmaps4rails.base.js" copy_file "#{source_js_base_path}gmaps4rails.googlemaps.js", "#{destination_js_base_path}gmaps4rails.googlemaps.js" copy_file "#{source_js_base_path}gmaps4rails.bing.js", "#{destination_js_base_path}gmaps4rails.bing.js" copy_file "#{source_js_base_path}gmaps4rails.openlayers.js", "#{destination_js_base_path}gmaps4rails.openlayers.js" copy_file "#{source_js_base_path}gmaps4rails.mapquest.js", "#{destination_js_base_path}gmaps4rails.mapquest.js" copy_file "../../../public/stylesheets/gmaps4rails.css", "public/stylesheets/gmaps4rails.css" end end |
#destination_assets_base_path ⇒ Object
31 32 33 |
# File 'lib/generators/gmaps4rails/install_generator.rb', line 31 def destination_assets_base_path 'app/assets/javascripts/gmaps4rails/' end |
#destination_js_base_path ⇒ Object
39 40 41 |
# File 'lib/generators/gmaps4rails/install_generator.rb', line 39 def destination_js_base_path "public/javascripts/gmaps4rails/" end |
#show_readme ⇒ Object
43 44 45 |
# File 'lib/generators/gmaps4rails/install_generator.rb', line 43 def show_readme readme 'README' if behavior == :invoke end |
#source_assets_base_path ⇒ Object
27 28 29 |
# File 'lib/generators/gmaps4rails/install_generator.rb', line 27 def source_assets_base_path '../../../app/assets/javascripts/gmaps4rails/' end |
#source_js_base_path ⇒ Object
35 36 37 |
# File 'lib/generators/gmaps4rails/install_generator.rb', line 35 def source_js_base_path "../../../public/javascripts/gmaps4rails/" end |