tabby2 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +19 -7
- data/lib/tabby/base.rb +20 -4
- data/spec/.tabby/spec_blog.rb +2 -2
- data/tabby2.gemspec +1 -1
- data/templates/project.rb.erb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9217fbeee5b1f26fbf73dec860568ac375d5a1c0ff999d6cde92fc2c9d029dce
|
4
|
+
data.tar.gz: 648418f15d0e42ebc3cbc9bf16e493b42c4d90745ae2910eb586539302bb1880
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3e9933b15fb02e08b11ff8d22f1192927d2da6dcb6c27fd6ed3f820d91f70652a9df0c3619c11565b9d4a3b3cb88fa25b5faf901797b68111de42ba8107fb9e
|
7
|
+
data.tar.gz: 5cd109deaad484f1f30479348000f78359806b5b58e5c02996952c48afdab6114de003428266caf821b8b7b9f03c114f269c5074242d23d09b5eede2f57a8ffa
|
data/README.markdown
CHANGED
@@ -3,8 +3,20 @@ Tabby is a simple iTerm2 environment configuration tool. It allows you to create
|
|
3
3
|
|
4
4
|
## Usage
|
5
5
|
|
6
|
-
###
|
7
|
-
|
6
|
+
### Install
|
7
|
+
|
8
|
+
`gem install tabby2`
|
9
|
+
|
10
|
+
### Creating Projects
|
11
|
+
|
12
|
+
`tabby create PROJECT_NAME`
|
13
|
+
|
14
|
+
### Listing Projects
|
15
|
+
|
16
|
+
`tabby list`
|
17
|
+
|
18
|
+
### Editing Projects
|
19
|
+
Projects are stored in `~/.tabby/`, using a simple and short name. You can edit them at anytime by running `tabby edit PROJECT_NAME`
|
8
20
|
|
9
21
|
Tabby environments are just regular Ruby classes. The filename and classname should match, with the classname following regular Ruby standards:
|
10
22
|
|
@@ -22,21 +34,21 @@ Creating tabs is just a matter of creating methods. There should be one method p
|
|
22
34
|
class Blog < Tabby::Base
|
23
35
|
basedir "~/Dev/Blog"
|
24
36
|
|
25
|
-
|
37
|
+
tab "jekyll" do
|
26
38
|
exec "jekyll --auto --server"
|
27
39
|
end
|
28
40
|
|
29
|
-
|
41
|
+
tab "sass" do
|
30
42
|
exec "sass --watch public/css/main.sass:public/css/main.css"
|
31
43
|
end
|
32
44
|
end
|
33
45
|
|
34
46
|
Each tab will start off by `cd`'ing into the environment's `basedir`. Then it will execute it's list of commands in order.
|
35
47
|
|
36
|
-
### Starting An
|
37
|
-
tabby blog
|
48
|
+
### Starting An Project
|
49
|
+
tabby open blog
|
38
50
|
|
39
51
|
![tabby](https://github.com/mnoble/tabby/raw/master/screenshot.png)
|
40
52
|
|
41
53
|
## License
|
42
|
-
See LICENSE
|
54
|
+
See LICENSE
|
data/lib/tabby/base.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
module Tabby
|
2
2
|
class Base
|
3
|
-
class << self
|
3
|
+
class << self
|
4
|
+
attr_reader :_basedir
|
5
|
+
attr_reader :_tabs
|
6
|
+
end
|
4
7
|
|
5
8
|
# Sets the project root directory.
|
6
9
|
#
|
@@ -11,6 +14,12 @@ module Tabby
|
|
11
14
|
@_basedir = dir
|
12
15
|
end
|
13
16
|
|
17
|
+
# define a tab
|
18
|
+
def self.tab(name, &block)
|
19
|
+
@_tabs ||= []
|
20
|
+
@_tabs << [name, block]
|
21
|
+
end
|
22
|
+
|
14
23
|
# List of commands for the current tab to execute.
|
15
24
|
attr_accessor :commands
|
16
25
|
|
@@ -25,7 +34,7 @@ module Tabby
|
|
25
34
|
end
|
26
35
|
|
27
36
|
# Queue a command to be executed when the tab gets created.
|
28
|
-
#
|
37
|
+
#
|
29
38
|
# Parameters:
|
30
39
|
# command bash/zsh/etc command to be executed
|
31
40
|
#
|
@@ -38,12 +47,19 @@ module Tabby
|
|
38
47
|
# with spaces.
|
39
48
|
#
|
40
49
|
def call
|
41
|
-
self.class.instance_methods(false).each do |method|
|
50
|
+
self.class.instance_methods(false).sort.each do |method|
|
42
51
|
@commands = []
|
43
|
-
@title = method
|
52
|
+
@title = method.gsub("_", " ")
|
44
53
|
send(method)
|
45
54
|
create_tab
|
46
55
|
end
|
56
|
+
|
57
|
+
self.class._tabs.each do |title, block|
|
58
|
+
@commands = []
|
59
|
+
@title = title
|
60
|
+
self.instance_exec(&block)
|
61
|
+
create_tab
|
62
|
+
end
|
47
63
|
end
|
48
64
|
|
49
65
|
# Project's base directory. Each tab +cd+'s into this
|
data/spec/.tabby/spec_blog.rb
CHANGED
data/tabby2.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "tabby2"
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.3.0"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Jacques Crocker", "Matte Noble"]
|
9
9
|
s.email = ["jacques@nodeknockout.com", "me@mattenoble.com"]
|
data/templates/project.rb.erb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tabby2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacques Crocker
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -125,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
|
-
|
129
|
-
rubygems_version: 2.7.5
|
128
|
+
rubygems_version: 3.0.1
|
130
129
|
signing_key:
|
131
130
|
specification_version: 4
|
132
131
|
summary: Simple iTerm2 project environment setup.
|