Sha256: b0e58e2a59fcae3101aa67c3f2b2eabff082c6705982624978dd3759e2905fca

Contents?: true

Size: 509 Bytes

Versions: 8

Compression:

Stored size: 509 Bytes

Contents

require "gm/notepad/input_handlers/default_handler"
module Gm
  module Notepad
    module InputHandlers
      class CommentHandler < DefaultHandler
        COMMENT_PREFIX = '#'.freeze

        def self.handles?(input:)
          return false unless input.match(/^#/)
          true
        end

        def after_initialize!
          input.render_current_text(
            to_interactive: true,
            to_output: false,
            expand_line: false
          )
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gm-notepad-0.0.18 lib/gm/notepad/input_handlers/comment_handler.rb
gm-notepad-0.0.17 lib/gm/notepad/input_handlers/comment_handler.rb
gm-notepad-0.0.16 lib/gm/notepad/input_handlers/comment_handler.rb
gm-notepad-0.0.15 lib/gm/notepad/input_handlers/comment_handler.rb
gm-notepad-0.0.14 lib/gm/notepad/input_handlers/comment_handler.rb
gm-notepad-0.0.13 lib/gm/notepad/input_handlers/comment_handler.rb
gm-notepad-0.0.12 lib/gm/notepad/input_handlers/comment_handler.rb
gm-notepad-0.0.11 lib/gm/notepad/input_handlers/comment_handler.rb