Sha256: d4da0b247a58218929191e27f91db91d4adef354f738c46c069ba0e11d9529db

Contents?: true

Size: 1.05 KB

Versions: 21

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: false
#
#   nop.rb -
#   	by Keiju ISHITSUKA(keiju@ruby-lang.org)
#

module IRB
  # :stopdoc:

  module ExtendCommand
    class CommandArgumentError < StandardError; end

    class Nop
      class << self
        def category(category = nil)
          @category = category if category
          @category
        end

        def description(description = nil)
          @description = description if description
          @description
        end

        private

        def string_literal?(args)
          sexp = Ripper.sexp(args)
          sexp && sexp.size == 2 && sexp.last&.first&.first == :string_literal
        end
      end

      def self.execute(irb_context, *opts, **kwargs, &block)
        command = new(irb_context)
        command.execute(*opts, **kwargs, &block)
      rescue CommandArgumentError => e
        puts e.message
      end

      def initialize(irb_context)
        @irb_context = irb_context
      end

      attr_reader :irb_context

      def execute(*opts)
        #nop
      end
    end
  end

  # :startdoc:
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
irb-1.11.2 lib/irb/cmd/nop.rb
irb-1.11.1 lib/irb/cmd/nop.rb
irb-1.11.0 lib/irb/cmd/nop.rb
study_line-0.1.6 vendor/bundle/ruby/3.2.0/gems/irb-1.8.3/lib/irb/cmd/nop.rb
study_line-0.1.5 vendor/bundle/ruby/3.2.0/gems/irb-1.8.3/lib/irb/cmd/nop.rb
study_line-0.1.4 vendor/bundle/ruby/3.2.0/gems/irb-1.8.3/lib/irb/cmd/nop.rb
study_line-0.1.3 vendor/bundle/ruby/3.2.0/gems/irb-1.8.3/lib/irb/cmd/nop.rb
irb-1.10.1 lib/irb/cmd/nop.rb
study_line-0.1.2 vendor/bundle/ruby/3.2.0/gems/irb-1.8.3/lib/irb/cmd/nop.rb
study_line-0.1.1 vendor/bundle/ruby/3.2.0/gems/irb-1.8.3/lib/irb/cmd/nop.rb
irb-1.10.0 lib/irb/cmd/nop.rb
irb-1.9.1 lib/irb/cmd/nop.rb
irb-1.9.0 lib/irb/cmd/nop.rb
irb-1.8.3 lib/irb/cmd/nop.rb
irb-1.8.2 lib/irb/cmd/nop.rb
irb-1.8.1 lib/irb/cmd/nop.rb
irb-1.8.0 lib/irb/cmd/nop.rb
irb-1.7.4 lib/irb/cmd/nop.rb
irb-1.7.3 lib/irb/cmd/nop.rb
irb-1.7.2 lib/irb/cmd/nop.rb