lib/ruby_lsp_rails/railtie.rb in ruby-lsp-rails-0.2.2 vs lib/ruby_lsp_rails/railtie.rb in ruby-lsp-rails-0.2.3

- old
+ new

@@ -21,11 +21,11 @@ # If we start the app with `bin/rails console` then `Rails::Server` is not defined. if defined?(::Rails::Server) ssl_enable, host, port = ::Rails::Server::Options.new.parse!(ARGV).values_at(:SSLEnable, :Host, :Port) app_uri = "#{ssl_enable ? "https" : "http"}://#{host}:#{port}" - app_uri_path = "#{::Rails.root}/tmp/app_uri.txt" - File.write(app_uri_path, app_uri) + app_uri_path = ::Rails.root.join("tmp", "app_uri.txt") + app_uri_path.write(app_uri) at_exit do # The app_uri.txt file should only exist when the server is running. The extension uses its presence to # report if the server is running or not. If the server is not running, some of the extension features # will not be available.