termup 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +50 -32
  2. data/lib/termup/cli.rb +14 -12
  3. data/lib/termup/version.rb +1 -1
  4. metadata +1 -1
data/README.md CHANGED
@@ -1,18 +1,22 @@
1
1
  Termup
2
2
  ======
3
3
 
4
- Initialize your terminal tabs (or split panes) with preset commands.
4
+ Automate opening up terminal tabs (or split panes) with a set of routine commands.
5
5
 
6
- Compatible with Terminal.app, iTerm and iTerm2 on Mac OS X 10.6 and Ruby 1.9.2 / 1.8.7.
6
+ It's the easiest way to get started for your projects every day.
7
7
 
8
- Ever wanted to automate everyday routine on the terminal in a simple way? Termup is right here for you.
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
- $ gem install termup
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
- $ termup create new_project
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
- $ termup edit new_project
34
+ ```sh
35
+ $ termup edit new_project
36
+ ```
29
37
 
30
38
  And now you're good to go:
31
39
 
32
- $ termup start new_project
40
+ ```sh
41
+ $ termup start new_project
42
+ ```
33
43
 
34
44
  ### YAML Syntax ###
35
45
 
36
- # ~/.config/termup/new_project.yml
37
- ---
38
- tabs:
39
- - tab1:
40
- - cd ~/projects/foo
41
- - git status
42
- - mate .
43
- - tab2:
44
- - mysql -u root
45
- - show databases;
46
- - tab3:
47
- - cd ~/projects/foo
48
- - tail -f log/development.log
49
- - tab4:
50
- - cd ~/projects/foo
51
- - autotest
52
- options:
53
- iterm:
54
- width: 2
55
- height: 2
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
- $ termup s new_project
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
- options:
72
- iterm:
73
- width: 2
74
- height: 2
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 "c" => :create
16
- map "e" => :edit
17
- map "l" => :list
18
- map "s" => :start
15
+ map 'c' => :create
16
+ map 'e' => :edit
17
+ map 'l' => :list
18
+ map 's' => :start
19
19
 
20
- desc "create PROJECT", "Create termup project (Shortcut: c)"
20
+ desc 'create PROJECT', 'Create termup project (Shortcut: c)'
21
21
  def create(project)
22
- empty_directory TERMUP_DIR
23
- template "templates/template.yml", path(project)
22
+ edit(project)
24
23
  end
25
24
 
26
- desc "edit PROJECT", "Edit termup project (Shortcut: e)"
25
+ desc 'edit PROJECT', 'Edit termup project (Shortcut: e)'
27
26
  def edit(project)
28
- create(project) unless File.exists?(path(project))
29
- say "please set $EDITOR in your .bash_profile." and return unless editor = ENV['EDITOR']
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 "list", "List termup projects (Shortcut: l)"
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 "start PROJECT", "Start termup project (Shortcut: s)"
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)
@@ -1,3 +1,3 @@
1
1
  module Termup
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: