Sha256: 1cc8431b10e864e7a7d66c40ba6e4605c361d7e429e6381cd4dc676cd7bfa3bc

Contents?: true

Size: 489 Bytes

Versions: 13

Compression:

Stored size: 489 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
class Responders::#{class_name} < ApplicationResponder
  #
  # def can_handle?
  #   true
  # end
  #
  # def handle
  #   text_response('Hello!')
  # 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.31 lib/generators/bot/responder/responder_generator.rb
bot-0.0.30 lib/generators/bot/responder/responder_generator.rb
bot-0.0.29 lib/generators/bot/responder/responder_generator.rb
bot-0.0.28 lib/generators/bot/responder/responder_generator.rb
bot-0.0.27 lib/generators/bot/responder/responder_generator.rb
bot-0.0.26 lib/generators/bot/responder/responder_generator.rb
bot-0.0.23 lib/generators/bot/responder/responder_generator.rb
bot-0.0.22 lib/generators/bot/responder/responder_generator.rb
bot-0.0.20 lib/generators/bot/responder/responder_generator.rb
bot-0.0.19 lib/generators/bot/responder/responder_generator.rb
bot-0.0.18 lib/generators/bot/responder/responder_generator.rb
bot-0.0.17 lib/generators/bot/responder/responder_generator.rb
bot-0.0.16 lib/generators/bot/responder/responder_generator.rb