CHips L MINI SHELL

CHips L pro

Current Path : /opt/puppetlabs/puppet/lib/ruby/vendor_gems/gems/locale-2.1.3/samples/rack/
Upload File :
Current File : //opt/puppetlabs/puppet/lib/ruby/vendor_gems/gems/locale-2.1.3/samples/rack/hello_rack.rb

require 'rubygems'
require 'rack'
require 'locale_rack'
 
class HelloRackApp
  include Locale::Rack

  def call(env)
    req = Rack::Request.new(env)
    init_locale(env, req)
    str = "Language tag candidates of your request order by the priority:\n\n"
    str += Locale.candidates(:type => :rfc).map{|v| v.inspect + "\n"}.join
    [200, {"Content-Type" => "text/plain", "Content-Length" => str.length.to_s}, [str]]
  end
end


Copyright 2K16 - 2K18 Indonesian Hacker Rulez