Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- application error
- NoMethodError at /
- undefined method `[]' for nil:NilClass
- file: index.erb
- location: evaluate_source
- line: 68
- BACKTRACE
- (condense)
- JUMP TO: GET POST COOKIES ENV
- /usr/share/opennebula/sunstone/views/index.erb in evaluate_source
- 61. };
- 62.
- 63.
- 64. </script>
- 65. <script src="js/plugins/config-tab.js" type="text/javascript"></script>
- 66.
- 67. <!-- enabled tabs: -->
- 68. <%- view['enabled_tabs'].each do |tab_name| -%>
- 69. <script src="js/plugins/<%= tab_name %>.js" type="text/javascript"></script>
- 70. <%- end -%>
- 71. <!-- end tabs -->
- 72.
- 73. </head>
- 74. <body>
- 75. <div class="outer-center" id="tabs_content">
- /usr/lib/ruby/vendor_ruby/tilt/template.rb in cached_evaluate
- 137. # Redefine itself to use method compilation the next time:
- 138. def self.cached_evaluate(scope, locals, &block)
- 139. method = compiled_method(locals.keys)
- 140. method.bind(scope).call(locals, &block)
- 141. end
- 142.
- 143. # Use instance_eval the first time:
- 144. evaluate_source(scope, locals, &block)
- 145. end
- 146.
- 147. # Generates all template source by combining the preamble, template, and
- 148. # postamble and returns a two-tuple of the form: [source, offset], where
- 149. # source is the string containing (Ruby) source code for the template and
- 150. # offset is the integer line offset where line reporting should begin.
- 151. #
- /usr/lib/ruby/vendor_ruby/tilt/template.rb in evaluate
- 120. compile!
- 121. else
- 122. raise NotImplementedError
- 123. end
- 124. end
- 125.
- 126. def evaluate(scope, locals, &block)
- 127. cached_evaluate(scope, locals, &block)
- 128. end
- 129.
- 130. # Process the template and return the result. The first time this
- 131. # method is called, the template source is evaluated with instance_eval.
- 132. # On the sequential method calls it will compile the template to an
- 133. # unbound method which will lead to better performance. In any case,
- 134. # template executation is guaranteed to be performed in the scope object
- /usr/lib/ruby/vendor_ruby/tilt/template.rb in render
- 69. prepare
- 70. end
- 71.
- 72. # Render the template in the given scope with the locals specified. If a
- 73. # block is given, it is typically available within the template via
- 74. # +yield+.
- 75. def render(scope=Object.new, locals={}, &block)
- 76. evaluate scope, locals || {}, &block
- 77. end
- 78.
- 79. # The basename of the template file.
- 80. def basename(suffix='')
- 81. File.basename(file, suffix) if file
- 82. end
- 83.
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in render
- 556. layout_engine = options.delete(:layout_engine) || engine
- 557. scope = options.delete(:scope) || self
- 558.
- 559. # compile and render template
- 560. layout_was = @default_layout
- 561. @default_layout = false
- 562. template = compile_template(engine, data, options, views)
- 563. output = template.render(scope, locals, &block)
- 564. @default_layout = layout_was
- 565.
- 566. # render layout
- 567. if layout
- 568. options = options.merge(:views => views, :layout => false, :eat_errors => eat_errors, :scope => scope)
- 569. catch(:layout_missing) { return render(layout_engine, layout, options, locals) { output } }
- 570. end
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in erb
- 448. # :views Views directory to use.
- 449. module Templates
- 450. module ContentTyped
- 451. attr_accessor :content_type
- 452. end
- 453.
- 454. def erb(template, options={}, locals={})
- 455. render :erb, template, options, locals
- 456. end
- 457.
- 458. def erubis(template, options={}, locals={})
- 459. render :erubis, template, options, locals
- 460. end
- 461.
- 462. def haml(template, options={}, locals={})
- /usr/share/opennebula/sunstone/sunstone-server.rb in GET /
- 255. response.set_cookie("one-user_id",
- 256. :value=>"#{session[:user_id]}",
- 257. :expires=>time)
- 258. response.set_cookie("one-user_gid",
- 259. :value=>"#{session[:user_gid]}",
- 260. :expires=>time)
- 261.
- 262. erb :index
- 263. end
- 264.
- 265. get '/login' do
- 266. content_type 'text/html', :charset => 'utf-8'
- 267. if !authorized?
- 268. erb :login
- 269. end
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in call
- 1144. define_method(method_name, &block)
- 1145. unbound_method = instance_method method_name
- 1146. pattern, keys = compile(path)
- 1147. conditions, @conditions = @conditions, []
- 1148. remove_method method_name
- 1149.
- 1150. [ block.arity != 0 ?
- 1151. proc { unbound_method.bind(self).call(*@block_params) } :
- 1152. proc { unbound_method.bind(self).call },
- 1153. pattern, keys, conditions ]
- 1154. end
- 1155.
- 1156. def compile(path)
- 1157. keys = []
- 1158. if path.respond_to? :to_str
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in compile!
- 1144. define_method(method_name, &block)
- 1145. unbound_method = instance_method method_name
- 1146. pattern, keys = compile(path)
- 1147. conditions, @conditions = @conditions, []
- 1148. remove_method method_name
- 1149.
- 1150. [ block.arity != 0 ?
- 1151. proc { unbound_method.bind(self).call(*@block_params) } :
- 1152. proc { unbound_method.bind(self).call },
- 1153. pattern, keys, conditions ]
- 1154. end
- 1155.
- 1156. def compile(path)
- 1157. keys = []
- 1158. if path.respond_to? :to_str
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in instance_eval
- 717.
- 718. route_eval(&pass_block) if pass_block
- 719. route_missing
- 720. end
- 721.
- 722. # Run a route block and throw :halt with the result.
- 723. def route_eval(&block)
- 724. throw :halt, instance_eval(&block)
- 725. end
- 726.
- 727. # If the current request matches pattern and conditions, fill params
- 728. # with keys and call the given block.
- 729. # Revert params afterwards.
- 730. #
- 731. # Returns pass block.
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in route_eval
- 717.
- 718. route_eval(&pass_block) if pass_block
- 719. route_missing
- 720. end
- 721.
- 722. # Run a route block and throw :halt with the result.
- 723. def route_eval(&block)
- 724. throw :halt, instance_eval(&block)
- 725. end
- 726.
- 727. # If the current request matches pattern and conditions, fill params
- 728. # with keys and call the given block.
- 729. # Revert params afterwards.
- 730. #
- 731. # Returns pass block.
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in route!
- 701. end
- 702.
- 703. # Run routes defined on the class and all superclasses.
- 704. def route!(base = settings, pass_block=nil)
- 705. if routes = base.routes[@request.request_method]
- 706. routes.each do |pattern, keys, conditions, block|
- 707. pass_block = process_route(pattern, keys, conditions) do
- 708. route_eval(&block)
- 709. end
- 710. end
- 711. end
- 712.
- 713. # Run routes defined in superclass.
- 714. if base.superclass.respond_to?(:routes)
- 715. return route!(base.superclass, pass_block)
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in process_route
- 751. {}
- 752. end
- 753. @params = @original_params.merge(params)
- 754. @block_params = values
- 755. catch(:pass) do
- 756. conditions.each { |cond|
- 757. throw :pass if instance_eval(&cond) == false }
- 758. yield
- 759. end
- 760. end
- 761. ensure
- 762. @params = @original_params
- 763. end
- 764.
- 765. # No matching route was found or all routes passed. The default
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in catch
- 748. elsif values.any?
- 749. {'captures' => values}
- 750. else
- 751. {}
- 752. end
- 753. @params = @original_params.merge(params)
- 754. @block_params = values
- 755. catch(:pass) do
- 756. conditions.each { |cond|
- 757. throw :pass if instance_eval(&cond) == false }
- 758. yield
- 759. end
- 760. end
- 761. ensure
- 762. @params = @original_params
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in process_route
- 748. elsif values.any?
- 749. {'captures' => values}
- 750. else
- 751. {}
- 752. end
- 753. @params = @original_params.merge(params)
- 754. @block_params = values
- 755. catch(:pass) do
- 756. conditions.each { |cond|
- 757. throw :pass if instance_eval(&cond) == false }
- 758. yield
- 759. end
- 760. end
- 761. ensure
- 762. @params = @original_params
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in route!
- 700. base.filters[type].each { |block| instance_eval(&block) }
- 701. end
- 702.
- 703. # Run routes defined on the class and all superclasses.
- 704. def route!(base = settings, pass_block=nil)
- 705. if routes = base.routes[@request.request_method]
- 706. routes.each do |pattern, keys, conditions, block|
- 707. pass_block = process_route(pattern, keys, conditions) do
- 708. route_eval(&block)
- 709. end
- 710. end
- 711. end
- 712.
- 713. # Run routes defined in superclass.
- 714. if base.superclass.respond_to?(:routes)
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in each
- 699. filter! type, base.superclass if base.superclass.respond_to?(:filters)
- 700. base.filters[type].each { |block| instance_eval(&block) }
- 701. end
- 702.
- 703. # Run routes defined on the class and all superclasses.
- 704. def route!(base = settings, pass_block=nil)
- 705. if routes = base.routes[@request.request_method]
- 706. routes.each do |pattern, keys, conditions, block|
- 707. pass_block = process_route(pattern, keys, conditions) do
- 708. route_eval(&block)
- 709. end
- 710. end
- 711. end
- 712.
- 713. # Run routes defined in superclass.
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in route!
- 699. filter! type, base.superclass if base.superclass.respond_to?(:filters)
- 700. base.filters[type].each { |block| instance_eval(&block) }
- 701. end
- 702.
- 703. # Run routes defined on the class and all superclasses.
- 704. def route!(base = settings, pass_block=nil)
- 705. if routes = base.routes[@request.request_method]
- 706. routes.each do |pattern, keys, conditions, block|
- 707. pass_block = process_route(pattern, keys, conditions) do
- 708. route_eval(&block)
- 709. end
- 710. end
- 711. end
- 712.
- 713. # Run routes defined in superclass.
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in dispatch!
- 836. res
- 837. end
- 838.
- 839. # Dispatch a request with error handling.
- 840. def dispatch!
- 841. static! if settings.static? && (request.get? || request.head?)
- 842. filter! :before
- 843. route!
- 844. rescue NotFound => boom
- 845. handle_not_found!(boom)
- 846. rescue ::Exception => boom
- 847. handle_exception!(boom)
- 848. ensure
- 849. filter! :after unless env['sinatra.static_file']
- 850. end
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in call!
- 637. @response = Response.new
- 638. @params = indifferent_params(@request.params)
- 639. template_cache.clear if settings.reload_templates
- 640. force_encoding(@request.route)
- 641. force_encoding(@params)
- 642.
- 643. @response['Content-Type'] = nil
- 644. invoke { dispatch! }
- 645. invoke { error_block!(response.status) }
- 646. unless @response['Content-Type']
- 647. if body.respond_to?(:to_ary) and body.first.respond_to? :content_type
- 648. content_type body.first.content_type
- 649. else
- 650. content_type :html
- 651. end
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in instance_eval
- 801. # Creates a Hash with indifferent access.
- 802. def indifferent_hash
- 803. Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
- 804. end
- 805.
- 806. # Run the block with 'throw :halt' support and apply result to the response.
- 807. def invoke(&block)
- 808. res = catch(:halt) { instance_eval(&block) }
- 809. return if res.nil?
- 810.
- 811. case
- 812. when res.respond_to?(:to_str)
- 813. @response.body = [res]
- 814. when res.respond_to?(:to_ary)
- 815. res = res.to_ary
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in invoke
- 801. # Creates a Hash with indifferent access.
- 802. def indifferent_hash
- 803. Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
- 804. end
- 805.
- 806. # Run the block with 'throw :halt' support and apply result to the response.
- 807. def invoke(&block)
- 808. res = catch(:halt) { instance_eval(&block) }
- 809. return if res.nil?
- 810.
- 811. case
- 812. when res.respond_to?(:to_str)
- 813. @response.body = [res]
- 814. when res.respond_to?(:to_ary)
- 815. res = res.to_ary
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in catch
- 801. # Creates a Hash with indifferent access.
- 802. def indifferent_hash
- 803. Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
- 804. end
- 805.
- 806. # Run the block with 'throw :halt' support and apply result to the response.
- 807. def invoke(&block)
- 808. res = catch(:halt) { instance_eval(&block) }
- 809. return if res.nil?
- 810.
- 811. case
- 812. when res.respond_to?(:to_str)
- 813. @response.body = [res]
- 814. when res.respond_to?(:to_ary)
- 815. res = res.to_ary
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in invoke
- 801. # Creates a Hash with indifferent access.
- 802. def indifferent_hash
- 803. Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
- 804. end
- 805.
- 806. # Run the block with 'throw :halt' support and apply result to the response.
- 807. def invoke(&block)
- 808. res = catch(:halt) { instance_eval(&block) }
- 809. return if res.nil?
- 810.
- 811. case
- 812. when res.respond_to?(:to_str)
- 813. @response.body = [res]
- 814. when res.respond_to?(:to_ary)
- 815. res = res.to_ary
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in call!
- 637. @response = Response.new
- 638. @params = indifferent_params(@request.params)
- 639. template_cache.clear if settings.reload_templates
- 640. force_encoding(@request.route)
- 641. force_encoding(@params)
- 642.
- 643. @response['Content-Type'] = nil
- 644. invoke { dispatch! }
- 645. invoke { error_block!(response.status) }
- 646. unless @response['Content-Type']
- 647. if body.respond_to?(:to_ary) and body.first.respond_to? :content_type
- 648. content_type body.first.content_type
- 649. else
- 650. content_type :html
- 651. end
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in call
- 622. @app = app
- 623. @template_cache = Tilt::Cache.new
- 624. yield self if block_given?
- 625. end
- 626.
- 627. # Rack call interface.
- 628. def call(env)
- 629. dup.call!(env)
- 630. end
- 631.
- 632. attr_accessor :env, :request, :response, :params
- 633.
- 634. def call!(env) # :nodoc:
- 635. @env = env
- 636. @request = Request.new(env)
- /usr/lib/ruby/vendor_ruby/rack/commonlogger.rb in call
- 13. def initialize(app, logger=nil)
- 14. @app = app
- 15. @logger = logger
- 16. end
- 17.
- 18. def call(env)
- 19. began_at = Time.now
- 20. status, header, body = @app.call(env)
- 21. header = Utils::HeaderHash.new(header)
- 22. body = BodyProxy.new(body) { log(env, status, header, began_at) }
- 23. [status, header, body]
- 24. end
- 25.
- 26. private
- 27.
- /usr/lib/ruby/vendor_ruby/rack/session/abstract/id.rb in context
- 188.
- 189. def call(env)
- 190. context(env)
- 191. end
- 192.
- 193. def context(env, app=@app)
- 194. prepare_session(env)
- 195. status, headers, body = app.call(env)
- 196. commit_session(env, status, headers, body)
- 197. end
- 198.
- 199. private
- 200.
- 201. def initialize_sid
- 202. @sidbits = @default_options[:sidbits]
- /usr/lib/ruby/vendor_ruby/rack/session/abstract/id.rb in call
- 183. @default_options = self.class::DEFAULT_OPTIONS.merge(options)
- 184. @key = options[:key] || "rack.session"
- 185. @cookie_only = @default_options.delete(:cookie_only)
- 186. initialize_sid
- 187. end
- 188.
- 189. def call(env)
- 190. context(env)
- 191. end
- 192.
- 193. def context(env, app=@app)
- 194. prepare_session(env)
- 195. status, headers, body = app.call(env)
- 196. commit_session(env, status, headers, body)
- 197. end
- /usr/lib/ruby/vendor_ruby/rack/head.rb in call
- 2.
- 3. class Head
- 4. def initialize(app)
- 5. @app = app
- 6. end
- 7.
- 8. def call(env)
- 9. status, headers, body = @app.call(env)
- 10.
- 11. if env["REQUEST_METHOD"] == "HEAD"
- 12. [status, headers, []]
- 13. else
- 14. [status, headers, body]
- 15. end
- 16. end
- /usr/lib/ruby/vendor_ruby/sinatra/showexceptions.rb in call
- 14.
- 15. def initialize(app)
- 16. @app = app
- 17. @template = ERB.new(TEMPLATE)
- 18. end
- 19.
- 20. def call(env)
- 21. @app.call(env)
- 22. rescue Exception => e
- 23. errors, env["rack.errors"] = env["rack.errors"], @@eats_errors
- 24.
- 25. if respond_to?(:prefers_plain_text?) and prefers_plain_text?(env)
- 26. content_type = "text/plain"
- 27. body = [dump_exception(e)]
- 28. else
- /usr/lib/ruby/vendor_ruby/rack/methodoverride.rb in call
- 17. method = method.to_s.upcase
- 18. if HTTP_METHODS.include?(method)
- 19. env["rack.methodoverride.original_method"] = env["REQUEST_METHOD"]
- 20. env["REQUEST_METHOD"] = method
- 21. end
- 22. end
- 23.
- 24. @app.call(env)
- 25. end
- 26. end
- 27. end
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in call
- 1265. setup_sessions builder
- 1266. middleware.each { |c,a,b| builder.use(c, *a, &b) }
- 1267. builder.run new!(*args, &bk)
- 1268. builder
- 1269. end
- 1270.
- 1271. def call(env)
- 1272. synchronize { prototype.call(env) }
- 1273. end
- 1274.
- 1275. private
- 1276. def setup_sessions(builder)
- 1277. return unless sessions?
- 1278. builder.use Rack::Session::Cookie, :secret => session_secret
- 1279. end
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in synchronize
- 1296. end
- 1297.
- 1298. @@mutex = Mutex.new
- 1299. def synchronize(&block)
- 1300. if lock?
- 1301. @@mutex.synchronize(&block)
- 1302. else
- 1303. yield
- 1304. end
- 1305. end
- 1306.
- 1307. def metadef(message, &block)
- 1308. (class << self; self; end).
- 1309. send :define_method, message, &block
- 1310. end
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in call
- 1265. setup_sessions builder
- 1266. middleware.each { |c,a,b| builder.use(c, *a, &b) }
- 1267. builder.run new!(*args, &bk)
- 1268. builder
- 1269. end
- 1270.
- 1271. def call(env)
- 1272. synchronize { prototype.call(env) }
- 1273. end
- 1274.
- 1275. private
- 1276. def setup_sessions(builder)
- 1277. return unless sessions?
- 1278. builder.use Rack::Session::Cookie, :secret => session_secret
- 1279. end
- /usr/lib/ruby/vendor_ruby/thin/connection.rb in pre_process
- 73.
- 74. # When we're under a non-async framework like rails, we can still spawn
- 75. # off async responses using the callback info, so there's little point
- 76. # in removing this.
- 77. response = AsyncResponse
- 78. catch(:async) do
- 79. # Process the request calling the Rack adapter
- 80. response = @app.call(@request.env)
- 81. end
- 82. response
- 83. rescue Exception
- 84. handle_error
- 85. terminate_request
- 86. nil # Signal to post_process that the request could not be processed
- 87. end
- /usr/lib/ruby/vendor_ruby/thin/connection.rb in catch
- 71. end
- 72. end
- 73.
- 74. # When we're under a non-async framework like rails, we can still spawn
- 75. # off async responses using the callback info, so there's little point
- 76. # in removing this.
- 77. response = AsyncResponse
- 78. catch(:async) do
- 79. # Process the request calling the Rack adapter
- 80. response = @app.call(@request.env)
- 81. end
- 82. response
- 83. rescue Exception
- 84. handle_error
- 85. terminate_request
- /usr/lib/ruby/vendor_ruby/thin/connection.rb in pre_process
- 71. end
- 72. end
- 73.
- 74. # When we're under a non-async framework like rails, we can still spawn
- 75. # off async responses using the callback info, so there's little point
- 76. # in removing this.
- 77. response = AsyncResponse
- 78. catch(:async) do
- 79. # Process the request calling the Rack adapter
- 80. response = @app.call(@request.env)
- 81. end
- 82. response
- 83. rescue Exception
- 84. handle_error
- 85. terminate_request
- /usr/lib/ruby/vendor_ruby/thin/connection.rb in process
- 46. # is ready to be processed.
- 47. def process
- 48. if threaded?
- 49. @request.threaded = true
- 50. EventMachine.defer(method(:pre_process), method(:post_process))
- 51. else
- 52. @request.threaded = false
- 53. post_process(pre_process)
- 54. end
- 55. end
- 56.
- 57. def pre_process
- 58. # Add client info to the request env
- 59. @request.remote_address = remote_address
- 60.
- /usr/lib/ruby/vendor_ruby/thin/connection.rb in receive_data
- 31. @request = Request.new
- 32. @response = Response.new
- 33. end
- 34.
- 35. # Called when data is received from the client.
- 36. def receive_data(data)
- 37. trace { data }
- 38. process if @request.parse(data)
- 39. rescue InvalidRequest => e
- 40. log "!! Invalid request"
- 41. log_error e
- 42. close_connection
- 43. end
- 44.
- 45. # Called when all data was received and the request
- /usr/lib/ruby/vendor_ruby/eventmachine.rb in run_machine
- 250. @reactor_running = true
- 251. initialize_event_machine
- 252. (b = blk || block) and add_timer(0, b)
- 253. if @next_tick_queue && !@next_tick_queue.empty?
- 254. add_timer(0) { signal_loopbreak }
- 255. end
- 256. @reactor_thread = Thread.current
- 257. run_machine
- 258. ensure
- 259. until @tails.empty?
- 260. @tails.pop.call
- 261. end
- 262.
- 263. begin
- 264. release_machine
- /usr/lib/ruby/vendor_ruby/eventmachine.rb in run
- 250. @reactor_running = true
- 251. initialize_event_machine
- 252. (b = blk || block) and add_timer(0, b)
- 253. if @next_tick_queue && !@next_tick_queue.empty?
- 254. add_timer(0) { signal_loopbreak }
- 255. end
- 256. @reactor_thread = Thread.current
- 257. run_machine
- 258. ensure
- 259. until @tails.empty?
- 260. @tails.pop.call
- 261. end
- 262.
- 263. begin
- 264. release_machine
- /usr/lib/ruby/vendor_ruby/thin/backends/base.rb in start
- 54. @running = true
- 55. end
- 56.
- 57. # Allow for early run up of eventmachine.
- 58. if EventMachine.reactor_running?
- 59. starter.call
- 60. else
- 61. EventMachine.run(&starter)
- 62. end
- 63. end
- 64.
- 65. # Stop of the backend from accepting new connections.
- 66. def stop
- 67. @running = false
- 68. @stopping = true
- /usr/lib/ruby/vendor_ruby/thin/server.rb in start
- 152. log ">> Thin web server (v#{VERSION::STRING} codename #{VERSION::CODENAME})"
- 153. debug ">> Debugging ON"
- 154. trace ">> Tracing ON"
- 155.
- 156. log ">> Maximum connections set to #{@backend.maximum_connections}"
- 157. log ">> Listening on #{@backend}, CTRL+C to stop"
- 158.
- 159. @backend.start
- 160. end
- 161. alias :start! :start
- 162.
- 163. # == Gracefull shutdown
- 164. # Stops the server after processing all current connections.
- 165. # As soon as this method is called, the server stops accepting
- 166. # new requests and wait for all current connections to finish.
- /usr/lib/ruby/vendor_ruby/rack/handler/thin.rb in run
- 6. module Handler
- 7. class Thin
- 8. def self.run(app, options={})
- 9. server = ::Thin::Server.new(options[:Host] || '0.0.0.0',
- 10. options[:Port] || 8080,
- 11. app)
- 12. yield server if block_given?
- 13. server.start
- 14. end
- 15.
- 16. def self.valid_options
- 17. {
- 18. "Host=HOST" => "Hostname to listen on (default: localhost)",
- 19. "Port=PORT" => "Port to listen on (default: 8080)",
- 20. }
- /usr/lib/ruby/vendor_ruby/sinatra/base.rb in run!
- 1227. # Thin, Mongrel or WEBrick (in that order)
- 1228. def run!(options={})
- 1229. set options
- 1230. handler = detect_rack_handler
- 1231. handler_name = handler.name.gsub(/.*::/, '')
- 1232. puts "== Sinatra/#{Sinatra::VERSION} has taken the stage " +
- 1233. "on #{port} for #{environment} with backup from #{handler_name}" unless handler_name =~/cgi/i
- 1234. handler.run self, :Host => bind, :Port => port do |server|
- 1235. [:INT, :TERM].each { |sig| trap(sig) { quit!(server, handler_name) } }
- 1236. set :running, true
- 1237. end
- 1238. rescue Errno::EADDRINUSE => e
- 1239. puts "== Someone is already performing on port #{port}!"
- 1240. end
- 1241.
- /usr/share/opennebula/sunstone/sunstone-server.rb in nil
- 430. ##############################################################################
- 431. post '/:resource/:id/action' do
- 432. @SunstoneServer.perform_action(params[:resource],
- 433. params[:id],
- 434. request.body.read)
- 435. end
- 436.
- 437. Sinatra::Application.run! if(!defined?(WITH_RACKUP))
- 438.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement