Sha256: 4fe4d49fb258eb58ca6f39c3a5eed6b67c7e134d531172be9a62c7b4456822c4

Contents?: true

Size: 521 Bytes

Versions: 13

Compression:

Stored size: 521 Bytes

Contents

module Bot
  module Generators
    class ResponderGenerator < Rails::Generators::NamedBase
      desc "This generator creates a blank responder in bot/responders"

      def create_responder
        create_file "app/bot/responders/#{file_name}.rb", <<-FILE
module Responders
  class #{class_name} < ApplicationResponder
    #
    # def can_handle?
    #   true
    # end
    #
    # def handle
    #   text_response('Hello!')
    # end
    #
  end
end
    FILE
      end

      hook_for :test_framework
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bot-0.0.46 lib/generators/bot/responder/responder_generator.rb
bot-0.0.45 lib/generators/bot/responder/responder_generator.rb
bot-0.0.44 lib/generators/bot/responder/responder_generator.rb
bot-0.0.43 lib/generators/bot/responder/responder_generator.rb
bot-0.0.42 lib/generators/bot/responder/responder_generator.rb
bot-0.0.41 lib/generators/bot/responder/responder_generator.rb
bot-0.0.40 lib/generators/bot/responder/responder_generator.rb
bot-0.0.39 lib/generators/bot/responder/responder_generator.rb
bot-0.0.38 lib/generators/bot/responder/responder_generator.rb
bot-0.0.37 lib/generators/bot/responder/responder_generator.rb
bot-0.0.35 lib/generators/bot/responder/responder_generator.rb
bot-0.0.34 lib/generators/bot/responder/responder_generator.rb
bot-0.0.33 lib/generators/bot/responder/responder_generator.rb