tabby2 0.2.1 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21319252f40ee8728aa3e3ea385703992193383939f2140f54375fbeaa1c36f7
4
- data.tar.gz: 1ac6dc464e39229135a630dc41f443a01a67e6892d3b1ed3b186a5775097658a
3
+ metadata.gz: 9217fbeee5b1f26fbf73dec860568ac375d5a1c0ff999d6cde92fc2c9d029dce
4
+ data.tar.gz: 648418f15d0e42ebc3cbc9bf16e493b42c4d90745ae2910eb586539302bb1880
5
5
  SHA512:
6
- metadata.gz: 5534eefdb0ebe76878015626b594d7c61ee2c9d5bea5f9d6138be17a997ae741f9bc038bf9df3253ea2982fb5ea05090092bdc44bcd38c41b22b40c1bf916ea0
7
- data.tar.gz: 2fbde15314b26b0048dab5cc7a8479665f5d7ef7b67c430820a325f7fa28e93f7ecc6cd2fb433e99e53d5599d52d778ab5a9a38b06d84bd6181ec30636b7857b
6
+ metadata.gz: d3e9933b15fb02e08b11ff8d22f1192927d2da6dcb6c27fd6ed3f820d91f70652a9df0c3619c11565b9d4a3b3cb88fa25b5faf901797b68111de42ba8107fb9e
7
+ data.tar.gz: 5cd109deaad484f1f30479348000f78359806b5b58e5c02996952c48afdab6114de003428266caf821b8b7b9f03c114f269c5074242d23d09b5eede2f57a8ffa
@@ -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
- ### Defining Environments
7
- Environments should be stored in `~/.tabby/`, using a simple and short name. We'll walk through building my `~/.tabby/blog.rb` environment.
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
- def jekyll
37
+ tab "jekyll" do
26
38
  exec "jekyll --auto --server"
27
39
  end
28
40
 
29
- def sass
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 Environment
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
@@ -1,6 +1,9 @@
1
1
  module Tabby
2
2
  class Base
3
- class << self; attr_reader :_basedir; end
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
@@ -1,11 +1,11 @@
1
1
  class SpecBlog < Tabby::Base
2
2
  basedir "~/Dev/Blog"
3
3
 
4
- def jekyll
4
+ tab "jekyll" do
5
5
  exec "jekyll --auto --server"
6
6
  end
7
7
 
8
- def sass
8
+ tab "sass" do
9
9
  exec "sass --watch public/css/main.sass:public/css/main.css"
10
10
  end
11
11
  end
@@ -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.2.1"
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"]
@@ -1,7 +1,7 @@
1
1
  class <%= klass %> < Tabby::Base
2
2
  basedir "~/Dev/<%= project %>"
3
3
 
4
- def server
4
+ tab "server" do
5
5
  exec "rails s"
6
6
  end
7
7
  end
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.2.1
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-06-03 00:00:00.000000000 Z
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
- rubyforge_project:
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.