Class: TitleistGenerator

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

Overview

Generate initial files for the gem to work.

Instance Method Summary collapse

Instance Method Details

#copy_localeObject



5
6
7
# File 'lib/generators/titleist/titleist_generator.rb', line 5

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

#update_default_application_layoutObject



9
10
11
12
13
14
15
# File 'lib/generators/titleist/titleist_generator.rb', line 9

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