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
#app_path, #application_name, #class_name, #config_path, #configuration, #engine_name, #handlebars_template_path, #javascript_assets_path, #rails_engine?
Instance Method Details
#add_custom_paths ⇒ Object
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 55
def add_custom_paths
if app_path != configuration.paths.app
insert_into_file 'config/application.rb', before: /\s\send\nend/ do
" config.ember.appkit.paths.app = '#{app_path}'\n"
end
end
if config_path != configuration.paths.config
insert_into_file 'config/application.rb', before: /\s\send\nend/ do
" config.ember.appkit.paths.config = '#{config_path}'\n"
end
end
end
|
#create_application_file ⇒ Object
27
28
29
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 27
def create_application_file
template "application.js.erb", "#{config_path}/application.js"
end
|
#create_dir_layout ⇒ Object
16
17
18
19
20
21
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 16
def create_dir_layout
%W{routes components templates templates/components mixins}.each do |dir|
empty_directory "#{app_path}/#{dir}"
create_file "#{app_path}/#{dir}/.gitkeep" unless options[:skip_git]
end
end
|
#create_ember_adapter_file ⇒ Object
31
32
33
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 31
def create_ember_adapter_file
template "adapter.js.erb", "#{config_path}/adapter.js.erb"
end
|
#create_ember_environment_files ⇒ Object
35
36
37
38
39
40
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 35
def create_ember_environment_files
template "environment.js", "#{config_path}/environment.js"
template "environments/development.js", "#{config_path}/environments/development.js"
template "environments/production.js", "#{config_path}/environments/production.js"
template "environments/test.js", "#{config_path}/environments/test.js"
end
|
#create_router_file ⇒ Object
23
24
25
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 23
def create_router_file
template "router.js.es6", "#{config_path}/router.js.es6"
end
|
#create_utils_csrf_file ⇒ Object
42
43
44
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 42
def create_utils_csrf_file
template "csrf.js", "#{config_path}/initializers/csrf.js"
end
|
#remove_jbuilder ⇒ Object
51
52
53
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 51
def remove_jbuilder
remove_jbuilder_from_gemfile
end
|
#remove_turbolinks ⇒ Object
46
47
48
49
|
# File 'lib/generators/ember/bootstrap_generator.rb', line 46
def remove_turbolinks
remove_turbolinks_from_gemfile
remove_turbolinks_from_layout
end
|