termup 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +50 -32
- data/lib/termup/cli.rb +14 -12
- data/lib/termup/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -1,18 +1,22 @@
|
|
1
1
|
Termup
|
2
2
|
======
|
3
3
|
|
4
|
-
|
4
|
+
Automate opening up terminal tabs (or split panes) with a set of routine commands.
|
5
5
|
|
6
|
-
|
6
|
+
It's the easiest way to get started for your projects every day.
|
7
7
|
|
8
|
-
|
8
|
+
Compatible with Terminal.app, iTerm and iTerm2 on Mac OS X 10.6 - 10.8 and Ruby 1.8.7 - 1.9.3.
|
9
9
|
|
10
10
|
![Split Panes](https://github.com/kenn/termup/raw/master/images/split_panes.png)
|
11
11
|
|
12
12
|
Installation
|
13
13
|
------------
|
14
14
|
|
15
|
-
|
15
|
+
```sh
|
16
|
+
$ gem install termup
|
17
|
+
```
|
18
|
+
|
19
|
+
Note that you need to prepend `sudo` if you're using the OSX pre-installed Ruby.
|
16
20
|
|
17
21
|
Usage
|
18
22
|
-----
|
@@ -21,38 +25,46 @@ Usage
|
|
21
25
|
|
22
26
|
Call the following command:
|
23
27
|
|
24
|
-
|
28
|
+
```sh
|
29
|
+
$ termup create new_project
|
30
|
+
```
|
25
31
|
|
26
32
|
This will create a new project at `~/.config/termup/new_project.yml`. Edit the file:
|
27
33
|
|
28
|
-
|
34
|
+
```sh
|
35
|
+
$ termup edit new_project
|
36
|
+
```
|
29
37
|
|
30
38
|
And now you're good to go:
|
31
39
|
|
32
|
-
|
40
|
+
```sh
|
41
|
+
$ termup start new_project
|
42
|
+
```
|
33
43
|
|
34
44
|
### YAML Syntax ###
|
35
45
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
46
|
+
```yaml
|
47
|
+
# ~/.config/termup/new_project.yml
|
48
|
+
---
|
49
|
+
tabs:
|
50
|
+
- tab1:
|
51
|
+
- cd ~/projects/foo
|
52
|
+
- git status
|
53
|
+
- mate .
|
54
|
+
- tab2:
|
55
|
+
- mysql -u root
|
56
|
+
- show databases;
|
57
|
+
- tab3:
|
58
|
+
- cd ~/projects/foo
|
59
|
+
- tail -f log/development.log
|
60
|
+
- tab4:
|
61
|
+
- cd ~/projects/foo
|
62
|
+
- autotest
|
63
|
+
options:
|
64
|
+
iterm:
|
65
|
+
width: 2
|
66
|
+
height: 2
|
67
|
+
```
|
56
68
|
|
57
69
|
Tabs can contain a single command, or YAML arrays to execute multiple commands.
|
58
70
|
|
@@ -60,7 +72,9 @@ Tabs can contain a single command, or YAML arrays to execute multiple commands.
|
|
60
72
|
|
61
73
|
Commands have a shortcut for even fewer keystrokes.
|
62
74
|
|
63
|
-
|
75
|
+
```sh
|
76
|
+
$ termup s new_project
|
77
|
+
```
|
64
78
|
|
65
79
|
That's equivalent to `termup start new_project`.
|
66
80
|
|
@@ -68,10 +82,12 @@ That's equivalent to `termup start new_project`.
|
|
68
82
|
|
69
83
|
Specify iTerm option to use split pane.
|
70
84
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
85
|
+
```yaml
|
86
|
+
options:
|
87
|
+
iterm:
|
88
|
+
width: 2
|
89
|
+
height: 2
|
90
|
+
```
|
75
91
|
|
76
92
|
The setting above turns to:
|
77
93
|
|
@@ -84,3 +100,5 @@ The setting above turns to:
|
|
84
100
|
# 2 # 4 #
|
85
101
|
# # #
|
86
102
|
#################
|
103
|
+
|
104
|
+
Enjoy!
|
data/lib/termup/cli.rb
CHANGED
@@ -12,31 +12,33 @@ module Termup
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
map
|
16
|
-
map
|
17
|
-
map
|
18
|
-
map
|
15
|
+
map 'c' => :create
|
16
|
+
map 'e' => :edit
|
17
|
+
map 'l' => :list
|
18
|
+
map 's' => :start
|
19
19
|
|
20
|
-
desc
|
20
|
+
desc 'create PROJECT', 'Create termup project (Shortcut: c)'
|
21
21
|
def create(project)
|
22
|
-
|
23
|
-
template "templates/template.yml", path(project)
|
22
|
+
edit(project)
|
24
23
|
end
|
25
24
|
|
26
|
-
desc
|
25
|
+
desc 'edit PROJECT', 'Edit termup project (Shortcut: e)'
|
27
26
|
def edit(project)
|
28
|
-
|
29
|
-
|
27
|
+
unless File.exists?(path(project))
|
28
|
+
empty_directory TERMUP_DIR
|
29
|
+
template 'templates/template.yml', path(project)
|
30
|
+
end
|
31
|
+
say 'please set $EDITOR in ~/.bash_profile' and return unless editor = ENV['EDITOR']
|
30
32
|
system("#{editor} #{path(project)}")
|
31
33
|
end
|
32
34
|
|
33
|
-
desc
|
35
|
+
desc 'list', 'List termup projects (Shortcut: l)'
|
34
36
|
def list
|
35
37
|
projects = Dir["#{TERMUP_DIR}/*.yml"].map{|file| File.basename(file,'.yml') }
|
36
38
|
say "Your projects: #{projects.join(', ')}"
|
37
39
|
end
|
38
40
|
|
39
|
-
desc
|
41
|
+
desc 'start PROJECT', 'Start termup project (Shortcut: s)'
|
40
42
|
def start(project)
|
41
43
|
say "project \"#{project}\" doesn't exist!" and return unless File.exists?(path(project))
|
42
44
|
Termup::Base.new(project)
|
data/lib/termup/version.rb
CHANGED