terminitor 0.5.0 → 0.5.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.
- data/README.md +2 -1
- data/lib/terminitor.rb +2 -2
- data/lib/terminitor/dsl.rb +4 -2
- data/lib/terminitor/version.rb +1 -1
- data/test/dsl_test.rb +6 -6
- data/test/fixtures/bar.term +2 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -371,7 +371,8 @@ Thanks to the following people for their contributions so far:
|
|
371
371
|
* Ilkka Laukkanen ([ilkka](https://github.com/achiu/terminitor/commits/master?author=ilkka)) for Terminator core and other fixes
|
372
372
|
* Elia Schito ([elia](https://github.com/achiu/terminitor/commits/master?author=elia)) for patch to allow usage of "&" for background operations
|
373
373
|
* Dotan J. Nahum ([[jondot](https://github.com/jondot)) for adding windows(cmd.exe) support
|
374
|
-
|
374
|
+
* Kyriacos Souroullas ([[kyriacos](https://github.com/kyriacos) For removing params to support generic commands
|
375
|
+
|
375
376
|
Acknowledgements
|
376
377
|
-----------------
|
377
378
|
|
data/lib/terminitor.rb
CHANGED
@@ -14,9 +14,9 @@ module Terminitor
|
|
14
14
|
when %r{darwin}
|
15
15
|
require 'appscript'
|
16
16
|
autoload :MacCore, 'terminitor/cores/mac_core'
|
17
|
-
autoload :MacCapture, 'terminitor/capture/mac_capture'
|
17
|
+
autoload :MacCapture, 'terminitor/capture/mac_capture'
|
18
18
|
autoload :ItermCore, 'terminitor/cores/iterm_core'
|
19
|
-
autoload :ItermCapture, 'terminitor/capture/iterm_capture'
|
19
|
+
autoload :ItermCapture, 'terminitor/capture/iterm_capture'
|
20
20
|
when %r{linux}
|
21
21
|
require 'dbus'
|
22
22
|
autoload :KonsoleCore, 'terminitor/cores/konsole_core'
|
data/lib/terminitor/dsl.rb
CHANGED
@@ -45,12 +45,14 @@ module Terminitor
|
|
45
45
|
# run 'brew update'
|
46
46
|
def run(*commands)
|
47
47
|
# if we are in a window context, append commands to default tab.
|
48
|
-
if @_context.is_a?(Hash) && @_context[:tabs]
|
48
|
+
if @_context.is_a?(Hash) && @_context[:tabs]
|
49
49
|
current = @_context[:tabs]['default'][:commands]
|
50
50
|
else
|
51
51
|
current = @_context
|
52
52
|
end
|
53
|
-
current << commands.map
|
53
|
+
current << commands.map do |c|
|
54
|
+
c =~ /&$/ ? "(#{c})" : c
|
55
|
+
end.join(" && ")
|
54
56
|
end
|
55
57
|
|
56
58
|
# runs commands before each tab in window context
|
data/lib/terminitor/version.rb
CHANGED
data/test/dsl_test.rb
CHANGED
@@ -22,7 +22,7 @@ context "Dsl" do
|
|
22
22
|
setup { topic[:tabs] }
|
23
23
|
|
24
24
|
asserts([:[], 'tab2']).equivalent_to({
|
25
|
-
:commands=>["
|
25
|
+
:commands=>["echo 'named tab'", "ls"],
|
26
26
|
:options => {
|
27
27
|
:name => "named tab",
|
28
28
|
:settings=>"Grass"
|
@@ -30,11 +30,11 @@ context "Dsl" do
|
|
30
30
|
})
|
31
31
|
|
32
32
|
asserts([:[], 'tab1']).equivalent_to({
|
33
|
-
:commands=>["echo 'first tab'", "
|
33
|
+
:commands=>["echo 'first tab'", "motion &", "echo 'than now'"]
|
34
34
|
})
|
35
35
|
|
36
36
|
asserts([:[],'tab3']).equivalent_to({
|
37
|
-
:commands=>["(
|
37
|
+
:commands=>["top","(mate &) && (gitx &) && cd /this"],
|
38
38
|
:options =>{
|
39
39
|
:name => "a tab",
|
40
40
|
:settings => "Pro"
|
@@ -42,7 +42,7 @@ context "Dsl" do
|
|
42
42
|
})
|
43
43
|
|
44
44
|
asserts([:[],'tab4']).equivalent_to({
|
45
|
-
:commands=>["
|
45
|
+
:commands=>["ls"],
|
46
46
|
:options =>{
|
47
47
|
:name => "another named tab",
|
48
48
|
:settings => "Grass"
|
@@ -50,7 +50,7 @@ context "Dsl" do
|
|
50
50
|
})
|
51
51
|
|
52
52
|
asserts([:[],'default']).equivalent_to({
|
53
|
-
:commands=>['
|
53
|
+
:commands=>['whoami && who && ls']
|
54
54
|
})
|
55
55
|
end
|
56
56
|
|
@@ -59,7 +59,7 @@ context "Dsl" do
|
|
59
59
|
context "with 'window2' key" do
|
60
60
|
setup { topic['window2'] }
|
61
61
|
|
62
|
-
asserts([:[],:before]).equals ['
|
62
|
+
asserts([:[],:before]).equals ['whoami']
|
63
63
|
|
64
64
|
context "with :tabs" do
|
65
65
|
setup { topic[:tabs] }
|
data/test/fixtures/bar.term
CHANGED
@@ -10,7 +10,7 @@ window :size => [70,30] do
|
|
10
10
|
before 'cd /path'
|
11
11
|
|
12
12
|
run "whoami","who", "ls"
|
13
|
-
tab "echo 'first tab'", "
|
13
|
+
tab "echo 'first tab'", "motion &", "echo 'than now'"
|
14
14
|
|
15
15
|
tab :name => "named tab", :settings => "Grass" do
|
16
16
|
run "echo 'named tab'"
|
@@ -19,6 +19,7 @@ window :size => [70,30] do
|
|
19
19
|
|
20
20
|
tab "a tab", :settings => "Pro" do
|
21
21
|
run "top"
|
22
|
+
run "mate &", "gitx &", "cd /this"
|
22
23
|
end
|
23
24
|
|
24
25
|
tab("another named tab", :settings => 'Grass') { run "ls" }
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: terminitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.5.
|
5
|
+
version: 0.5.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Arthur Chiu
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-04-
|
14
|
+
date: 2011-04-07 00:00:00 -07:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|