Class: ExportrGenerator

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

Instance Method Summary collapse

Instance Method Details

#generate_initializerObject



5
6
7
# File 'lib/generators/exportr/exportr_generator.rb', line 5

def generate_initializer
  copy_file 'exportr.yml', 'config/exportr.yml'
end

#mod_gitignoreObject



9
10
11
12
13
14
15
16
17
# File 'lib/generators/exportr/exportr_generator.rb', line 9

def mod_gitignore
  return if File.read("#{Rails.root}/.gitignore").match(/config\/exportr.yml/)
  File.open("#{Rails.root}/.gitignore", 'a+') do |f|
    f.puts 
    f.puts '# Ignoring local env export'
    f.puts 'config/exportr.yml'
    f.puts 
  end
end