Sha256: 32f26d0d6b3f5772fa4d1d4f8df9ae79ba5b56200e58cdbd8bdcef86d426eaf5

Contents?: true

Size: 421 Bytes

Versions: 2

Compression:

Stored size: 421 Bytes

Contents

require_relative '../generic_generator'

module SteelWheel
  class CommandGenerator < GenericGenerator
    setup_templates_root('query/templates')

    on_revoke do
      template 'query_template.rb', "app/queries/#{file_path}_query.rb"
    end

    on_invoke do
      empty_directory Pathname.new('app/queries').join(*class_path)
      template 'query_template.rb', "app/queries/#{file_path}_query.rb"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
steel_wheel-0.5.1 lib/generators/steel_wheel/query/query_generator.rb
steel_wheel-0.5.0 lib/generators/steel_wheel/query/query_generator.rb