Sha256: e6fe2204b03dfdc32b101865657feb280217f0bdb79fd0ab65d2c528d3721fc7

Contents?: true

Size: 798 Bytes

Versions: 11

Compression:

Stored size: 798 Bytes

Contents

# encoding: utf-8
module TestServer
  class StringController < ApplicationController
    def index
      add_breadcrumb I18n.t('views.root.link'), :root_path
      add_breadcrumb I18n.t('views.string.link'), :string_path
    end

    def plain
      render text: encode(params) { generate_string(params[:count]) }
    end

    def eicar
      render text: encode(params) { generate_eicar.join }
    end

    def sleep
      Kernel.sleep params[:count].to_i

      render text: encode(params) { generate_string(1) }
    end

    def random
      render text: encode(params) { generate_random_string(params[:count]) }
    end

    private

    def default_roles
      [:encodable, :cachable, :countable]
    end

    def default_params
      {
        count: 1,
      }.merge super
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
test_server-0.5.2 app/controllers/test_server/string_controller.rb
test_server-0.5.1 app/controllers/test_server/string_controller.rb
test_server-0.5.0 app/controllers/test_server/string_controller.rb
test_server-0.4.1 app/controllers/test_server/string_controller.rb
test_server-0.4.0 app/controllers/test_server/string_controller.rb
test_server-0.3.7 app/controllers/test_server/string_controller.rb
test_server-0.3.6 app/controllers/test_server/string_controller.rb
test_server-0.3.5 app/controllers/test_server/string_controller.rb
test_server-0.3.4 app/controllers/test_server/string_controller.rb
test_server-0.3.2 app/controllers/test_server/string_controller.rb
test_server-0.3.1 app/controllers/test_server/string_controller.rb