Class: Windows::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/windows/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, path) ⇒ Project

Returns a new instance of Project.



8
9
10
11
12
# File 'lib/windows/project.rb', line 8

def initialize(name, path)
  @windows = Array.new
  @root    = Pathname.new(path).expand_path
  @name    = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/windows/project.rb', line 6

def name
  @name
end

#rootObject (readonly)

Returns the value of attribute root.



6
7
8
# File 'lib/windows/project.rb', line 6

def root
  @root
end

#windowsObject (readonly)

Returns the value of attribute windows.



6
7
8
# File 'lib/windows/project.rb', line 6

def windows
  @windows
end

Instance Method Details

#closeObject



14
15
16
# File 'lib/windows/project.rb', line 14

def close
  windows.each(&:close)
end

#default_terminalObject



25
26
27
# File 'lib/windows/project.rb', line 25

def default_terminal
  open_window(Windows::ActiveWindowKey)
end

#open_window(command, opts = {}) {|window| ... } ⇒ Object

Yields:

  • (window)


18
19
20
21
22
23
# File 'lib/windows/project.rb', line 18

def open_window(command, opts = {}, &block)
  window = Windows::Window.new(command, opts).create
  yield window if block_given?
  windows.push(window)
  window
end