Class: Ixtlan::Generators::ErrorDumpsBase

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/ixtlan/error_dumps_base.rb

Direct Known Subclasses

ErrorDumpsScaffoldGenerator

Instance Method Summary collapse

Methods inherited from Base

#create_initializer_file

Instance Method Details

#add_gemObject



23
24
25
# File 'lib/generators/ixtlan/error_dumps_base.rb', line 23

def add_gem
  gem 'ixtlan-error-handler' unless File.read('Gemfile') =~ /gem\s['"]ixtlan-error-handler['"]/
end

#createObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/generators/ixtlan/error_dumps_base.rb', line 6

def create
  args = []
  if name
    args << ARGV.shift
  else
    args << "error"
  end

  args += ['message:string', 'request:text', 'response:text', 'session:text', 'parameters:text', 'clazz:string', 'backtrace:text']
  args += ARGV
  
  args << "--read-only"
  args << "--timestamps"

  generate generator_name, *args
end