Class: Ovimap::Generators::BuildGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Ovimap::Generators::BuildGenerator
show all
- Includes:
- Helpers
- Defined in:
- lib/generators/ovimap/build/build_generator.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Helpers
#asset_path, #content_for, #heatmap_options, #js_path, #layouts, #map_select, #map_style, #map_swap, #nokia_script, #pin_options, #stylesheets
Class Method Details
.source_root ⇒ Object
12
13
14
|
# File 'lib/generators/ovimap/build/build_generator.rb', line 12
def self.source_root
@source_root ||= File.expand_path("../templates", __FILE__)
end
|
Instance Method Details
#build ⇒ Object
16
17
18
19
20
21
22
23
24
|
# File 'lib/generators/ovimap/build/build_generator.rb', line 16
def build
append_file "#{stylesheets}/#{controller_name}.css.scss",
"\n#mapContainer { top: 0; left: 0; position: absolute; height:100%; width:100% }"
prepend_file "app/views/#{controller_name}/#{action_name}.html.erb", "#{content_for}"
printf "\e[32m \n\t\t\tSUCCESS. A content_for tag is now located in #{controller_name}/#{action_name}.html.erb.\n
To manipulate the size of the map, style the #mapContainer directly in css.\n
#mapContainer.\n"
end
|