Class: Lab42::Tmux
- Defined in:
- lib/lab42/tmux.rb,
lib/lab42/tmux/window.rb,
lib/lab42/tmux/command.rb,
lib/lab42/tmux/helpers.rb,
lib/lab42/tmux/version.rb,
lib/lab42/tmux/commands.rb,
lib/lab42/tmux/current_window.rb,
lib/lab42/tmux/window/command.rb,
lib/lab42/tmux/predefined/ruby_session.rb,
lib/lab42/tmux/predefined/tmux_session.rb,
lib/lab42/tmux/window/command/vim_command.rb,
lib/lab42/tmux/predefined/abstract_session.rb
Defined Under Namespace
Modules: Command, Commands, CurrentWindow, Helpers, Predefined Classes: Window
Constant Summary collapse
- VERSION =
"0.0.3"
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#project_home ⇒ Object
readonly
Returns the value of attribute project_home.
-
#session_name ⇒ Object
readonly
Returns the value of attribute session_name.
-
#windows ⇒ Object
readonly
Returns the value of attribute windows.
Attributes included from Commands
Instance Method Summary collapse
- #add_window(name = nil, options = {}, &blk) ⇒ Object
- #current_window ⇒ Object
- #current_window? ⇒ Boolean
- #exec! ⇒ Object
- #render ⇒ Object
Methods included from Helpers
Methods included from Command
#tmux_increase_current_window_number, #tmux_new_session, #tmux_new_window, #tmux_open_irb, #tmux_open_vim, #tmux_prefixed_command, #tmux_project_home, #tmux_register_window_command, #tmux_send_keys, #tmux_set_window_option, #tmux_set_window_options
Methods included from CurrentWindow
#tmux_current_window, #tmux_current_window_command, #tmux_current_window_designation, #tmux_current_window_number, #tmux_current_window_number=
Methods included from Commands
#lprefix, #tmux, #tmux_source_file
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
17 18 19 |
# File 'lib/lab42/tmux.rb', line 17 def commands @commands end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
17 18 19 |
# File 'lib/lab42/tmux.rb', line 17 def @options end |
#project_home ⇒ Object (readonly)
Returns the value of attribute project_home.
17 18 19 |
# File 'lib/lab42/tmux.rb', line 17 def project_home @project_home end |
#session_name ⇒ Object (readonly)
Returns the value of attribute session_name.
17 18 19 |
# File 'lib/lab42/tmux.rb', line 17 def session_name @session_name end |
#windows ⇒ Object (readonly)
Returns the value of attribute windows.
17 18 19 |
# File 'lib/lab42/tmux.rb', line 17 def windows @windows end |
Instance Method Details
#add_window(name = nil, options = {}, &blk) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/lab42/tmux.rb', line 19 def add_window name=nil, ={}, &blk window = Window.new windows.size.succ, self, name: name, command: [:command] windows << window window.instance_eval_or_call blk if blk end |
#current_window ⇒ Object
26 |
# File 'lib/lab42/tmux.rb', line 26 def current_window; windows.last end |
#current_window? ⇒ Boolean
27 |
# File 'lib/lab42/tmux.rb', line 27 def current_window?; !!current_window end |
#exec! ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/lab42/tmux.rb', line 29 def exec! if .dry_run puts render else exec render end end |
#render ⇒ Object
37 38 39 |
# File 'lib/lab42/tmux.rb', line 37 def render (commands + final_attach_command).join "\n" end |