Class: Suspenders::ViewsGenerator

Inherits:
Generators::Base show all
Defined in:
lib/suspenders/generators/views_generator.rb

Instance Method Summary collapse

Methods inherited from Generators::Base

default_source_root, inherited

Methods included from ExitOnFailure

#bundle_command

Methods included from Actions

#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #gem, #replace_in_file

Instance Method Details

#create_application_layoutObject



19
20
21
22
23
# File 'lib/suspenders/generators/views_generator.rb', line 19

def create_application_layout
  template "suspenders_layout.html.erb.erb",
    "app/views/layouts/application.html.erb",
    force: true
end

#create_partials_directoryObject



5
6
7
# File 'lib/suspenders/generators/views_generator.rb', line 5

def create_partials_directory
  empty_directory "app/views/application"
end

#create_shared_css_overridesObject



14
15
16
17
# File 'lib/suspenders/generators/views_generator.rb', line 14

def create_shared_css_overrides
  copy_file "_css_overrides.html.erb",
    "app/views/application/_css_overrides.html.erb"
end

#create_shared_flashesObject



9
10
11
12
# File 'lib/suspenders/generators/views_generator.rb', line 9

def create_shared_flashes
  copy_file "_flashes.html.erb", "app/views/application/_flashes.html.erb"
  copy_file "flashes_helper.rb", "app/helpers/flashes_helper.rb"
end