Class: Gmaps4rails::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/gmaps4rails/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_localeObject



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_pathObject



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_pathObject



39
40
41
# File 'lib/generators/gmaps4rails/install_generator.rb', line 39

def destination_js_base_path
  "public/javascripts/gmaps4rails/"
end

#show_readmeObject



43
44
45
# File 'lib/generators/gmaps4rails/install_generator.rb', line 43

def show_readme
  readme 'README' if behavior == :invoke
end

#source_assets_base_pathObject



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_pathObject



35
36
37
# File 'lib/generators/gmaps4rails/install_generator.rb', line 35

def source_js_base_path
  "../../../public/javascripts/gmaps4rails/"
end