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.4.27 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.4 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.26 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.3 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.25 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.2 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.24 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.1 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.23 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.22 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.0 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.21 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.5.0.beta.1 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.20 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.19 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.18 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.17 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.16 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.15 lib/workarea/ext/freedom_patches/routes_reloader.rb
workarea-core-3.4.14 lib/workarea/ext/freedom_patches/routes_reloader.rb