Sha256: f80ad939b1dabdb2703c89159d88b3c5cf12a99d84d74139e36d31b47f4cd869

Contents?: true

Size: 763 Bytes

Versions: 62

Compression:

Stored size: 763 Bytes

Contents

module Rails
  class Application
    class RoutesReloader
      # HACK: Adds a rescue to the method that eager loads routes. This rescue
      # looks a the specific error the occurs when eager loading in development,
      # and forces the routes to reload again, clearing out load paths and
      # resetting everything -- essentially like restarting the application.
      # This allows us to avoid a constant need to stop and restart the server.
      # Only included in development environments.
      #
      def execute
        ret = updater.execute
        route_sets.each(&:eager_load!) if eager_load
        ret
      rescue ArgumentError => e
        raise e unless e.message == "unknown firstpos: NilClass"
        reload!
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.26 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.45 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.25 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.23 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.44 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.22 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.43 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.21 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.42 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.20 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.41 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.19 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.40 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.18 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.39 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.17 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.38 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.16 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.37 lib/workarea/ext/freedom_patches/routes_reloader.rb