Class: Ember::Generators::BootstrapGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
GeneratorHelpers
Defined in:
lib/generators/ember/bootstrap_generator.rb

Instance Method Summary collapse

Methods included from GeneratorHelpers

#application_name, #class_name, #configuration, #ember_path, #engine_extension, #engine_name, #handlebars_template_path, #javascript_engine, #rails_engine?

Instance Method Details

#create_adapter_fileObject



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_fileObject



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_layoutObject



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_fileObject



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_fileObject



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_emberObject



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') # Don't use `.module.es6`.
  else
    inject_into_application_file(engine_extension)
  end
rescue Exception
  inject_into_application_file('js')
end