Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaning up (class << self; def meth; end; end) where I can

  • Loading branch information...
commit dbdc13bf1fecfbbd426a49c6fe30943d74ff189c 1 parent eef4cb3
@bmizerany bmizerany authored
Showing with 16 additions and 19 deletions.
  1. +16 −19 lib/sinatra/base.rb
View
35 lib/sinatra/base.rb
@@ -722,29 +722,26 @@ class Default < Base
set :run, false
set :reload, Proc.new { app_file? && development? }
- @reloading = false
-
- class << self
- def reloading?
- @reloading
- end
+ def self.reloading?
+ @reloading ||= false
+ end
- def configure(*envs)
- super unless reloading?
- end
+ def self.configure(*envs)
+ super unless reloading?
+ end
- def call(env)
- reload! if reload?
- super
- end
+ def self.call(env)
+ reload! if reload?
+ super
+ end
- def reload!
- @reloading = true
- superclass.send :inherited, self
- ::Kernel.load app_file
- @reloading = false
- end
+ def self.reload!
+ @reloading = true
+ superclass.send :inherited, self
+ ::Kernel.load app_file
+ @reloading = false
end
+
end
class Application < Default
Please sign in to comment.
Something went wrong with that request. Please try again.