Class: Ember::Generators::BootstrapGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Ember::Generators::BootstrapGenerator
show all
- Includes:
- GeneratorHelpers
- Defined in:
- lib/generators/ember/bootstrap_generator.rb
Instance Method Summary
collapse
#application_name, #class_name, #configuration, #ember_path, #engine_extension, #engine_name, #handlebars_template_path, #javascript_engine, #rails_engine?
Instance Method Details
#create_adapter_file ⇒ Object
45
46
47
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 45
def create_adapter_file
template "application_adapter.#{engine_extension}", "#{ember_path}/adapters/application.#{engine_extension}"
end
|
#create_app_file ⇒ Object
37
38
39
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 37
def create_app_file
template "app.#{engine_extension}", "#{ember_path}/#{application_name.underscore.dasherize}.#{engine_extension}"
end
|
#create_dir_layout ⇒ Object
30
31
32
33
34
35
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 30
def create_dir_layout
ember_prefix_dirs.each do |dir|
empty_directory "#{ember_path}/#{dir}"
create_file "#{ember_path}/#{dir}/.gitkeep" unless options[:skip_git]
end
end
|
#create_env_file ⇒ Object
49
50
51
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 49
def create_env_file
template "environment.#{engine_extension}", "#{ember_path}/environment.#{engine_extension}"
end
|
#create_router_file ⇒ Object
41
42
43
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 41
def create_router_file
template "router.#{engine_extension}", "#{ember_path}/router.#{engine_extension}"
end
|
#inject_ember ⇒ Object
20
21
22
23
24
25
26
27
28
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 20
def inject_ember
if javascript_engine == 'es6'
inject_into_application_file('es6') else
inject_into_application_file(engine_extension)
end
rescue Exception
inject_into_application_file('js')
end
|