terminitor 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
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
 
@@ -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'
@@ -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 { |c| "(#{c})" }.join(" && ")
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
@@ -1,3 +1,3 @@
1
1
  module Terminitor
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -22,7 +22,7 @@ context "Dsl" do
22
22
  setup { topic[:tabs] }
23
23
 
24
24
  asserts([:[], 'tab2']).equivalent_to({
25
- :commands=>["(echo 'named tab')", "(ls)"],
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'", "echo 'of window'", "echo 'than now'"]
33
+ :commands=>["echo 'first tab'", "motion &", "echo 'than now'"]
34
34
  })
35
35
 
36
36
  asserts([:[],'tab3']).equivalent_to({
37
- :commands=>["(top)"],
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=>["(ls)"],
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=>['(whoami) && (who) && (ls)']
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 ['(whoami)']
62
+ asserts([:[],:before]).equals ['whoami']
63
63
 
64
64
  context "with :tabs" do
65
65
  setup { topic[:tabs] }
@@ -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'", "echo 'of window'", "echo 'than now'"
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.0
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-03 00:00:00 -07:00
14
+ date: 2011-04-07 00:00:00 -07:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency