lab42_tmux2 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4abd846c0ceffd96881a405fe172b5f4c1aca28e
4
- data.tar.gz: 7f9214fcf575a8c4b375cd45adae78025d07656d
3
+ metadata.gz: aa6d271b6905b366c4b25b82446a8704b74c7472
4
+ data.tar.gz: 85114f4fe2219da5a411b0ab9cb08cd1ac12abd3
5
5
  SHA512:
6
- metadata.gz: 4b703dd7c02e5cf7c121cf56578fd17a38fb2d082b969f0d2f7666427cb36557e2412ab9cee18442eab5287eb79d02e07b7189ce8d0dbc387b035a1576f8569e
7
- data.tar.gz: 7036211a92294745df4317b40f7b2efe365e96730ab7f4ee638fb9609ed658c33c7fc78ae5ed569ff9d1282e9b04ae7771f123bfb4ab6c92f823c99aed21d50d
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
- **N.B.** This is a complete rewrite of tmux and it is **not** compatible, IOW do not
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/autoimport'
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/autoimport'
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
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Lab42
3
3
  module Tmux
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end # module Tmux
6
6
  end # module Lab42
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.3
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-10-08 00:00:00.000000000 Z
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/lab42_tmux
88
+ homepage: https://github.com/RobertDober/lab42_tmux2
89
89
  licenses:
90
90
  - MIT
91
91
  metadata: {}