Created
August 6, 2010 01:34
-
-
Save drusellers/510682 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /home/drusellers/dev/gemcutter/app/models/download.rb in most_downloaded_today | |
# | |
20. | |
21. def self.for(what) | |
22. $redis[key(what)].to_i | |
23. end | |
24. | |
25. def self.most_downloaded_today | |
26. items = $redis.zrevrange(TODAY_KEY, 0, 4, :with_scores => true) | |
27. items.in_groups_of(2).collect do |full_name, downloads| | |
28. version = Version.find_by_full_name(full_name) | |
29. | |
30. [version, downloads.to_i] | |
31. end | |
32. end | |
33. | |
34. def self.key(what) | |
# /home/drusellers/dev/gemcutter/app/controllers/home_controller.rb in index | |
# | |
1. class HomeController < ApplicationController | |
2. def index | |
3. @rubygems_count = Rubygem.total_count | |
4. @downloads_count = Download.count | |
5. @latest = Rubygem.latest | |
6. @downloaded = Download.most_downloaded_today | |
7. @updated = Version.updated | |
8. end | |
9. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/implicit_render.rb in send_action | |
# | |
1. module ActionController | |
2. module ImplicitRender | |
3. def send_action(*) | |
4. ret = super | |
5. default_render unless response_body | |
6. ret | |
7. end | |
8. | |
9. def default_render | |
10. render | |
11. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/implicit_render.rb in send_action | |
# | |
1. module ActionController | |
2. module ImplicitRender | |
3. def send_action(*) | |
4. ret = super | |
5. default_render unless response_body | |
6. ret | |
7. end | |
8. | |
9. def default_render | |
10. render | |
11. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/abstract_controller/base.rb in process_action | |
# | |
138. self.class.action_methods.include?(name) | |
139. end | |
140. | |
141. # Call the action. Override this in a subclass to modify the | |
142. # behavior around processing an action. This, and not #process, | |
143. # is the intended way to override action dispatching. | |
144. def process_action(method_name, *args) | |
145. send_action(method_name, *args) | |
146. end | |
147. | |
148. # Actually call the method associated with the action. Override | |
149. # this method if you wish to change how action methods are called, | |
150. # not to add additional behavior around it. For example, you would | |
151. # override #send_action if you want to inject arguments into the | |
152. # method. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/rendering.rb in process_action | |
# | |
4. | |
5. include ActionController::RackDelegation | |
6. include AbstractController::Rendering | |
7. | |
8. # Before processing, set the request formats in current controller formats. | |
9. def process_action(*) #:nodoc: | |
10. self.formats = request.formats.map { |x| x.to_sym } | |
11. super | |
12. end | |
13. | |
14. # Check for double render errors and set the content_type after rendering. | |
15. def render(*args) #:nodoc: | |
16. raise ::AbstractController::DoubleRenderError if response_body | |
17. super | |
18. self.content_type ||= Mime[formats.first].to_s | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/abstract_controller/callbacks.rb in process_action | |
# | |
11. define_callbacks :process_action, :terminator => "response_body" | |
12. end | |
13. | |
14. # Override AbstractController::Base's process_action to run the | |
15. # process_action callbacks around the normal behavior. | |
16. def process_action(method_name) | |
17. run_callbacks(:process_action, method_name) do | |
18. super | |
19. end | |
20. end | |
21. | |
22. module ClassMethods | |
23. # If :only or :except are used, convert the options into the | |
24. # primitive form (:per_key) used by ActiveSupport::Callbacks. | |
25. # The basic idea is that :only => :index gets converted to | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in _run__738958071__process_action__199225275__callbacks | |
# | |
421. # | |
422. def __create_keyed_callback(name, kind, object, &blk) #:nodoc: | |
423. @_keyed_callbacks ||= {} | |
424. @_keyed_callbacks[name] ||= begin | |
425. str = send("_#{kind}_callbacks").compile(name, object) | |
426. class_eval "def #{name}() #{str} end", __FILE__, __LINE__ | |
427. true | |
428. end | |
429. end | |
430. | |
431. # This is used internally to append, prepend and skip callbacks to the | |
432. # CallbackChain. | |
433. # | |
434. def __update_callbacks(name, filters = [], block = nil) #:nodoc: | |
435. send("_update_#{name}_superclass_callbacks") | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in send | |
# | |
401. if key | |
402. name = "_run__\#{self.class.name.hash.abs}__#{symbol}__\#{key.hash.abs}__callbacks" | |
403. | |
404. unless respond_to?(name) | |
405. self.class.__create_keyed_callback(name, :#{symbol}, self, &blk) | |
406. end | |
407. | |
408. send(name, &blk) | |
409. else | |
410. #{body} | |
411. end | |
412. end | |
413. private :_run_#{symbol}_callbacks | |
414. RUBY_EVAL | |
415. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in _run_process_action_callbacks | |
# | |
401. if key | |
402. name = "_run__\#{self.class.name.hash.abs}__#{symbol}__\#{key.hash.abs}__callbacks" | |
403. | |
404. unless respond_to?(name) | |
405. self.class.__create_keyed_callback(name, :#{symbol}, self, &blk) | |
406. end | |
407. | |
408. send(name, &blk) | |
409. else | |
410. #{body} | |
411. end | |
412. end | |
413. private :_run_#{symbol}_callbacks | |
414. RUBY_EVAL | |
415. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in send | |
# | |
81. # - save | |
82. # saved | |
83. # | |
84. module Callbacks | |
85. extend Concern | |
86. | |
87. def run_callbacks(kind, *args, &block) | |
88. send("_run_#{kind}_callbacks", *args, &block) | |
89. end | |
90. | |
91. class Callback | |
92. @@_callback_sequence = 0 | |
93. | |
94. attr_accessor :chain, :filter, :kind, :options, :per_key, :klass, :raw_filter | |
95. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in run_callbacks | |
# | |
81. # - save | |
82. # saved | |
83. # | |
84. module Callbacks | |
85. extend Concern | |
86. | |
87. def run_callbacks(kind, *args, &block) | |
88. send("_run_#{kind}_callbacks", *args, &block) | |
89. end | |
90. | |
91. class Callback | |
92. @@_callback_sequence = 0 | |
93. | |
94. attr_accessor :chain, :filter, :kind, :options, :per_key, :klass, :raw_filter | |
95. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/abstract_controller/callbacks.rb in process_action | |
# | |
10. included do | |
11. define_callbacks :process_action, :terminator => "response_body" | |
12. end | |
13. | |
14. # Override AbstractController::Base's process_action to run the | |
15. # process_action callbacks around the normal behavior. | |
16. def process_action(method_name) | |
17. run_callbacks(:process_action, method_name) do | |
18. super | |
19. end | |
20. end | |
21. | |
22. module ClassMethods | |
23. # If :only or :except are used, convert the options into the | |
24. # primitive form (:per_key) used by ActiveSupport::Callbacks. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb in process_action | |
# | |
22. :method => request.method, | |
23. :path => (request.fullpath rescue "unknown") | |
24. } | |
25. | |
26. ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload.dup) | |
27. | |
28. ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload| | |
29. result = super | |
30. payload[:status] = response.status | |
31. append_info_to_payload(payload) | |
32. result | |
33. end | |
34. end | |
35. | |
36. def render(*args) | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/notifications/instrumenter.rb in instrument | |
# | |
13. | |
14. # Instrument the given block by measuring the time taken to execute it | |
15. # and publish it. Notice that events get sent even if an error occurs | |
16. # in the passed-in block | |
17. def instrument(name, payload={}) | |
18. time = Time.now | |
19. begin | |
20. yield(payload) if block_given? | |
21. rescue Exception => e | |
22. payload[:exception] = [e.class.name, e.message] | |
23. raise e | |
24. ensure | |
25. @notifier.publish(name, time, Time.now, @id, payload) | |
26. end | |
27. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/notifications.rb in __send__ | |
# | |
41. autoload :Instrumenter, 'active_support/notifications/instrumenter' | |
42. autoload :Event, 'active_support/notifications/instrumenter' | |
43. autoload :Fanout, 'active_support/notifications/fanout' | |
44. | |
45. class << self | |
46. attr_writer :notifier | |
47. delegate :publish, :subscribe, :unsubscribe, :to => :notifier | |
48. delegate :instrument, :to => :instrumenter | |
49. | |
50. def notifier | |
51. @notifier ||= Notifier.new | |
52. end | |
53. | |
54. def instrumenter | |
55. Thread.current[:"instrumentation_#{notifier.object_id}"] ||= Instrumenter.new(notifier) | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/notifications.rb in instrument | |
# | |
41. autoload :Instrumenter, 'active_support/notifications/instrumenter' | |
42. autoload :Event, 'active_support/notifications/instrumenter' | |
43. autoload :Fanout, 'active_support/notifications/fanout' | |
44. | |
45. class << self | |
46. attr_writer :notifier | |
47. delegate :publish, :subscribe, :unsubscribe, :to => :notifier | |
48. delegate :instrument, :to => :instrumenter | |
49. | |
50. def notifier | |
51. @notifier ||= Notifier.new | |
52. end | |
53. | |
54. def instrumenter | |
55. Thread.current[:"instrumentation_#{notifier.object_id}"] ||= Instrumenter.new(notifier) | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb in process_action | |
# | |
21. :formats => request.formats.map(&:to_sym), | |
22. :method => request.method, | |
23. :path => (request.fullpath rescue "unknown") | |
24. } | |
25. | |
26. ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload.dup) | |
27. | |
28. ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload| | |
29. result = super | |
30. payload[:status] = response.status | |
31. append_info_to_payload(payload) | |
32. result | |
33. end | |
34. end | |
35. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/rescue.rb in process_action | |
# | |
1. module ActionController #:nodoc: | |
2. module Rescue | |
3. extend ActiveSupport::Concern | |
4. include ActiveSupport::Rescuable | |
5. | |
6. private | |
7. def process_action(*args) | |
8. super | |
9. rescue Exception => exception | |
10. rescue_with_handler(exception) || raise(exception) | |
11. end | |
12. end | |
13. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/abstract_controller/base.rb in process | |
# | |
107. | |
108. unless action_name = method_for_action(action_name) | |
109. raise ActionNotFound, "The action '#{action}' could not be found" | |
110. end | |
111. | |
112. @_response_body = nil | |
113. | |
114. process_action(action_name, *args) | |
115. end | |
116. | |
117. # Delegates to the class' #controller_path | |
118. def controller_path | |
119. self.class.controller_path | |
120. end | |
121. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/abstract_controller/rendering.rb in process | |
# | |
33. extend ActiveSupport::Concern | |
34. | |
35. include AbstractController::ViewPaths | |
36. | |
37. # Overwrite process to setup I18n proxy. | |
38. def process(*) #:nodoc: | |
39. old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context) | |
40. super | |
41. ensure | |
42. I18n.config = old_config | |
43. end | |
44. | |
45. module ClassMethods | |
46. def view_context_class | |
47. @view_context_class ||= begin | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal.rb in dispatch | |
# | |
119. end | |
120. | |
121. # :api: private | |
122. def dispatch(name, request) | |
123. @_request = request | |
124. @_env = request.env | |
125. @_env['action_controller.instance'] = self | |
126. process(name) | |
127. to_a | |
128. end | |
129. | |
130. # :api: private | |
131. def to_a | |
132. response ? response.to_a : [status, headers, response_body] | |
133. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/rack_delegation.rb in dispatch | |
# | |
7. | |
8. delegate :headers, :status=, :location=, :content_type=, | |
9. :status, :location, :content_type, :to => "@_response" | |
10. | |
11. def dispatch(action, request, response = ActionDispatch::Response.new) | |
12. @_response ||= response | |
13. @_response.request ||= request | |
14. super(action, request) | |
15. end | |
16. | |
17. def params | |
18. @_params ||= @_request.parameters | |
19. end | |
20. | |
21. def response_body=(body) | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal.rb in nil | |
# | |
159. # ==== Parameters | |
160. # action<#to_s>:: An action name | |
161. # | |
162. # ==== Returns | |
163. # Proc:: A rack application | |
164. def self.action(name, klass = ActionDispatch::Request) | |
165. middleware_stack.build(name.to_s) do |env| | |
166. new.dispatch(name, klass.new(env)) | |
167. end | |
168. end | |
169. end | |
170. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/routing/route_set.rb in call | |
# | |
20. prepare_params!(params) | |
21. | |
22. # Just raise undefined constant errors if a controller was specified as default. | |
23. unless controller = controller(params, @defaults.key?(:controller)) | |
24. return [404, {'X-Cascade' => 'pass'}, []] | |
25. end | |
26. | |
27. controller.action(params[:action]).call(env) | |
28. end | |
29. | |
30. def prepare_params!(params) | |
31. merge_default_action!(params) | |
32. split_glob_param!(params) if @glob_param | |
33. end | |
34. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/routing/route_set.rb in call | |
# | |
20. prepare_params!(params) | |
21. | |
22. # Just raise undefined constant errors if a controller was specified as default. | |
23. unless controller = controller(params, @defaults.key?(:controller)) | |
24. return [404, {'X-Cascade' => 'pass'}, []] | |
25. end | |
26. | |
27. controller.action(params[:action]).call(env) | |
28. end | |
29. | |
30. def prepare_params!(params) | |
31. merge_default_action!(params) | |
32. split_glob_param!(params) if @glob_param | |
33. end | |
34. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/rack-mount-0.6.9/lib/rack/mount/route_set.rb in call | |
# | |
141. params.each { |k, v| params[k] = Utils.unescape_uri(v) if v.is_a?(String) } | |
142. | |
143. if route.prefix? | |
144. env[Prefix::KEY] = matches[:path_info].to_s | |
145. end | |
146. | |
147. env[@parameters_key] = params | |
148. result = route.app.call(env) | |
149. return result unless result[1][X_CASCADE] == PASS | |
150. end | |
151. | |
152. request || [404, {'Content-Type' => 'text/html', 'X-Cascade' => 'pass'}, ['Not Found']] | |
153. end | |
154. | |
155. # Generates a url from Rack env and identifiers or significant keys. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/rack-mount-0.6.9/lib/rack/mount/code_generation.rb in recognize | |
# | |
82. instance_eval(<<-RUBY, __FILE__, __LINE__) | |
83. def recognize(obj) | |
84. cache = {} | |
85. container = @recognition_graph[#{keys}] | |
86. optimize_container_iterator(container) unless container.respond_to?(:optimized_each) | |
87. | |
88. if block_given? | |
89. container.optimized_each(obj) do |route, matches, params| | |
90. yield route, matches, params | |
91. end | |
92. else | |
93. container.optimized_each(obj) do |route, matches, params| | |
94. return route, matches, params | |
95. end | |
96. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/rack-mount-0.6.9/lib/rack/mount/code_generation.rb in optimized_each | |
# | |
59. } | |
60. | |
61. container.instance_eval(<<-RUBY, __FILE__, __LINE__) | |
62. def optimized_each(obj) | |
63. #{body.join("\n")} | |
64. nil | |
65. end | |
66. RUBY | |
67. end | |
68. | |
69. def optimize_recognize! | |
70. keys = @recognition_keys.map { |key| | |
71. if key.respond_to?(:call_source) | |
72. key.call_source(:cache, :obj) | |
73. else | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/rack-mount-0.6.9/lib/rack/mount/code_generation.rb in recognize | |
# | |
81. | |
82. instance_eval(<<-RUBY, __FILE__, __LINE__) | |
83. def recognize(obj) | |
84. cache = {} | |
85. container = @recognition_graph[#{keys}] | |
86. optimize_container_iterator(container) unless container.respond_to?(:optimized_each) | |
87. | |
88. if block_given? | |
89. container.optimized_each(obj) do |route, matches, params| | |
90. yield route, matches, params | |
91. end | |
92. else | |
93. container.optimized_each(obj) do |route, matches, params| | |
94. return route, matches, params | |
95. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/rack-mount-0.6.9/lib/rack/mount/route_set.rb in call | |
# | |
132. def call(env) | |
133. raise 'route set not finalized' unless @recognition_graph | |
134. | |
135. env[PATH_INFO] = Utils.normalize_path(env[PATH_INFO]) | |
136. | |
137. request = nil | |
138. req = @request_class.new(env) | |
139. recognize(req) do |route, matches, params| | |
140. # TODO: We only want to unescape params from uri related methods | |
141. params.each { |k, v| params[k] = Utils.unescape_uri(v) if v.is_a?(String) } | |
142. | |
143. if route.prefix? | |
144. env[Prefix::KEY] = matches[:path_info].to_s | |
145. end | |
146. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/routing/route_set.rb in call | |
# | |
450. rewritten_url << "##{Rack::Utils.escape(options[:anchor].to_param.to_s)}" if options[:anchor] | |
451. | |
452. rewritten_url | |
453. end | |
454. | |
455. def call(env) | |
456. finalize! | |
457. @set.call(env) | |
458. end | |
459. | |
460. def recognize_path(path, environment = {}) | |
461. method = (environment[:method] || "GET").to_s.upcase | |
462. path = Rack::Mount::Utils.normalize_path(path) | |
463. | |
464. begin | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in forward | |
# | |
443. def pass(&block) | |
444. throw :pass, block | |
445. end | |
446. | |
447. # Forward the request to the downstream app -- middleware only. | |
448. def forward | |
449. fail "downstream app not set" unless @app.respond_to? :call | |
450. status, headers, body = @app.call(@request.env) | |
451. @response.status = status | |
452. @response.body = body | |
453. @response.headers.merge! headers | |
454. nil | |
455. end | |
456. | |
457. private | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in route_missing | |
# | |
524. # No matching route was found or all routes passed. The default | |
525. # implementation is to forward the request downstream when running | |
526. # as middleware (@app is non-nil); when no downstream app is set, raise | |
527. # a NotFound exception. Subclasses can override this method to perform | |
528. # custom route miss logic. | |
529. def route_missing | |
530. if @app | |
531. forward | |
532. else | |
533. raise NotFound | |
534. end | |
535. end | |
536. | |
537. # Attempt to serve static files from public directory. Throws :halt when | |
538. # a matching file is found, returns nil otherwise. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in route! | |
# | |
509. if base.superclass.respond_to?(:routes) | |
510. route! base.superclass, pass_block | |
511. return | |
512. end | |
513. | |
514. route_eval(&pass_block) if pass_block | |
515. | |
516. route_missing | |
517. end | |
518. | |
519. # Run a route block and throw :halt with the result. | |
520. def route_eval(&block) | |
521. throw :halt, instance_eval(&block) | |
522. end | |
523. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in route! | |
# | |
503. end | |
504. | |
505. @params = original_params | |
506. end | |
507. | |
508. # Run routes defined in superclass. | |
509. if base.superclass.respond_to?(:routes) | |
510. route! base.superclass, pass_block | |
511. return | |
512. end | |
513. | |
514. route_eval(&pass_block) if pass_block | |
515. | |
516. route_missing | |
517. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in dispatch! | |
# | |
594. res | |
595. end | |
596. | |
597. # Dispatch a request with error handling. | |
598. def dispatch! | |
599. static! if settings.static? && (request.get? || request.head?) | |
600. before_filter! | |
601. route! | |
602. rescue NotFound => boom | |
603. handle_not_found!(boom) | |
604. rescue ::Exception => boom | |
605. handle_exception!(boom) | |
606. ensure | |
607. after_filter! unless env['sinatra.static_file'] | |
608. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in call! | |
# | |
404. def call!(env) | |
405. @env = env | |
406. @request = Request.new(env) | |
407. @response = Response.new | |
408. @params = indifferent_params(@request.params) | |
409. @template_cache.clear if settings.reload_templates | |
410. | |
411. invoke { dispatch! } | |
412. invoke { error_block!(response.status) } | |
413. | |
414. status, header, body = @response.finish | |
415. | |
416. # Never produce a body on HEAD requests. Do retain the Content-Length | |
417. # unless it's "0", in which case we assume it was calculated erroneously | |
418. # for a manual HEAD response and remove it entirely. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in instance_eval | |
# | |
559. | |
560. def indifferent_hash | |
561. Hash.new {|hash,key| hash[key.to_s] if Symbol === key } | |
562. end | |
563. | |
564. # Run the block with 'throw :halt' support and apply result to the response. | |
565. def invoke(&block) | |
566. res = catch(:halt) { instance_eval(&block) } | |
567. return if res.nil? | |
568. | |
569. case | |
570. when res.respond_to?(:to_str) | |
571. @response.body = [res] | |
572. when res.respond_to?(:to_ary) | |
573. res = res.to_ary | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in invoke | |
# | |
559. | |
560. def indifferent_hash | |
561. Hash.new {|hash,key| hash[key.to_s] if Symbol === key } | |
562. end | |
563. | |
564. # Run the block with 'throw :halt' support and apply result to the response. | |
565. def invoke(&block) | |
566. res = catch(:halt) { instance_eval(&block) } | |
567. return if res.nil? | |
568. | |
569. case | |
570. when res.respond_to?(:to_str) | |
571. @response.body = [res] | |
572. when res.respond_to?(:to_ary) | |
573. res = res.to_ary | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in catch | |
# | |
559. | |
560. def indifferent_hash | |
561. Hash.new {|hash,key| hash[key.to_s] if Symbol === key } | |
562. end | |
563. | |
564. # Run the block with 'throw :halt' support and apply result to the response. | |
565. def invoke(&block) | |
566. res = catch(:halt) { instance_eval(&block) } | |
567. return if res.nil? | |
568. | |
569. case | |
570. when res.respond_to?(:to_str) | |
571. @response.body = [res] | |
572. when res.respond_to?(:to_ary) | |
573. res = res.to_ary | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in invoke | |
# | |
559. | |
560. def indifferent_hash | |
561. Hash.new {|hash,key| hash[key.to_s] if Symbol === key } | |
562. end | |
563. | |
564. # Run the block with 'throw :halt' support and apply result to the response. | |
565. def invoke(&block) | |
566. res = catch(:halt) { instance_eval(&block) } | |
567. return if res.nil? | |
568. | |
569. case | |
570. when res.respond_to?(:to_str) | |
571. @response.body = [res] | |
572. when res.respond_to?(:to_ary) | |
573. res = res.to_ary | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in call! | |
# | |
404. def call!(env) | |
405. @env = env | |
406. @request = Request.new(env) | |
407. @response = Response.new | |
408. @params = indifferent_params(@request.params) | |
409. @template_cache.clear if settings.reload_templates | |
410. | |
411. invoke { dispatch! } | |
412. invoke { error_block!(response.status) } | |
413. | |
414. status, header, body = @response.finish | |
415. | |
416. # Never produce a body on HEAD requests. Do retain the Content-Length | |
417. # unless it's "0", in which case we assume it was calculated erroneously | |
418. # for a manual HEAD response and remove it entirely. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in call | |
# | |
392. @app = app | |
393. @template_cache = Tilt::Cache.new | |
394. yield self if block_given? | |
395. end | |
396. | |
397. # Rack call interface. | |
398. def call(env) | |
399. dup.call!(env) | |
400. end | |
401. | |
402. attr_accessor :env, :request, :response, :params | |
403. | |
404. def call!(env) | |
405. @env = env | |
406. @request = Request.new(env) | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb in call | |
# | |
17. | |
18. def initialize(app) | |
19. @app = app | |
20. @template = ERB.new(TEMPLATE) | |
21. end | |
22. | |
23. def call(env) | |
24. @app.call(env) | |
25. rescue StandardError, LoadError, SyntaxError => e | |
26. backtrace = pretty(env, e) | |
27. [500, | |
28. {"Content-Type" => "text/html", | |
29. "Content-Length" => backtrace.join.size.to_s}, | |
30. backtrace] | |
31. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/head.rb in call | |
# | |
7. def call(env) | |
8. if env["REQUEST_METHOD"] == "HEAD" | |
9. env["REQUEST_METHOD"] = "GET" | |
10. env["rack.methodoverride.original_method"] = "HEAD" | |
11. status, headers, body = @app.call(env) | |
12. [status, headers, []] | |
13. else | |
14. @app.call(env) | |
15. end | |
16. end | |
17. end | |
18. end | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/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 | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/params_parser.rb in call | |
# | |
14. end | |
15. | |
16. def call(env) | |
17. if params = parse_formatted_parameters(env) | |
18. env["action_dispatch.request.request_parameters"] = params | |
19. end | |
20. | |
21. @app.call(env) | |
22. end | |
23. | |
24. private | |
25. def parse_formatted_parameters(env) | |
26. request = Request.new(env) | |
27. | |
28. return false if request.content_length.zero? | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/flash.rb in call | |
# | |
170. end | |
171. | |
172. def call(env) | |
173. if (session = env['rack.session']) && (flash = session['flash']) | |
174. flash.sweep | |
175. end | |
176. | |
177. @app.call(env) | |
178. ensure | |
179. if (session = env['rack.session']) && session.key?('flash') && session['flash'].empty? | |
180. session.delete('flash') | |
181. end | |
182. end | |
183. end | |
184. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/session/abstract_store.rb in call | |
# | |
99. @key = @default_options.delete(:key).freeze | |
100. @cookie_only = @default_options.delete(:cookie_only) | |
101. ensure_session_key! | |
102. end | |
103. | |
104. def call(env) | |
105. prepare!(env) | |
106. response = @app.call(env) | |
107. | |
108. session_data = env[ENV_SESSION_KEY] | |
109. options = env[ENV_SESSION_OPTIONS_KEY] | |
110. | |
111. if !session_data.is_a?(AbstractStore::SessionHash) || session_data.send(:loaded?) || options[:expire_after] | |
112. session_data.send(:load!) if session_data.is_a?(AbstractStore::SessionHash) && !session_data.send(:loaded?) | |
113. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/cookies.rb in call | |
# | |
228. end | |
229. | |
230. def initialize(app) | |
231. @app = app | |
232. end | |
233. | |
234. def call(env) | |
235. status, headers, body = @app.call(env) | |
236. | |
237. if cookie_jar = env['action_dispatch.cookies'] | |
238. cookie_jar.write(headers) | |
239. if headers[HTTP_HEADER].respond_to?(:join) | |
240. headers[HTTP_HEADER] = headers[HTTP_HEADER].join("\n") | |
241. end | |
242. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activerecord-3.0.0.beta4/lib/active_record/query_cache.rb in call | |
# | |
24. | |
25. def initialize(app) | |
26. @app = app | |
27. end | |
28. | |
29. def call(env) | |
30. ActiveRecord::Base.cache do | |
31. @app.call(env) | |
32. end | |
33. end | |
34. end | |
35. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activerecord-3.0.0.beta4/lib/active_record/connection_adapters/abstract/query_cache.rb in cache | |
# | |
21. end | |
22. | |
23. attr_reader :query_cache, :query_cache_enabled | |
24. | |
25. # Enable the query cache within the block. | |
26. def cache | |
27. old, @query_cache_enabled = @query_cache_enabled, true | |
28. yield | |
29. ensure | |
30. clear_query_cache | |
31. @query_cache_enabled = old | |
32. end | |
33. | |
34. # Disable the query cache within the block. | |
35. def uncached | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activerecord-3.0.0.beta4/lib/active_record/query_cache.rb in cache | |
# | |
4. class QueryCache | |
5. module ClassMethods | |
6. # Enable the query cache within the block if Active Record is configured. | |
7. def cache(&block) | |
8. if ActiveRecord::Base.configurations.blank? | |
9. yield | |
10. else | |
11. connection.cache(&block) | |
12. end | |
13. end | |
14. | |
15. # Disable the query cache within the block if Active Record is configured. | |
16. def uncached(&block) | |
17. if ActiveRecord::Base.configurations.blank? | |
18. yield | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activerecord-3.0.0.beta4/lib/active_record/query_cache.rb in call | |
# | |
23. end | |
24. | |
25. def initialize(app) | |
26. @app = app | |
27. end | |
28. | |
29. def call(env) | |
30. ActiveRecord::Base.cache do | |
31. @app.call(env) | |
32. end | |
33. end | |
34. end | |
35. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activerecord-3.0.0.beta4/lib/active_record/connection_adapters/abstract/connection_pool.rb in call | |
# | |
358. | |
359. class ConnectionManagement | |
360. def initialize(app) | |
361. @app = app | |
362. end | |
363. | |
364. def call(env) | |
365. @app.call(env) | |
366. ensure | |
367. # Don't return connection (and perform implicit rollback) if | |
368. # this request is a part of integration test | |
369. unless env.key?("rack.test") | |
370. ActiveRecord::Base.clear_active_connections! | |
371. end | |
372. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/callbacks.rb in call | |
# | |
39. @app, @prepare_each_request = app, prepare_each_request | |
40. run_callbacks(:prepare) | |
41. end | |
42. | |
43. def call(env) | |
44. run_callbacks(:call) do | |
45. run_callbacks(:prepare) if @prepare_each_request | |
46. @app.call(env) | |
47. end | |
48. end | |
49. end | |
50. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in _run_call_callbacks | |
# | |
407. | |
408. send(name, &blk) | |
409. else | |
410. #{body} | |
411. end | |
412. end | |
413. private :_run_#{symbol}_callbacks | |
414. RUBY_EVAL | |
415. end | |
416. end | |
417. | |
418. # This is called the first time a callback is called with a particular | |
419. # key. It creates a new callback method for the key, calculating | |
420. # which callbacks can be omitted because of per_key conditions. | |
421. # | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in send | |
# | |
81. # - save | |
82. # saved | |
83. # | |
84. module Callbacks | |
85. extend Concern | |
86. | |
87. def run_callbacks(kind, *args, &block) | |
88. send("_run_#{kind}_callbacks", *args, &block) | |
89. end | |
90. | |
91. class Callback | |
92. @@_callback_sequence = 0 | |
93. | |
94. attr_accessor :chain, :filter, :kind, :options, :per_key, :klass, :raw_filter | |
95. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in run_callbacks | |
# | |
81. # - save | |
82. # saved | |
83. # | |
84. module Callbacks | |
85. extend Concern | |
86. | |
87. def run_callbacks(kind, *args, &block) | |
88. send("_run_#{kind}_callbacks", *args, &block) | |
89. end | |
90. | |
91. class Callback | |
92. @@_callback_sequence = 0 | |
93. | |
94. attr_accessor :chain, :filter, :kind, :options, :per_key, :klass, :raw_filter | |
95. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/callbacks.rb in call | |
# | |
37. | |
38. def initialize(app, prepare_each_request = false) | |
39. @app, @prepare_each_request = app, prepare_each_request | |
40. run_callbacks(:prepare) | |
41. end | |
42. | |
43. def call(env) | |
44. run_callbacks(:call) do | |
45. run_callbacks(:prepare) if @prepare_each_request | |
46. @app.call(env) | |
47. end | |
48. end | |
49. end | |
50. end | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/sendfile.rb in call | |
# | |
98. | |
99. def initialize(app, variation=nil) | |
100. @app = app | |
101. @variation = variation | |
102. end | |
103. | |
104. def call(env) | |
105. status, headers, body = @app.call(env) | |
106. if body.respond_to?(:to_path) | |
107. case type = variation(env) | |
108. when 'X-Accel-Redirect' | |
109. path = F.expand_path(body.to_path) | |
110. if url = map_accel_path(env, path) | |
111. headers[type] = url | |
112. body = [] | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/remote_ip.rb in call | |
# | |
41. regex = '(^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.)' | |
42. regex << "|(#{trusted_proxies})" if trusted_proxies | |
43. @trusted_proxies = Regexp.new(regex, "i") | |
44. end | |
45. | |
46. def call(env) | |
47. env["action_dispatch.remote_ip"] = RemoteIpGetter.new(env, @check_ip_spoofing, @trusted_proxies) | |
48. @app.call(env) | |
49. end | |
50. end | |
51. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/show_exceptions.rb in call | |
# | |
41. | |
42. def initialize(app, consider_all_requests_local = false) | |
43. @app = app | |
44. @consider_all_requests_local = consider_all_requests_local | |
45. end | |
46. | |
47. def call(env) | |
48. status, headers, body = @app.call(env) | |
49. | |
50. # Only this middleware cares about RoutingError. So, let's just raise | |
51. # it here. | |
52. # TODO: refactor this middleware to handle the X-Cascade scenario without | |
53. # having to raise an exception. | |
54. if headers['X-Cascade'] == 'pass' | |
55. raise ActionController::RoutingError, "No route matches #{env['PATH_INFO'].inspect}" | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/rack/logger.rb in call | |
# | |
7. class Logger < Rails::LogSubscriber | |
8. def initialize(app) | |
9. @app = app | |
10. end | |
11. | |
12. def call(env) | |
13. before_dispatch(env) | |
14. @app.call(env) | |
15. ensure | |
16. after_dispatch(env) | |
17. end | |
18. | |
19. protected | |
20. | |
21. def before_dispatch(env) | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/runtime.rb in call | |
# | |
10. @app = app | |
11. @header_name = "X-Runtime" | |
12. @header_name << "-#{name}" if name | |
13. end | |
14. | |
15. def call(env) | |
16. start_time = Time.now | |
17. status, headers, body = @app.call(env) | |
18. request_time = Time.now - start_time | |
19. | |
20. if !headers.has_key?(@header_name) | |
21. headers[@header_name] = "%0.6f" % request_time | |
22. end | |
23. | |
24. [status, headers, body] | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/cache/strategy/local_cache.rb in call | |
# | |
65. | |
66. def initialize(app) | |
67. @app = app | |
68. end | |
69. | |
70. def call(env) | |
71. Thread.current[:#{thread_local_key}] = LocalStore.new | |
72. @app.call(env) | |
73. ensure | |
74. Thread.current[:#{thread_local_key}] = nil | |
75. end | |
76. EOS | |
77. klass | |
78. end | |
79. end | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb in call | |
# | |
4. | |
5. def initialize(app, lock = Mutex.new) | |
6. @app, @lock = app, lock | |
7. end | |
8. | |
9. def call(env) | |
10. old, env[FLAG] = env[FLAG], false | |
11. @lock.synchronize { @app.call(env) } | |
12. ensure | |
13. env[FLAG] = old | |
14. end | |
15. end | |
16. end | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb in synchronize | |
# | |
4. | |
5. def initialize(app, lock = Mutex.new) | |
6. @app, @lock = app, lock | |
7. end | |
8. | |
9. def call(env) | |
10. old, env[FLAG] = env[FLAG], false | |
11. @lock.synchronize { @app.call(env) } | |
12. ensure | |
13. env[FLAG] = old | |
14. end | |
15. end | |
16. end | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb in call | |
# | |
4. | |
5. def initialize(app, lock = Mutex.new) | |
6. @app, @lock = app, lock | |
7. end | |
8. | |
9. def call(env) | |
10. old, env[FLAG] = env[FLAG], false | |
11. @lock.synchronize { @app.call(env) } | |
12. ensure | |
13. env[FLAG] = old | |
14. end | |
15. end | |
16. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/static.rb in call | |
# | |
23. if file_exist?(cached_path) | |
24. env['PATH_INFO'] = cached_path | |
25. return @file_server.call(env) | |
26. end | |
27. end | |
28. end | |
29. | |
30. @app.call(env) | |
31. end | |
32. | |
33. private | |
34. def file_exist?(path) | |
35. full_path = File.join(@file_server.root, ::Rack::Utils.unescape(path)) | |
36. File.file?(full_path) && File.readable?(full_path) | |
37. end | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/application.rb in call | |
# | |
138. @app ||= begin | |
139. config.middleware = config.middleware.merge_into(default_middleware_stack) | |
140. config.middleware.build(routes) | |
141. end | |
142. end | |
143. | |
144. def call(env) | |
145. app.call(env.reverse_merge!(env_defaults)) | |
146. end | |
147. | |
148. def env_defaults | |
149. @env_defaults ||= { | |
150. "action_dispatch.parameter_filter" => config.filter_parameters, | |
151. "action_dispatch.secret_token" => config.secret_token | |
152. } | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/application.rb in send | |
# | |
74. def respond_to?(*args) | |
75. super || instance.respond_to?(*args) | |
76. end | |
77. | |
78. protected | |
79. | |
80. def method_missing(*args, &block) | |
81. instance.send(*args, &block) | |
82. end | |
83. end | |
84. | |
85. delegate :middleware, :to => :config | |
86. | |
87. def add_lib_to_load_paths! | |
88. path = config.root.join('lib').to_s | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/application.rb in method_missing | |
# | |
74. def respond_to?(*args) | |
75. super || instance.respond_to?(*args) | |
76. end | |
77. | |
78. protected | |
79. | |
80. def method_missing(*args, &block) | |
81. instance.send(*args, &block) | |
82. end | |
83. end | |
84. | |
85. delegate :middleware, :to => :config | |
86. | |
87. def add_lib_to_load_paths! | |
88. path = config.root.join('lib').to_s | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/rack/log_tailer.rb in call | |
# | |
8. @cursor = ::File.size(path) | |
9. @last_checked = Time.now.to_f | |
10. | |
11. @file = ::File.open(path, 'r') | |
12. end | |
13. | |
14. def call(env) | |
15. response = @app.call(env) | |
16. tail! | |
17. response | |
18. end | |
19. | |
20. def tail! | |
21. @file.seek @cursor | |
22. | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb in call | |
# | |
6. include Rack::Utils | |
7. | |
8. def initialize(app) | |
9. @app = app | |
10. end | |
11. | |
12. def call(env) | |
13. status, headers, body = @app.call(env) | |
14. headers = HeaderHash.new(headers) | |
15. | |
16. if !STATUS_WITH_NO_ENTITY_BODY.include?(status) && | |
17. !headers['Content-Length'] && | |
18. !headers['Transfer-Encoding'] && | |
19. (body.respond_to?(:to_ary) || body.respond_to?(:to_str)) | |
20. | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb in service | |
# | |
41. env["QUERY_STRING"] ||= "" | |
42. env["REQUEST_PATH"] ||= "/" | |
43. unless env["PATH_INFO"] == "" | |
44. path, n = req.request_uri.path, env["SCRIPT_NAME"].length | |
45. env["PATH_INFO"] = path[n, path.length-n] | |
46. end | |
47. | |
48. status, headers, body = @app.call(env) | |
49. begin | |
50. res.status = status.to_i | |
51. headers.each { |k, vs| | |
52. if k.downcase == "set-cookie" | |
53. res.cookies.concat vs.split("\n") | |
54. else | |
55. vs.split("\n").each { |v| | |
# /usr/lib/ruby/1.8/webrick/httpserver.rb in service | |
# | |
97. | |
98. servlet, options, script_name, path_info = search_servlet(req.path) | |
99. raise HTTPStatus::NotFound, "`#{req.path}' not found." unless servlet | |
100. req.script_name = script_name | |
101. req.path_info = path_info | |
102. si = servlet.get_instance(self, *options) | |
103. @logger.debug(format("%s is invoked.", si.class.name)) | |
104. si.service(req, res) | |
105. end | |
106. | |
107. def do_OPTIONS(req, res) | |
108. res["allow"] = "GET,HEAD,POST,OPTIONS" | |
109. end | |
110. | |
111. def mount(dir, servlet, *options) | |
# /usr/lib/ruby/1.8/webrick/httpserver.rb in run | |
# | |
58. res.request_uri = req.request_uri | |
59. res.request_http_version = req.http_version | |
60. res.keep_alive = req.keep_alive? | |
61. server = lookup_server(req) || self | |
62. if callback = server[:RequestCallback] || server[:RequestHandler] | |
63. callback.call(req, res) | |
64. end | |
65. server.service(req, res) | |
66. rescue HTTPStatus::EOFError, HTTPStatus::RequestTimeout => ex | |
67. res.set_error(ex) | |
68. rescue HTTPStatus::Error => ex | |
69. @logger.error(ex.message) | |
70. res.set_error(ex) | |
71. rescue HTTPStatus::Status => ex | |
72. res.status = ex.code | |
# /usr/lib/ruby/1.8/webrick/server.rb in start_thread | |
# | |
166. addr = sock.peeraddr | |
167. @logger.debug "accept: #{addr[3]}:#{addr[1]}" | |
168. rescue SocketError | |
169. @logger.debug "accept: <address unknown>" | |
170. raise | |
171. end | |
172. call_callback(:AcceptCallback, sock) | |
173. block ? block.call(sock) : run(sock) | |
174. rescue Errno::ENOTCONN | |
175. @logger.debug "Errno::ENOTCONN raised" | |
176. rescue ServerError => ex | |
177. msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}" | |
178. @logger.error msg | |
179. rescue Exception => ex | |
180. @logger.error ex | |
# /usr/lib/ruby/1.8/webrick/server.rb in start | |
# | |
155. msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}" | |
156. @logger.error msg | |
157. end | |
158. return sock | |
159. end | |
160. | |
161. def start_thread(sock, &block) | |
162. Thread.start{ | |
163. begin | |
164. Thread.current[:WEBrickSocket] = sock | |
165. begin | |
166. addr = sock.peeraddr | |
167. @logger.debug "accept: #{addr[3]}:#{addr[1]}" | |
168. rescue SocketError | |
169. @logger.debug "accept: <address unknown>" | |
# /usr/lib/ruby/1.8/webrick/server.rb in start_thread | |
# | |
155. msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}" | |
156. @logger.error msg | |
157. end | |
158. return sock | |
159. end | |
160. | |
161. def start_thread(sock, &block) | |
162. Thread.start{ | |
163. begin | |
164. Thread.current[:WEBrickSocket] = sock | |
165. begin | |
166. addr = sock.peeraddr | |
167. @logger.debug "accept: #{addr[3]}:#{addr[1]}" | |
168. rescue SocketError | |
169. @logger.debug "accept: <address unknown>" | |
# /usr/lib/ruby/1.8/webrick/server.rb in start | |
# | |
88. @status = :Running | |
89. while @status == :Running | |
90. begin | |
91. if svrs = IO.select(@listeners, nil, nil, 2.0) | |
92. svrs[0].each{|svr| | |
93. @tokens.pop # blocks while no token is there. | |
94. if sock = accept_client(svr) | |
95. th = start_thread(sock, &block) | |
96. th[:WEBrickThread] = true | |
97. thgroup.add(th) | |
98. else | |
99. @tokens.push(nil) | |
100. end | |
101. } | |
102. end | |
# /usr/lib/ruby/1.8/webrick/server.rb in each | |
# | |
85. call_callback(:StartCallback) | |
86. | |
87. thgroup = ThreadGroup.new | |
88. @status = :Running | |
89. while @status == :Running | |
90. begin | |
91. if svrs = IO.select(@listeners, nil, nil, 2.0) | |
92. svrs[0].each{|svr| | |
93. @tokens.pop # blocks while no token is there. | |
94. if sock = accept_client(svr) | |
95. th = start_thread(sock, &block) | |
96. th[:WEBrickThread] = true | |
97. thgroup.add(th) | |
98. else | |
99. @tokens.push(nil) | |
# /usr/lib/ruby/1.8/webrick/server.rb in start | |
# | |
85. call_callback(:StartCallback) | |
86. | |
87. thgroup = ThreadGroup.new | |
88. @status = :Running | |
89. while @status == :Running | |
90. begin | |
91. if svrs = IO.select(@listeners, nil, nil, 2.0) | |
92. svrs[0].each{|svr| | |
93. @tokens.pop # blocks while no token is there. | |
94. if sock = accept_client(svr) | |
95. th = start_thread(sock, &block) | |
96. th[:WEBrickThread] = true | |
97. thgroup.add(th) | |
98. else | |
99. @tokens.push(nil) | |
# /usr/lib/ruby/1.8/webrick/server.rb in start | |
# | |
16. | |
17. module WEBrick | |
18. | |
19. class ServerError < StandardError; end | |
20. | |
21. class SimpleServer | |
22. def SimpleServer.start | |
23. yield | |
24. end | |
25. end | |
26. | |
27. class Daemon | |
28. def Daemon.start | |
29. exit!(0) if fork | |
30. Process::setsid | |
# /usr/lib/ruby/1.8/webrick/server.rb in start | |
# | |
75. @listeners += Utils::create_listeners(address, port, @logger) | |
76. end | |
77. | |
78. def start(&block) | |
79. raise ServerError, "already started." if @status != :Stop | |
80. server_type = @config[:ServerType] || SimpleServer | |
81. | |
82. server_type.start{ | |
83. @logger.info \ | |
84. "#{self.class}#start: pid=#{$$} port=#{@config[:Port]}" | |
85. call_callback(:StartCallback) | |
86. | |
87. thgroup = ThreadGroup.new | |
88. @status = :Running | |
89. while @status == :Running | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb in run | |
# | |
7. class WEBrick < ::WEBrick::HTTPServlet::AbstractServlet | |
8. def self.run(app, options={}) | |
9. options[:BindAddress] = options.delete(:Host) if options[:Host] | |
10. server = ::WEBrick::HTTPServer.new(options) | |
11. server.mount "/", Rack::Handler::WEBrick, app | |
12. trap(:INT) { server.shutdown } | |
13. yield server if block_given? | |
14. server.start | |
15. end | |
16. | |
17. def initialize(server, app) | |
18. super server | |
19. @app = Rack::ContentLength.new(app) | |
20. end | |
21. | |
# /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb in start | |
# | |
148. | |
149. if library = options[:require] | |
150. require library | |
151. end | |
152. | |
153. daemonize_app if options[:daemonize] | |
154. write_pid if options[:pid] | |
155. server.run wrapped_app, options | |
156. end | |
157. | |
158. def server | |
159. @_server ||= Rack::Handler.get(options[:server]) || Rack::Handler.default | |
160. end | |
161. | |
162. private | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/commands/server.rb in start | |
# | |
55. puts "=> Ctrl-C to shutdown server" unless options[:daemonize] | |
56. | |
57. #Create required tmp directories if not found | |
58. %w(cache pids sessions sockets).each do |dir_to_make| | |
59. FileUtils.mkdir_p(Rails.root.join('tmp', dir_to_make)) | |
60. end | |
61. | |
62. super | |
63. ensure | |
64. # The '-h' option calls exit before @options is set. | |
65. # If we call 'options' with it unset, we get double help banners. | |
66. puts 'Exiting' unless @options && options[:daemonize] | |
67. end | |
68. | |
69. def middleware | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/commands.rb in nil | |
# | |
23. Rails::Console.start(Rails::Application) | |
24. | |
25. when 'server' | |
26. require 'rails/commands/server' | |
27. Rails::Server.new.tap { |server| | |
28. require APP_PATH | |
29. Dir.chdir(Rails::Application.root) | |
30. server.start | |
31. } | |
32. | |
33. when 'dbconsole' | |
34. require 'rails/commands/dbconsole' | |
35. require APP_PATH | |
36. Rails::DBConsole.start(Rails::Application) | |
37. | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/commands.rb in tap | |
# | |
20. require 'rails/commands/console' | |
21. require APP_PATH | |
22. Rails::Application.require_environment! | |
23. Rails::Console.start(Rails::Application) | |
24. | |
25. when 'server' | |
26. require 'rails/commands/server' | |
27. Rails::Server.new.tap { |server| | |
28. require APP_PATH | |
29. Dir.chdir(Rails::Application.root) | |
30. server.start | |
31. } | |
32. | |
33. when 'dbconsole' | |
34. require 'rails/commands/dbconsole' | |
# /home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/commands.rb in nil | |
# | |
20. require 'rails/commands/console' | |
21. require APP_PATH | |
22. Rails::Application.require_environment! | |
23. Rails::Console.start(Rails::Application) | |
24. | |
25. when 'server' | |
26. require 'rails/commands/server' | |
27. Rails::Server.new.tap { |server| | |
28. require APP_PATH | |
29. Dir.chdir(Rails::Application.root) | |
30. server.start | |
31. } | |
32. | |
33. when 'dbconsole' | |
34. require 'rails/commands/dbconsole' | |
# script/rails in require | |
# | |
1. #!/usr/bin/env ruby | |
2. # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | |
3. | |
4. APP_PATH = File.expand_path('../../config/application', __FILE__) | |
5. require File.expand_path('../../config/boot', __FILE__) | |
6. require 'rails/commands' | |
# script/rails in nil | |
# | |
1. #!/usr/bin/env ruby | |
2. # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | |
3. | |
4. APP_PATH = File.expand_path('../../config/application', __FILE__) | |
5. require File.expand_path('../../config/boot', __FILE__) | |
6. require 'rails/commands' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/home/drusellers/dev/gemcutter/app/models/download.rb in most_downloaded_today
24.
29.
33.
/home/drusellers/dev/gemcutter/app/controllers/home_controller.rb in index
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/implicit_render.rb in send_action
8.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/implicit_render.rb in send_action
8.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/abstract_controller/base.rb in process_action
140.
Call the action. Override this in a subclass to modify the
behavior around processing an action. This, and not #process,
is the intended way to override action dispatching.
147.
Actually call the method associated with the action. Override
this method if you wish to change how action methods are called,
not to add additional behavior around it. For example, you would
override #send_action if you want to inject arguments into the
method.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/rendering.rb in process_action
7.
Before processing, set the request formats in current controller formats.
13.
Check for double render errors and set the content_type after rendering.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/abstract_controller/callbacks.rb in process_action
13.
Override AbstractController::Base's process_action to run the
process_action callbacks around the normal behavior.
21.
If :only or :except are used, convert the options into the
primitive form (:per_key) used by ActiveSupport::Callbacks.
The basic idea is that :only => :index gets converted to
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in _run__738958071__process_action__199225275__callbacks
430.
This is used internally to append, prepend and skip callbacks to the
CallbackChain.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in send
403.
407.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in _run_process_action_callbacks
403.
407.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in send
- save
saved
86.
90.
93.
95.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in run_callbacks
- save
saved
86.
90.
93.
95.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/abstract_controller/callbacks.rb in process_action
13.
Override AbstractController::Base's process_action to run the
process_action callbacks around the normal behavior.
21.
If :only or :except are used, convert the options into the
primitive form (:per_key) used by ActiveSupport::Callbacks.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb in process_action
25.
27.
35.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/notifications/instrumenter.rb in instrument
Instrument the given block by measuring the time taken to execute it
and publish it. Notice that events get sent even if an error occurs
in the passed-in block
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/notifications.rb in send
autoload :Instrumenter, 'active_support/notifications/instrumenter'
autoload :Event, 'active_support/notifications/instrumenter'
autoload :Fanout, 'active_support/notifications/fanout'
44.
class << self
attr_writer :notifier
delegate :publish, :subscribe, :unsubscribe, :to => :notifier
delegate :instrument, :to => :instrumenter
def notifier
@Notifier ||= Notifier.new
end
53.
def instrumenter
Thread.current[:"instrumentation_#{notifier.object_id}"] ||= Instrumenter.new(notifier)
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/notifications.rb in instrument
autoload :Instrumenter, 'active_support/notifications/instrumenter'
autoload :Event, 'active_support/notifications/instrumenter'
autoload :Fanout, 'active_support/notifications/fanout'
44.
class << self
attr_writer :notifier
delegate :publish, :subscribe, :unsubscribe, :to => :notifier
delegate :instrument, :to => :instrumenter
def notifier
@Notifier ||= Notifier.new
end
53.
def instrumenter
Thread.current[:"instrumentation_#{notifier.object_id}"] ||= Instrumenter.new(notifier)
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb in process_action
25.
27.
35.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/rescue.rb in process_action
5.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/abstract_controller/base.rb in process
111.
113.
116.
Delegates to the class' #controller_path
121.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/abstract_controller/rendering.rb in process
34.
36.
Overwrite process to setup I18n proxy.
44.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal.rb in dispatch
120.
:api: private
129.
:api: private
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/rack_delegation.rb in dispatch
10.
16.
20.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_controller/metal.rb in nil
==== Parameters
action<#to_s>:: An action name
==== Returns
Proc:: A rack application
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/routing/route_set.rb in call
21.
Just raise undefined constant errors if a controller was specified as default.
26.
29.
34.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/routing/route_set.rb in call
21.
Just raise undefined constant errors if a controller was specified as default.
26.
29.
34.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/rack-mount-0.6.9/lib/rack/mount/route_set.rb in call
142.
146.
151.
154.
Generates a url from Rack env and identifiers or significant keys.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/rack-mount-0.6.9/lib/rack/mount/code_generation.rb in recognize
87.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/rack-mount-0.6.9/lib/rack/mount/code_generation.rb in optimized_each
60.
68.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/rack-mount-0.6.9/lib/rack/mount/code_generation.rb in recognize
87.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/rack-mount-0.6.9/lib/rack/mount/route_set.rb in call
134.
136.
TODO: We only want to unescape params from uri related methods
142.
146.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/routing/route_set.rb in call
451.
454.
459.
463.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in forward
446.
Forward the request to the downstream app -- middleware only.
456.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in route_missing
No matching route was found or all routes passed. The default
implementation is to forward the request downstream when running
as middleware (@app is non-nil); when no downstream app is set, raise
a NotFound exception. Subclasses can override this method to perform
custom route miss logic.
536.
Attempt to serve static files from public directory. Throws :halt when
a matching file is found, returns nil otherwise.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in route!
513.
515.
518.
Run a route block and throw :halt with the result.
523.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in route!
504.
507.
Run routes defined in superclass.
513.
515.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in dispatch!
596.
Dispatch a request with error handling.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in call!
410.
413.
415.
Never produce a body on HEAD requests. Do retain the Content-Length
unless it's "0", in which case we assume it was calculated erroneously
for a manual HEAD response and remove it entirely.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in instance_eval
563.
Run the block with 'throw :halt' support and apply result to the response.
568.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in invoke
563.
Run the block with 'throw :halt' support and apply result to the response.
568.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in catch
563.
Run the block with 'throw :halt' support and apply result to the response.
568.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in invoke
563.
Run the block with 'throw :halt' support and apply result to the response.
568.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in call!
410.
413.
415.
Never produce a body on HEAD requests. Do retain the Content-Length
unless it's "0", in which case we assume it was calculated erroneously
for a manual HEAD response and remove it entirely.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/sinatra-1.0/lib/sinatra/base.rb in call
396.
Rack call interface.
401.
403.
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb in call
22.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/head.rb in call
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/methodoverride.rb in call
23.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/params_parser.rb in call
15.
20.
23.
27.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/flash.rb in call
171.
176.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/session/abstract_store.rb in call
@cookie_only = @default_options.delete(:cookie_only)
ensure_session_key!
end
103.
def call(env)
prepare!(env)
response = @app.call(env)
session_data = env[ENV_SESSION_KEY]
options = env[ENV_SESSION_OPTIONS_KEY]
if !session_data.is_a?(AbstractStore::SessionHash) || session_data.send(:loaded?) || options[:expire_after]
session_data.send(:load!) if session_data.is_a?(AbstractStore::SessionHash) && !session_data.send(:loaded?)
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/cookies.rb in call
end
229.
def initialize(app)
@app = app
end
233.
def call(env)
status, headers, body = @app.call(env)
if cookie_jar = env['action_dispatch.cookies']
cookie_jar.write(headers)
if headers[HTTP_HEADER].respond_to?(:join)
headers[HTTP_HEADER] = headers[HTTP_HEADER].join("\n")
end
end
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activerecord-3.0.0.beta4/lib/active_record/query_cache.rb in call
28.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activerecord-3.0.0.beta4/lib/active_record/connection_adapters/abstract/query_cache.rb in cache
22.
24.
Enable the query cache within the block.
33.
Disable the query cache within the block.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activerecord-3.0.0.beta4/lib/active_record/query_cache.rb in cache
Enable the query cache within the block if Active Record is configured.
14.
Disable the query cache within the block if Active Record is configured.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activerecord-3.0.0.beta4/lib/active_record/query_cache.rb in call
24.
28.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activerecord-3.0.0.beta4/lib/active_record/connection_adapters/abstract/connection_pool.rb in call
363.
Don't return connection (and perform implicit rollback) if
this request is a part of integration test
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/callbacks.rb in call
42.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in _run_call_callbacks
417.
This is called the first time a callback is called with a particular
key. It creates a new callback method for the key, calculating
which callbacks can be omitted because of per_key conditions.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in send
- save
saved
86.
90.
93.
95.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb in run_callbacks
- save
saved
86.
90.
93.
95.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/callbacks.rb in call
42.
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/sendfile.rb in call
103.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/remote_ip.rb in call
45.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/show_exceptions.rb in call
def initialize(app, consider_all_requests_local = false)
@app = app
@consider_all_requests_local = consider_all_requests_local
end
46.
def call(env)
status, headers, body = @app.call(env)
Only this middleware cares about RoutingError. So, let's just raise
it here.
TODO: refactor this middleware to handle the X-Cascade scenario without
having to raise an exception.
if headers['X-Cascade'] == 'pass'
raise ActionController::RoutingError, "No route matches #{env['PATH_INFO'].inspect}"
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/rack/logger.rb in call
11.
18.
20.
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/runtime.rb in call
14.
19.
23.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/activesupport-3.0.0.beta4/lib/active_support/cache/strategy/local_cache.rb in call
69.
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb in call
8.
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb in synchronize
8.
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb in call
8.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/actionpack-3.0.0.beta4/lib/action_dispatch/middleware/static.rb in call
29.
32.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/application.rb in call
143.
147.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/application.rb in send
77.
79.
84.
86.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/application.rb in method_missing
77.
79.
84.
86.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/rack/log_tailer.rb in call
10.
13.
19.
22.
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb in call
7.
11.
15.
20.
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb in service
47.
/usr/lib/ruby/1.8/webrick/httpserver.rb in service
106.
110.
/usr/lib/ruby/1.8/webrick/httpserver.rb in run
/usr/lib/ruby/1.8/webrick/server.rb in start_thread
/usr/lib/ruby/1.8/webrick/server.rb in start
160.
/usr/lib/ruby/1.8/webrick/server.rb in start_thread
160.
/usr/lib/ruby/1.8/webrick/server.rb in start
/usr/lib/ruby/1.8/webrick/server.rb in each
86.
/usr/lib/ruby/1.8/webrick/server.rb in start
86.
/usr/lib/ruby/1.8/webrick/server.rb in start
18.
20.
26.
/usr/lib/ruby/1.8/webrick/server.rb in start
77.
81.
86.
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb in run
16.
21.
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb in start
152.
157.
161.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/commands/server.rb in start
56.
61.
The '-h' option calls exit before @options is set.
If we call 'options' with it unset, we get double help banners.
68.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/commands.rb in nil
24.
32.
37.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/commands.rb in tap
24.
32.
/home/drusellers/dev/gemcutter/vendor/bundler_gems/gems/railties-3.0.0.beta4/lib/rails/commands.rb in nil
24.
32.
script/rails in require
This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
script/rails in nil
This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.