Class: Ixtlan::Generators::AuditBase

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

Direct Known Subclasses

AuditScaffoldGenerator

Instance Method Summary collapse

Methods inherited from Base

#create_initializer_file

Instance Method Details

#add_gemObject



22
23
24
# File 'lib/generators/ixtlan/audit_base.rb', line 22

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

#createObject



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

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

  args += ['login:string', 'message:string']
  args += ARGV
  
  args += ["--read-only", "--timestamps"]

  generate generator_name, *args
end