Class: RailsGrpc::RackReloader

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_grpc/rack_reloader.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RackReloader

Returns a new instance of RackReloader.



5
6
7
# File 'lib/rails_grpc/rack_reloader.rb', line 5

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/rails_grpc/rack_reloader.rb', line 9

def call(env)
  unless RailsGrpc::Dependencies.cache_classes?
    changed = Rails.application.reloader.check.call
    if changed
      Rails.application.reloader.reload!
    end
  end
  @app.call(env)
end