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.15 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.36 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.14 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.35 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.13 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.34 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.12 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.33 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.11 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.10 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.32 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.9 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.31 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.8 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.30 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.7 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.29 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.6 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.28 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.5 lib/workarea/ext/freedom_patches/routes_reloader.rb