lab42_tmux2 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +35 -4
- data/lib/lab42/tmux/session/commands.rb +1 -1
- data/lib/lab42/tmux/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa6d271b6905b366c4b25b82446a8704b74c7472
|
4
|
+
data.tar.gz: 85114f4fe2219da5a411b0ab9cb08cd1ac12abd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1725b3048d60964398e95a044267b781b86c354c8f921447529e36f145d976eb0d53b541054d3864b8667f4d050f50e16c855e9cda7149ababd0c07ca7c5a957
|
7
|
+
data.tar.gz: bd945cd058a3be6b6f93b5791fc533ed386947e7341556533b7426fae0c4ce3b49e2ff4d15c34cc06dc9dfe6658b1f8e2d2e068b52b5910011bdd8ac32fd7065
|
data/README.md
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
|
2
2
|
# Lab42 Programmer's Best Friend In Ruby2
|
3
3
|
|
4
|
-
## Tmux2
|
5
4
|
|
6
|
-
|
5
|
+
[![Build Status](https://travis-ci.org/RobertDober/lab42_tmux2.svg?branch=master)](https://travis-ci.org/RobertDober/lab42_tmux2)
|
6
|
+
[![Code Climate](https://codeclimate.com/github/RobertDober/lab42_tmux2/badges/gpa.svg)](https://codeclimate.com/github/RobertDober/lab42_tmux2)
|
7
|
+
[![Test Coverage](https://codeclimate.com/github/RobertDober/lab42_tmux2/badges/coverage.svg)](https://codeclimate.com/github/RobertDober/lab42_tmux2)
|
8
|
+
|
9
|
+
## lab42_Tmux2
|
10
|
+
|
11
|
+
**N.B.** This is a complete rewrite of lab42_tmux and it is **not** compatible, IOW do not
|
7
12
|
install both gems, they even occupy the same namespace.
|
8
13
|
|
9
14
|
These are the differences
|
@@ -21,7 +26,7 @@ A simple API for launching tmux sessions from Ruby scripts
|
|
21
26
|
### A simple example
|
22
27
|
|
23
28
|
```ruby
|
24
|
-
require 'lab42/tmux/
|
29
|
+
require 'lab42/tmux/auto_import'
|
25
30
|
|
26
31
|
session "vi_session" do
|
27
32
|
new_window 'vi' do
|
@@ -34,10 +39,22 @@ A simple API for launching tmux sessions from Ruby scripts
|
|
34
39
|
end
|
35
40
|
```
|
36
41
|
|
42
|
+
If a session named `vi_session` exists this will simply attach to it, thus the script is protected against multiple executions.
|
43
|
+
|
44
|
+
Otherwise this will open a new tmux session named `vi_session` and do the following:
|
45
|
+
|
46
|
+
* Source ~/.tmux.conf
|
47
|
+
|
48
|
+
* Change every window to the directory in which this script resides (can be changed in a `config` block as shown below)
|
49
|
+
|
50
|
+
* execute commands for the default window or other windows as specified above
|
51
|
+
|
52
|
+
For the time being this gem assumes you are not rebasing the window count in your config file.
|
53
|
+
|
37
54
|
### Configuration
|
38
55
|
|
39
56
|
```ruby
|
40
|
-
require 'lab42/tmux/
|
57
|
+
require 'lab42/tmux/auto_import'
|
41
58
|
|
42
59
|
config do
|
43
60
|
window_automatic_rename true # now there will be no `set-window-option -g automatic-rename off`
|
@@ -49,6 +66,20 @@ A simple API for launching tmux sessions from Ruby scripts
|
|
49
66
|
|
50
67
|
```
|
51
68
|
|
69
|
+
#### Configuration of `project_home`
|
70
|
+
|
71
|
+
By default `project_home` will be set to the directory of the client script (aka `File.dirname $0`), this can be changed in two ways:
|
72
|
+
|
73
|
+
```ruby
|
74
|
+
# ...
|
75
|
+
config do
|
76
|
+
project_home "/home/worxpace" # used instead of File.dirname $0
|
77
|
+
# or
|
78
|
+
project_home nil # remain in dir in which client script was launched
|
79
|
+
end
|
80
|
+
```
|
81
|
+
|
82
|
+
|
52
83
|
### Hooks
|
53
84
|
|
54
85
|
Add an `after_new_window` hook for tmux commands to be executed after the creation of a new
|
@@ -10,7 +10,7 @@ module Lab42
|
|
10
10
|
end
|
11
11
|
def new_window window_name, &block
|
12
12
|
@window_number += 1
|
13
|
-
command 'new-window', '-t', session_name, '-n', window_name
|
13
|
+
command 'new-window', '-t', session_name, '-n', "'#{window_name}'"
|
14
14
|
goto configuration.project_home
|
15
15
|
instance_exec( &@after_new_window_hook ) if @after_new_window_hook
|
16
16
|
instance_exec( &block ) if block
|
data/lib/lab42/tmux/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lab42_tmux2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Dober
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: forwarder2
|
@@ -85,7 +85,7 @@ files:
|
|
85
85
|
- lib/lab42/tmux/session/hooks.rb
|
86
86
|
- lib/lab42/tmux/session/parameter_helpers.rb
|
87
87
|
- lib/lab42/tmux/version.rb
|
88
|
-
homepage: https://github.com/RobertDober/
|
88
|
+
homepage: https://github.com/RobertDober/lab42_tmux2
|
89
89
|
licenses:
|
90
90
|
- MIT
|
91
91
|
metadata: {}
|