chid 0.1.6 → 0.2.2
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 +4 -4
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +27 -0
- data/CONTRIBUTING.md +78 -0
- data/Gemfile.lock +34 -34
- data/README.md +135 -89
- data/bin/chid +2 -25
- data/chid.gemspec +0 -6
- data/lib/chid.rb +0 -66
- data/lib/chid/chid_config.rb +6 -83
- data/lib/chid/command.rb +1 -1
- data/lib/chid/commands/alias/create.rb +53 -0
- data/lib/chid/commands/config.rb +48 -0
- data/lib/chid/commands/currency/convert.rb +50 -0
- data/lib/chid/commands/currency/list.rb +34 -0
- data/lib/chid/commands/currency/now.rb +47 -0
- data/lib/chid/commands/gitflow/commit.rb +0 -1
- data/lib/chid/commands/github.rb +40 -0
- data/lib/chid/commands/init.rb +1 -2
- data/lib/chid/commands/install.rb +1 -0
- data/lib/chid/commands/installs/dotfile.rb +27 -11
- data/lib/chid/commands/installs/node.rb +5 -3
- data/lib/chid/commands/installs/postgres.rb +6 -3
- data/lib/chid/commands/installs/rvm.rb +9 -4
- data/lib/chid/commands/installs/vim.rb +69 -0
- data/lib/chid/commands/pr.rb +63 -0
- data/lib/chid/commands/tmux/open.rb +3 -2
- data/lib/chid/commands/workstation/create.rb +101 -0
- data/lib/chid/commands/workstation/destroy.rb +61 -0
- data/lib/chid/commands/workstation/open.rb +4 -4
- data/lib/chid/github_api.rb +9 -0
- data/lib/chid/version.rb +1 -1
- data/spec/lib/chid/commands/alias/create_spec.rb +55 -0
- data/spec/lib/chid/commands/init_spec.rb +4 -2
- data/spec/lib/chid/commands/pr_spec.rb +68 -0
- data/spec/lib/chid/commands/workstation/create_spec.rb +153 -0
- data/spec/support/.bashrc +7 -0
- data/spec/support/.chid.config +7 -0
- data/tasks/install/yadr_dotfiles.rake +1 -0
- data/tasks/run/postgres.rake +1 -0
- data/tasks/update/os.rake +1 -0
- metadata +21 -58
- data/#README.md# +0 -221
- data/Rakefile +0 -18
- data/lib/chid/yandex_translate_api.rb +0 -39
- data/tasks/chid/config.rake +0 -5
- data/tasks/chid/init.rake +0 -19
- data/tasks/chid/install.rake +0 -14
- data/tasks/chid/start.rake +0 -26
- data/tasks/chid/update.rake +0 -14
- data/tasks/currency/convert.rake +0 -9
- data/tasks/currency/current.rake +0 -11
- data/tasks/currency/list.rake +0 -10
- data/tasks/github.rake +0 -12
- data/tasks/help.rake +0 -178
- data/tasks/install/node.rake +0 -18
- data/tasks/install/postgres.rake +0 -18
- data/tasks/install/rvm.rake +0 -21
- data/tasks/news.rake +0 -11
- data/tasks/stack_overflow.rake +0 -20
- data/tasks/tmux/config_windows.rake +0 -8
- data/tasks/tmux/new_session.rake +0 -9
- data/tasks/translate/yandex_list.rake +0 -7
- data/tasks/translate/yandex_translate.rake +0 -8
- data/tasks/workstation/create.rake +0 -23
- data/tasks/workstation/destroy.rake +0 -14
- data/tasks/workstation/list.rake +0 -10
- data/tasks/workstation/open.rake +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4c0781e14ef22978392d80819ff7b1835bc5b7c8396e1d8f1a9ad36b296cb66
|
4
|
+
data.tar.gz: 836462ef8b68c6edda4c9c783f04caef9830dff476af59ea5072bbbf5f6a66a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeaedc1bb901c77c9d3650e4dc180511f1f277eb932e41f46cfeffee4917c053f0bd6c8270b7c7607941d7e6f4c1967ff5ac499d01b6f3079bba5c0a9078500a
|
7
|
+
data.tar.gz: '0307939c58378866fdb7fec4431af85023ff06281929cba8ab5f354db36fe11612a9be20d4bdba693b191e98131a573ec63ad1fb957b8b96fc7de784a12b915e'
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
chid
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.6.5
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,30 @@
|
|
1
|
+
### 0.2.2
|
2
|
+
|
3
|
+
* Update:
|
4
|
+
- Install Commands
|
5
|
+
- Replace old dotfiles for Chid files config ofr zsh, vimrc and tmux
|
6
|
+
|
7
|
+
### 0.2.1
|
8
|
+
|
9
|
+
* Update:
|
10
|
+
- Way to get correctly the ChidConfig instance for Tmux and Workstation Commands
|
11
|
+
|
12
|
+
### 0.2.0
|
13
|
+
|
14
|
+
* Add:
|
15
|
+
- Chid config Command
|
16
|
+
- Chid currency Commands
|
17
|
+
- Chid github Command
|
18
|
+
|
19
|
+
* Remove:
|
20
|
+
- All unecessary rake tasks
|
21
|
+
- Translate feature
|
22
|
+
|
23
|
+
### 0.1.6.1
|
24
|
+
|
25
|
+
* Update:
|
26
|
+
- Chid tmux and workstation Commands to be used for ruby versions 2.5+
|
27
|
+
|
1
28
|
### 0.1.6
|
2
29
|
|
3
30
|
* Update:
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# Contrinuting to Chid
|
2
|
+
|
3
|
+
## How run chid gem locally
|
4
|
+
`$ ruby -Ilib bin/chid [COMMAND]`
|
5
|
+
|
6
|
+
## Adding a new Command
|
7
|
+
|
8
|
+
### When the command has no sub-command
|
9
|
+
An example of no sub-command is the `chid news` command.
|
10
|
+
|
11
|
+
This command is straightforward, execute the `news` command.
|
12
|
+
### When the command has sub-command
|
13
|
+
An example of no sub-command is the `chid workstation` command.
|
14
|
+
|
15
|
+
For this command we have the following sub-commands:
|
16
|
+
- `create`
|
17
|
+
- `destroy`
|
18
|
+
- `list`
|
19
|
+
- `open`
|
20
|
+
|
21
|
+
A usage for it is `chid workstation open`
|
22
|
+
|
23
|
+
#### Structure
|
24
|
+
As we need many sub-commands, is necessary create a new module (folder) inside the `./lib/chid/commands/` folder.
|
25
|
+
|
26
|
+
For example we want to add `currency` with follwing commands:
|
27
|
+
- `current`
|
28
|
+
- `convert`
|
29
|
+
- `list`
|
30
|
+
|
31
|
+
The first thing is create the folder with those sub-commands:
|
32
|
+
- `./lib/chid/commands/currency/current.rb`
|
33
|
+
- `./lib/chid/commands/currency/convert.rb`
|
34
|
+
- `./lib/chid/commands/currency/list.rb`
|
35
|
+
|
36
|
+
**Class structure**:
|
37
|
+
|
38
|
+
This initial structure must exists to follow the command pattern to work on chid. The structure will be automatically added on helper command, when the user calls for example `chid currency now -h`
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
# ./lib/chid/commands/currency/current.rb
|
42
|
+
|
43
|
+
module Chid
|
44
|
+
module Commands
|
45
|
+
module Currency
|
46
|
+
class Now < Command
|
47
|
+
|
48
|
+
command :'currency current' # COMMAND_NAME
|
49
|
+
|
50
|
+
self.summary = 'Summary of your new Command'
|
51
|
+
self.description = <<-DESC
|
52
|
+
|
53
|
+
Usage:
|
54
|
+
|
55
|
+
$ chid currency now
|
56
|
+
|
57
|
+
SOME_DESCRIPTION_OF_THE_COMMAND
|
58
|
+
|
59
|
+
|
60
|
+
Options: # These are not required, only if your command demands for options.
|
61
|
+
|
62
|
+
-to TEXT_TO_EXPLAIN
|
63
|
+
-from TEXT_TO_EXPLAIN
|
64
|
+
|
65
|
+
DESC
|
66
|
+
self.arguments = ['-to', '-from']
|
67
|
+
|
68
|
+
|
69
|
+
# This method will be executed automatically
|
70
|
+
# To access all given arguments, you have available the attr_reader :options to get
|
71
|
+
def run
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
```
|
data/Gemfile.lock
CHANGED
@@ -1,47 +1,45 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
chid (0.1
|
5
|
-
easy_translate
|
4
|
+
chid (0.2.1)
|
6
5
|
http
|
7
|
-
rake
|
8
6
|
tty-prompt
|
9
7
|
|
10
8
|
GEM
|
11
9
|
remote: https://rubygems.org/
|
12
10
|
specs:
|
13
|
-
addressable (2.
|
14
|
-
public_suffix (
|
11
|
+
addressable (2.7.0)
|
12
|
+
public_suffix (>= 2.0.2, < 5.0)
|
15
13
|
coderay (1.1.1)
|
16
14
|
diff-lcs (1.3)
|
17
|
-
domain_name (0.5.
|
15
|
+
domain_name (0.5.20190701)
|
18
16
|
unf (>= 0.0.5, < 1.0.0)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
http (
|
17
|
+
equatable (0.6.1)
|
18
|
+
ffi (1.13.1)
|
19
|
+
ffi-compiler (1.0.1)
|
20
|
+
ffi (>= 1.0.0)
|
21
|
+
rake
|
22
|
+
http (4.4.1)
|
25
23
|
addressable (~> 2.3)
|
26
24
|
http-cookie (~> 1.0)
|
27
|
-
http-form_data (~>
|
28
|
-
|
25
|
+
http-form_data (~> 2.2)
|
26
|
+
http-parser (~> 1.2.0)
|
29
27
|
http-cookie (1.0.3)
|
30
28
|
domain_name (~> 0.5)
|
31
|
-
http-form_data (
|
32
|
-
|
33
|
-
|
29
|
+
http-form_data (2.3.0)
|
30
|
+
http-parser (1.2.1)
|
31
|
+
ffi-compiler (>= 1.0, < 2.0)
|
34
32
|
method_source (0.8.2)
|
35
|
-
necromancer (0.
|
36
|
-
pastel (0.7.
|
37
|
-
equatable (~> 0.
|
38
|
-
tty-color (~> 0.
|
33
|
+
necromancer (0.5.1)
|
34
|
+
pastel (0.7.4)
|
35
|
+
equatable (~> 0.6)
|
36
|
+
tty-color (~> 0.5)
|
39
37
|
pry (0.10.4)
|
40
38
|
coderay (~> 1.1.0)
|
41
39
|
method_source (~> 0.8.1)
|
42
40
|
slop (~> 3.4)
|
43
|
-
public_suffix (
|
44
|
-
rake (
|
41
|
+
public_suffix (4.0.5)
|
42
|
+
rake (13.0.1)
|
45
43
|
rspec (3.6.0)
|
46
44
|
rspec-core (~> 3.6.0)
|
47
45
|
rspec-expectations (~> 3.6.0)
|
@@ -56,19 +54,21 @@ GEM
|
|
56
54
|
rspec-support (~> 3.6.0)
|
57
55
|
rspec-support (3.6.0)
|
58
56
|
slop (3.6.0)
|
59
|
-
|
60
|
-
|
61
|
-
tty-
|
62
|
-
|
63
|
-
tty-prompt (0.12.0)
|
64
|
-
necromancer (~> 0.4.0)
|
57
|
+
tty-color (0.5.1)
|
58
|
+
tty-cursor (0.7.1)
|
59
|
+
tty-prompt (0.21.0)
|
60
|
+
necromancer (~> 0.5.0)
|
65
61
|
pastel (~> 0.7.0)
|
66
|
-
tty-
|
67
|
-
|
62
|
+
tty-reader (~> 0.7.0)
|
63
|
+
tty-reader (0.7.0)
|
64
|
+
tty-cursor (~> 0.7)
|
65
|
+
tty-screen (~> 0.7)
|
66
|
+
wisper (~> 2.0.0)
|
67
|
+
tty-screen (0.8.0)
|
68
68
|
unf (0.1.4)
|
69
69
|
unf_ext
|
70
|
-
unf_ext (0.0.7.
|
71
|
-
wisper (
|
70
|
+
unf_ext (0.0.7.7)
|
71
|
+
wisper (2.0.1)
|
72
72
|
|
73
73
|
PLATFORMS
|
74
74
|
ruby
|
@@ -79,4 +79,4 @@ DEPENDENCIES
|
|
79
79
|
rspec
|
80
80
|
|
81
81
|
BUNDLED WITH
|
82
|
-
1.
|
82
|
+
2.1.4
|
data/README.md
CHANGED
@@ -1,166 +1,215 @@
|
|
1
1
|
# Chid
|
2
|
-
Chid is an assistant to help your day-to-day life. It can be used in some
|
2
|
+
Chid is an assistant to help your day-to-day life. It can be used in some
|
3
3
|
installations, news, configurations, workstations and more.
|
4
4
|
|
5
|
-

|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
1- Clone the project:
|
9
|
+
### Via Gem
|
12
10
|
|
13
11
|
```bash
|
14
|
-
|
12
|
+
$ gem install chid
|
15
13
|
```
|
16
14
|
|
17
|
-
|
15
|
+
#### Initialize the chid config file
|
18
16
|
|
19
17
|
```bash
|
20
|
-
$
|
21
|
-
$ bundle install
|
18
|
+
$ chid init
|
22
19
|
```
|
23
20
|
|
24
|
-
|
25
|
-
|
26
|
-
```bash
|
27
|
-
$ rake init
|
28
|
-
```
|
21
|
+
Creates a .chid.config file on root directory if none `~/.chid.config` file exists.
|
29
22
|
|
30
|
-
|
31
|
-
alias on your **.bashrc** or **.zshrc** (if you have zsh installed). After the
|
32
|
-
installation **Chid** will give you the *bash command* to reload your **sources**
|
33
|
-
file.
|
23
|
+
To access that file will be created in `~/.chid.config`
|
34
24
|
|
35
25
|
## Upgrading
|
36
26
|
|
37
27
|
To update the chid is easy.
|
38
28
|
|
39
29
|
```bash
|
40
|
-
$
|
30
|
+
$ gem update chid
|
41
31
|
```
|
42
32
|
|
43
33
|
## Usage
|
44
34
|
|
45
|
-
**Chid** is an app based on **
|
46
|
-
as rake tasks or run as a **terminal app**:
|
35
|
+
**Chid** is an gem app based on **Commands**. You are available to use all features running on **terminal**:
|
47
36
|
|
48
|
-
|
37
|
+
To see all commands and how to use on Terminal, run:
|
38
|
+
|
39
|
+
`$ chid -h`
|
40
|
+
|
41
|
+
**Note:** All Commands are available for **osx** and **linux**. The *chid* will automatically
|
49
42
|
knows how run the specific **comand** for each plataform.
|
50
43
|
|
51
44
|
All features are listed bellow:
|
52
45
|
|
53
|
-
|
46
|
+
### Install chid configuration
|
54
47
|
|
55
48
|
* `$ chid init` - Will install all necessary confiuration.
|
56
49
|
|
57
|
-
|
50
|
+
### Chid configuration
|
51
|
+
|
52
|
+
* `$ chid config` - Open the **.chid.config** file using any source you want. By default is **vim**.
|
53
|
+
* `$ chid config -editor vim`
|
54
|
+
|
55
|
+
### Feature Commands
|
58
56
|
|
59
|
-
|
57
|
+
- [Git Commit](#git-commit)
|
58
|
+
- [Install apps](#install-apps)
|
59
|
+
- [Run apps](#run)
|
60
|
+
- [currency](#currency)
|
61
|
+
- [News](#news)
|
62
|
+
- [Search on StackOverflow](#search-on-stackOverflow)
|
63
|
+
- [Search GitHub repositories](#search-gitHub-repositories)
|
64
|
+
- [Workstations](#workstations)
|
65
|
+
- [Tmux](#tmux)
|
66
|
+
- [Configure and customize your workstations](#configure-workstation)
|
67
|
+
|
68
|
+
### <a name="git-commit"></a> Git Commit
|
60
69
|
|
61
|
-
|
70
|
+
Create a commits in based on gitFlow pattern.
|
62
71
|
|
63
|
-
|
72
|
+
* `$ chid commit` - Start the process of commiting
|
73
|
+
* `$ chid commit -h` - To see all options you can use as shortcut
|
64
74
|
|
65
|
-
|
75
|
+
#### An easy way to create commits following simple steps:
|
66
76
|
|
67
|
-
|
77
|
+
**First**:
|
78
|
+
Choose your commit type in this options (add,Remove, Update, Refactor, Fix)
|
68
79
|
|
69
|
-
|
80
|
+
**Second**:
|
81
|
+
Type your commit title, a brief description of your changes
|
70
82
|
|
71
|
-
|
83
|
+
**Third**:
|
84
|
+
Add your description lines, describing exactly what you did
|
72
85
|
|
73
|
-
|
74
|
-
* `currency list` - Show all types of currencies available to convert
|
75
|
-
* `convert [amount] [type_from] to [type_to]` - You can convert an amount between
|
76
|
-
types. Eg.: **convert 10 USD to BRL**
|
86
|
+
Thats it! Your commit will be created and pushed like this sample:
|
77
87
|
|
78
|
-
|
88
|
+
```YAML
|
89
|
+
feature/#123 Add specific file needed to app
|
90
|
+
|
91
|
+
- specific file have now this line
|
92
|
+
- this is the description line two
|
93
|
+
|
94
|
+
Signed-off-by: "YourName" "yourEmail@mail.com"
|
95
|
+
```
|
79
96
|
|
80
|
-
|
97
|
+
### <a name="install-apps"></a> Install apps
|
98
|
+
|
99
|
+
**Note:** All install tasks, chid will always ask if you really want to install it. Also
|
81
100
|
will install the dependencies if necessary.
|
82
101
|
|
83
|
-
*
|
84
|
-
*
|
85
|
-
*
|
86
|
-
*
|
102
|
+
* `$ chid install dotfiles` - Install my own dotfiles for vim, zsh and tmux
|
103
|
+
* `$ chid install node` - Install Node
|
104
|
+
* `$ chid install postgres` - Install Postgres
|
105
|
+
* `$ chid install rvm` - Install stable RVM version
|
106
|
+
* `$ chid install vim and/or gvim` - Install Vim
|
87
107
|
|
88
|
-
|
108
|
+
### <a name="run"></a> Run
|
89
109
|
|
90
110
|
* `run postgres` - Run the postgresql if you already have installed.
|
91
111
|
|
92
|
-
|
112
|
+
### <a name="currency"></a> Currency
|
93
113
|
|
94
|
-
*
|
114
|
+
* `$ chid currency now` - Get the now converstion. Default -from USD -to BRL
|
115
|
+
* `$ chid currency list` - All list of available Source to use on `now` and `convert commands`
|
116
|
+
* `$ chid currency convert -amount [amount]` - You can convert an amount between types. Default -to BRL, -from USD
|
95
117
|
|
96
|
-
|
118
|
+
### <a name="news"></a> News
|
97
119
|
|
98
|
-
*
|
120
|
+
* `$ chid news` - Will show all news from some sites. BBC news, CNN, Espn,
|
99
121
|
Mashable, Google, Techcrunch, Reddit
|
100
122
|
|
101
|
-
|
102
|
-
|
103
|
-
* `t [TEXT]` or `t [TEXT] [FROM] to [TO]` - Will translate the given text. By
|
104
|
-
default the **from** is **en** and **to** is **pt**
|
123
|
+
### <a name="search-on-stackOverflow"></a> Search on StackOverflow
|
105
124
|
|
106
|
-
Example:
|
107
|
-
`t hello world` or `t hello world en to pt`
|
108
|
-
|
109
|
-
#### Search on StackOverflow
|
110
125
|
|
111
126
|
A simple search in StackOverflow
|
112
127
|
|
113
|
-
*
|
128
|
+
* `$ chid stack -search [TEXT_TO_SEACH]` - Will search on StackOverflow all results for that
|
114
129
|
text.
|
115
130
|
|
116
|
-
|
117
|
-
|
118
|
-
<p align="left">
|
119
|
-
<img src="etc/img/stack.png" alt="stack sample" />
|
120
|
-
</p>
|
131
|
+

|
121
132
|
|
122
|
-
|
133
|
+
### <a name="search-gitHub-repositories"></a> Search GitHub repositories
|
123
134
|
|
124
135
|
A simple search for repository name
|
125
136
|
|
126
|
-
*
|
137
|
+
* `$ chid github -name [SEARCH_EXPRESSION]` - Show results for expression paginated every 10
|
127
138
|
|
128
|
-
|
139
|
+
### <a name="workstations"></a> Workstations
|
129
140
|
|
130
141
|
Workstations are a way to make it easy for you to open a set of applications by
|
131
142
|
simple commands.
|
132
143
|
|
133
144
|
The set of configurations are saved on **.chid.config** file.
|
134
145
|
|
135
|
-
**Note:** All commands bellow is possible run with prefix:
|
136
|
-
or `work [command]`.
|
146
|
+
**Note:** All commands bellow is possible run with prefix: `$ chid workstation [command]`
|
137
147
|
|
138
|
-
*
|
139
|
-
*
|
148
|
+
* `$ chid workstation list` - List all workstations
|
149
|
+
* `$ chid workstation create` - Create a new workstation. Chid will ask for a name to set the
|
140
150
|
new workstation and after that will list all **applications** available on your
|
141
151
|
system to chosse witch one you wanna add
|
142
|
-
*
|
152
|
+
* `$ chid workstation destroy` - Chid will ask which workstation you want to destroy and chid
|
143
153
|
will destroy it after choose
|
144
|
-
*
|
154
|
+
* `$ chid workstation open` - Open a specific workstation. Chid will list all workstations to
|
145
155
|
choose one of them to open all applications
|
146
|
-
*
|
147
|
-
from a list. Eg.:
|
156
|
+
* `$ chid workstation open -name [workstation_name]` - Open a specific workstation without choose
|
157
|
+
from a list. Eg.: `$ chid workstation open -name base` - It will open all applications inside the
|
148
158
|
**base** workstation
|
149
159
|
|
150
|
-

|
151
161
|
|
152
|
-
**Note:** For linux users the
|
162
|
+
**Note:** For linux users the `$chid workstation create` is not working. You need create
|
153
163
|
manually (editing the .chid.config file). Will be explained how on
|
154
164
|
**How configure and customize your workstations** topic
|
155
165
|
|
156
|
-
|
166
|
+
### <a name="tmux"></a> Tmux
|
157
167
|
|
158
|
-
|
168
|
+
If you use Tmux as I do for development, this is a nice Command Feature!
|
159
169
|
|
160
|
-
|
170
|
+
This feature is based on some templates you will create on `~/.chid.config` file to open easily all your Dev Env
|
161
171
|
|
162
|
-
|
163
|
-
|
172
|
+
This Feature have **2** commands, `list` and `open`
|
173
|
+
|
174
|
+
* `$ chid tmux list` - List all existent tmux template
|
175
|
+
* `$ chid tmux create` - Open a specific tmux template
|
176
|
+
|
177
|
+
#### An example of Template you will add on **~/.chid.config**:
|
178
|
+
|
179
|
+
```YAML
|
180
|
+
---
|
181
|
+
:chid:
|
182
|
+
:workstations: {}
|
183
|
+
:tmux_templates:
|
184
|
+
:NAME_YOUR_PROJECT:
|
185
|
+
- tmux new -s $$template_name$$ -n app -d;
|
186
|
+
- tmux send-keys -t $$template_name$$ 'cd DIRECTORY_PROJECT_PATH'
|
187
|
+
C-m;
|
188
|
+
- tmux send-keys -t $$template_name$$ 'vim' C-m C-m;
|
189
|
+
- tmux new-window -n tests -t $$template_name$$;
|
190
|
+
- tmux send-keys -t $$template_name$$ 'cd DIRECTORY_PROJECT_PATH'
|
191
|
+
C-m;
|
192
|
+
- tmux new-window -n server -t $$template_name$$;
|
193
|
+
- tmux send-keys -t $$template_name$$ 'cd DIRECTORY_PROJECT_PATH'
|
194
|
+
C-m;
|
195
|
+
- tmux attach -t $$template_name$$;
|
196
|
+
```
|
197
|
+
|
198
|
+
The example above each line is a tmux command. You can do what you need. In this case we have only two variables to replace:
|
199
|
+
- NAME_YOUR_PROJECT -> the name which will appear on `tmux list`
|
200
|
+
- DIRECTORY_PROJECT_PATH -> the full path of the your directory project. Ex.: `~/Workspaces/ruby-workspace/chid/`
|
201
|
+
|
202
|
+
The commands above means those steps:
|
203
|
+
1- Create a new Tmux session with `app` name for the first tab or Find an existent one and Open it
|
204
|
+
2- Open the folder project on the tmux tab `app`
|
205
|
+
3- Open a new tab called `vim` and open the vim on the folder project
|
206
|
+
4- Open a new tab called `server` and go to the folder project
|
207
|
+
|
208
|
+
**base** workstation
|
209
|
+
|
210
|
+
## <a name="configure-workstation"></a> How configure and customize your workstations
|
211
|
+
|
212
|
+
The chid configuration file is installed on **~/.chid.config**. You can open: `$ chid config`
|
164
213
|
|
165
214
|
Chid config is a **YAML** file.
|
166
215
|
|
@@ -171,8 +220,8 @@ The initial chid config file will be like:
|
|
171
220
|
```YAML
|
172
221
|
---
|
173
222
|
:chid:
|
174
|
-
:chid_path: "[CHID_FOLDER_PROJECT_PATH]"
|
175
223
|
:workstations: {}
|
224
|
+
:tmux_templates: {}
|
176
225
|
```
|
177
226
|
|
178
227
|
#### Base configuration
|
@@ -182,20 +231,19 @@ To add a new *workstation* you can edit like:
|
|
182
231
|
```YAML
|
183
232
|
---
|
184
233
|
:chid:
|
185
|
-
:chid_path: "[CHID_FOLDER_PROJECT_PATH]"
|
186
234
|
:workstations:
|
187
235
|
:base: # Workstation Name
|
188
236
|
- iTerm #Application Name
|
189
237
|
- Safari
|
190
238
|
- Slack
|
239
|
+
:tmux_templates: {}
|
191
240
|
```
|
241
|
+

|
192
242
|
|
193
243
|
After edit you can open the **base** workstation running:
|
194
244
|
|
195
|
-
* `$ chid workstation
|
196
|
-
*
|
197
|
-
|
198
|
-

|
245
|
+
* `$ chid workstation open -name base`
|
246
|
+
* `$ chid workstation open -n base`
|
199
247
|
|
200
248
|
#### Advance configuration
|
201
249
|
|
@@ -208,14 +256,12 @@ Is possible you can customize some options with each Application when will open
|
|
208
256
|
```YAML
|
209
257
|
---
|
210
258
|
:chid:
|
211
|
-
:chid_path: "[CHID_FOLDER_PROJECT_PATH]"
|
212
259
|
:workstations:
|
213
260
|
:base: # Workstation Name
|
214
|
-
- iTerm ~/Workspaces/rake-workspace/chid/ &
|
215
|
-
# in a specific folder and will run
|
261
|
+
- iTerm ~/Workspaces/rake-workspace/chid/ & rspec # Will open
|
262
|
+
# in a specific folder and will run the rspec (run all tests)
|
216
263
|
- Safari https://github.com/rachidcalazans/chid # Will open the Safari
|
217
264
|
# in a specific URL
|
265
|
+
:tmux_templates: {}
|
218
266
|
```
|
219
267
|
|
220
|
-

|
221
|
-
|