heytmux 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +5 -1
- data/lib/heytmux/validations.rb +14 -4
- data/lib/heytmux/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: 85b63f2a2697dfa9be0ef1b209e308f5ffce4480
|
4
|
+
data.tar.gz: fe1606f7147b1bb5ca3f1283477f2796f83f163a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 166da8ba7bc7393509acffe0f43b0c72209ca2c8e41f3467b10d77a0f9081a858342ade4e3d7d8f94cd247891844577bf80c7a255deacb7c588e0b6a6b9b1662
|
7
|
+
data.tar.gz: 1289e4ec84118413d2868ebd91eb2c4ae5b0aacfdab632181bedf83c46d2ea805bb51a96069b63b275b0e294060bb49dfe1552daa66b0fb8a7621d463132f063
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
Hey tmux!
|
2
2
|
=========
|
3
3
|
|
4
|
-
[](https://travis-ci.org/junegunn/heytmux)
|
4
|
+
[](https://travis-ci.org/junegunn/heytmux)
|
5
|
+
[](https://coveralls.io/github/junegunn/heytmux?branch=master)
|
6
|
+
[](https://rubygems.org/gems/heytmux)
|
5
7
|
|
6
8
|
Tmux scripting made easy.
|
7
9
|
|
@@ -219,6 +221,8 @@ expanded according to the list.
|
|
219
221
|
- pane {{item}}: sleep {{item}}
|
220
222
|
```
|
221
223
|
|
224
|
+
Note that you have to quote a pane title if it starts with `{{ item }}`.
|
225
|
+
|
222
226
|
This is often useful when you have to work with a series of log files or with
|
223
227
|
a set of servers.
|
224
228
|
|
data/lib/heytmux/validations.rb
CHANGED
@@ -55,7 +55,13 @@ module Heytmux
|
|
55
55
|
message = "Not a valid pane spec: #{pane_spec.inspect}"
|
56
56
|
case pane_spec
|
57
57
|
when Hash
|
58
|
-
|
58
|
+
unless single_spec?(pane_spec)
|
59
|
+
if unquoted_pane_title?(pane_spec)
|
60
|
+
message = 'Invalid pane title. ' \
|
61
|
+
'Make sure to quote pane titles that start with {{ item }}.'
|
62
|
+
end
|
63
|
+
raise ArgumentError, message
|
64
|
+
end
|
59
65
|
validate_commands(pane_spec.first.last)
|
60
66
|
else
|
61
67
|
raise ArgumentError, message unless valid_name?(pane_spec)
|
@@ -87,11 +93,11 @@ module Heytmux
|
|
87
93
|
action.validate(body)
|
88
94
|
end
|
89
95
|
|
90
|
-
# Checks if the given hash only contains one mapping from a
|
91
|
-
# a hash
|
96
|
+
# Checks if the given hash only contains one mapping from a non-empty
|
97
|
+
# string to a hash
|
92
98
|
def single_spec?(spec, *klasses)
|
93
99
|
(key, value), second = spec.take(2)
|
94
|
-
second.nil? &&
|
100
|
+
second.nil? && valid_name?(key) &&
|
95
101
|
(klasses.empty? || klasses.any? { |k| value.is_a?(k) })
|
96
102
|
end
|
97
103
|
|
@@ -102,5 +108,9 @@ module Heytmux
|
|
102
108
|
def valid_name?(value)
|
103
109
|
valid_string?(value) && !value.to_s.empty?
|
104
110
|
end
|
111
|
+
|
112
|
+
def unquoted_pane_title?(pane_spec)
|
113
|
+
pane_spec.inspect.include?('{{"item"')
|
114
|
+
end
|
105
115
|
end
|
106
116
|
end
|
data/lib/heytmux/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heytmux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Junegunn Choi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.6.
|
140
|
+
rubygems_version: 2.6.8
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Hey tmux!
|