Sha256: e1395b422dab583fa74b244b157a2706ed5b6d6c0952106fc9918c44fa282010

Contents?: true

Size: 559 Bytes

Versions: 10

Compression:

Stored size: 559 Bytes

Contents

module Rack::PerftoolsProfiler

  class ProfileDataAction < Action
    
    def check_printer_arg
      request = Rack::Request.new(@env)
      printer = request.params['printer']
      self.class.check_printer(printer, @env)
    end

    def self.check_printer(printer, env=nil)
      if printer != nil && !ProfilerMiddleware::PRINTERS.member?(printer.to_sym)
        message = "Invalid printer type: #{printer}. Valid printer values are #{ProfilerMiddleware::PRINTERS.join(", ")}" 
        raise ProfilerArgumentError, message
      end
    end

  end

end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rack-perftools_profiler-0.4.0 lib/rack/perftools_profiler/profile_data_action.rb
rack-perftools_profiler-0.3.0 lib/rack/perftools_profiler/profile_data_action.rb
rack-perftools_profiler-0.2.1 lib/rack/perftools_profiler/profile_data_action.rb
rack-perftools_profiler-0.2.0 lib/rack/perftools_profiler/profile_data_action.rb
rack-perftools_profiler-0.1.1 lib/rack/perftools_profiler/profile_data_action.rb
rack-perftools_profiler-0.1.0 lib/rack/perftools_profiler/profile_data_action.rb
aleksi-rack-perftools_profiler-0.0.4 lib/rack/perftools_profiler/profile_data_action.rb
aleksi-rack-perftools_profiler-0.0.3 lib/rack/perftools_profiler/profile_data_action.rb
rack-perftools_profiler-0.0.2 lib/rack/perftools_profiler/profile_data_action.rb
rack-perftools_profiler-0.0.1 lib/rack/perftools_profiler/profile_data_action.rb