Class: TitleistGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/titleist/titleist_generator.rb

Overview

typed: strict Generate initial files for the gem to work.

Instance Method Summary collapse

Instance Method Details

#copy_localenil

Returns:

  • (nil)


7
8
9
# File 'lib/generators/titleist/titleist_generator.rb', line 7

def copy_locale
  template 'locale.yml.erb', 'config/locales/titleist.en.yml'
end

#update_default_application_layoutnil

Returns:

  • (nil)


12
13
14
15
16
17
18
# File 'lib/generators/titleist/titleist_generator.rb', line 12

def update_default_application_layout
  gsub_file(
    'app/views/layouts/application.html.erb',
    %r{\s\s\s\s<title>(.*)</title>},
    '    <%= title_tag %>'
  )
end