Sha256: df52117efd853ff346200454b47311a2375dd3849698c30c9f2c737033fa07ac

Contents?: true

Size: 653 Bytes

Versions: 2

Compression:

Stored size: 653 Bytes

Contents

require 'rails/generators/base'
module Ixtlan
  module Generators
    class AuditBase < Rails::Generators::Base

      argument :name, :type => :string, :required => false
      
      protected
      def generator_name
        raise "please overwrite generator_name"
      end
      
      public
      def create
        args = []
        if name
          args << ARGV.shift
        else
          args << "audit"
        end
        
        args << "created_at:datetime"
        args << "login:string"
        args << "message:string"
        args += ARGV[0, 10000] || []
        
        generate generator_name, *args
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ixtlan-audit-0.1.1 lib/generators/ixtlan/audit_base.rb
ixtlan-audit-0.1.0 lib/generators/ixtlan/audit_base.rb