Sha256: 5383bc59dd222004c119ccb8d8d002e7b7f4278aa5dc519ee63945dbb85c3470

Contents?: true

Size: 787 Bytes

Versions: 4

Compression:

Stored size: 787 Bytes

Contents

module Byebug

  # Implements byebug "reload" command.
  class ReloadCommand < Command
    self.allow_in_control = true

    register_setting_get(:autoreload) do
      Byebug.class_variable_get(:@@autoreload)
    end

    register_setting_set(:autoreload) do |value|
      Byebug.class_variable_set(:@@autoreload, value)
    end
    Command.settings[:autoreload] = true

    def regexp
      /^\s* r(?:eload)? \s*$/x
    end

    def execute
      Byebug.source_reload
      print "Source code is reloaded. Automatic reloading is "   \
            "#{Command.settings[:autoreload] ? 'on' : 'off'}.\n"
    end

    private

    class << self
      def names
        %w(reload)
      end

      def description
        %{r[eload]\tforces source code reloading}
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
byebug-2.1.1 lib/byebug/commands/reload.rb
byebug-2.1.0 lib/byebug/commands/reload.rb
byebug-2.0.0 lib/byebug/commands/reload.rb
byebug-1.8.2 lib/byebug/commands/reload.rb