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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53af5daf1e2193c29b0a85affdb4fc72b739b536
4
- data.tar.gz: 76fe05372f8e0252556ae26cbcb98f40579dca4c
3
+ metadata.gz: 85b63f2a2697dfa9be0ef1b209e308f5ffce4480
4
+ data.tar.gz: fe1606f7147b1bb5ca3f1283477f2796f83f163a
5
5
  SHA512:
6
- metadata.gz: 80b1a5981d257825a5ac9478c2e0dc089f4898a2ad17e49eb78d189227f3e46348fefe196b1b79b061237a28f1ee6730a5ccb5c22f7bf536d7f22cd37d64a0e8
7
- data.tar.gz: b19c74aa98d105879a6374e9d92639906338d0dca952055c07d1af8f974421a69894d4d82e97c46136a68b8a6c209e4b107fddb2c4715e28655e16b752147529
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
- [![travis-ci](https://travis-ci.org/junegunn/heytmux.svg?branch=master)](https://travis-ci.org/junegunn/heytmux) [![Coverage Status](https://coveralls.io/repos/github/junegunn/heytmux/badge.svg?branch=master)](https://coveralls.io/github/junegunn/heytmux?branch=master)
4
+ [![travis-ci](https://travis-ci.org/junegunn/heytmux.svg?branch=master)](https://travis-ci.org/junegunn/heytmux)
5
+ [![Coverage Status](https://coveralls.io/repos/github/junegunn/heytmux/badge.svg?branch=master)](https://coveralls.io/github/junegunn/heytmux?branch=master)
6
+ [![Gem](https://img.shields.io/gem/v/heytmux.svg)](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
 
@@ -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
- raise ArgumentError, message unless single_spec?(pane_spec)
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 string to
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? && !key.to_s.empty? &&
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Heytmux
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
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.0
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-06 00:00:00.000000000 Z
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.11
140
+ rubygems_version: 2.6.8
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Hey tmux!