Skip to content

Commit 036cde8

Browse files
committed
Merge pull request #55 from ruby-debug/printer-delegation
Printer delegation
2 parents a266fd2 + 71a05cb commit 036cde8

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

lib/ruby-debug-ide/command.rb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
require 'ruby-debug-ide/helper'
2+
require 'delegate'
23

34
module Debugger
45

5-
class Command # :nodoc:
6+
class Command < SimpleDelegator # :nodoc:
67
SubcmdStruct=Struct.new(:name, :min, :short_help, :long_help) unless
78
defined?(SubcmdStruct)
89

@@ -67,6 +68,7 @@ def options
6768

6869
def initialize(state, printer)
6970
@state, @printer = state, printer
71+
super @printer
7072
end
7173

7274
def match(input)
@@ -75,15 +77,6 @@ def match(input)
7577

7678
protected
7779

78-
def method_missing(meth, *args, &block)
79-
if @printer.respond_to? meth
80-
@printer.send meth, *args, &block
81-
else
82-
super
83-
end
84-
end
85-
86-
# FIXME: use delegate?
8780
def errmsg(*args)
8881
@printer.print_error(*args)
8982
end

lib/ruby-debug-ide/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Debugger
2-
IDE_VERSION='0.4.23.beta4'
2+
IDE_VERSION='0.4.23.beta5'
33
end

0 commit comments

Comments
 (0)