Class: TextmateRush::Command

Inherits:
Object
  • Object
show all
Includes:
TextmateHelper
Defined in:
lib/textmate_rush/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TextmateHelper

#tm_current_word, #tm_directory, #tm_file, #tm_filename, #tm_project_directory

Constructor Details

#initializeCommand

Returns a new instance of Command.



5
6
7
# File 'lib/textmate_rush/command.rb', line 5

def initialize()
  self.shell = Rush::Shell.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



18
19
20
# File 'lib/textmate_rush/command.rb', line 18

def method_missing(sym, *args, &block)
  execute sym.to_s
end

Instance Attribute Details

#shellObject

Returns the value of attribute shell.



4
5
6
# File 'lib/textmate_rush/command.rb', line 4

def shell
  @shell
end

Instance Method Details

#execute(thing) ⇒ Object



13
14
15
16
# File 'lib/textmate_rush/command.rb', line 13

def execute(thing)
  shell.execute(thing)
  $last_res
end

#run(&block) ⇒ Object



9
10
11
# File 'lib/textmate_rush/command.rb', line 9

def run(&block)
  self.instance_eval(&block)
end