chid 0.1.2 → 0.1.4.pre.beta
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/#README.md# +221 -0
- data/CHANGELOG.md +11 -0
- data/Rakefile +11 -10
- data/bin/chid +28 -0
- data/lib/chid.rb +67 -0
- data/lib/chid/chid_config.rb +8 -0
- data/lib/chid/commands/install.rb +53 -0
- data/lib/chid/commands/installs/dotfile.rb +30 -0
- data/lib/chid/commands/installs/node.rb +23 -0
- data/lib/chid/commands/installs/postgres.rb +23 -0
- data/lib/chid/commands/installs/rvm.rb +26 -0
- data/lib/chid/version.rb +1 -1
- data/tasks/chid/install.rake +14 -0
- data/tasks/help.rake +172 -2
- metadata +14 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7a695ae60bfe3af5f460e5d2272fa495d7103a9
|
4
|
+
data.tar.gz: 9bd8b66acd50421cbc5d7982f3ef15a970ada9bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a97cf5fc860979e4da8ed581c1d0359d944aaf46cbeafc6a1be257631b50e8609881640b8426620088176729b9d929f54012ed7ffa7f6edd62af35c40adf695
|
7
|
+
data.tar.gz: 91a2a7b7797423cdd168ee901b80403bc0ab2ed41b7429f3719f553dd1d01a197345ed8217ee91527c17ff685e24c47cd9afb418c6512c8c6a753e76b30a6aee
|
data/#README.md#
ADDED
@@ -0,0 +1,221 @@
|
|
1
|
+
# Chid
|
2
|
+
Chid is an assistant to help your day-to-day life. It can be used in some
|
3
|
+
installations, news, configurations, workstations and more.
|
4
|
+
|
5
|
+

|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
To get started follow those steps:
|
10
|
+
|
11
|
+
1- Clone the project:
|
12
|
+
|
13
|
+
```bash
|
14
|
+
git clone https://github.com/rachidcalazans/chid.git
|
15
|
+
```
|
16
|
+
|
17
|
+
: 2- Install the dependcy if you do not have already installed:
|
18
|
+
|
19
|
+
```bash
|
20
|
+
$ gem install bundler
|
21
|
+
$ bundle install
|
22
|
+
```
|
23
|
+
|
24
|
+
3- Inside the folder project run:
|
25
|
+
|
26
|
+
```bash
|
27
|
+
$ rake init
|
28
|
+
```
|
29
|
+
|
30
|
+
**Note:** Chid will automatically install a *.chid.config* file and create an
|
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.
|
34
|
+
|
35
|
+
## Upgrading
|
36
|
+
|
37
|
+
To update the chid is easy.
|
38
|
+
|
39
|
+
```bash
|
40
|
+
$ chid update
|
41
|
+
```
|
42
|
+
|
43
|
+
## Usage
|
44
|
+
|
45
|
+
**Chid** is an app based on **Rake Tasks**. You are available to use all features
|
46
|
+
as rake tasks or run as a **terminal app**:
|
47
|
+
|
48
|
+
**Note:** All tasks are available for **osx** and **linux**. The *chid* will automatically
|
49
|
+
knows how run the specific **comand** for each plataform.
|
50
|
+
|
51
|
+
All features are listed bellow:
|
52
|
+
|
53
|
+
#### Install chid configuration
|
54
|
+
|
55
|
+
* `$ chid init` - Will install all necessary confiuration.
|
56
|
+
|
57
|
+
#### Start the app
|
58
|
+
|
59
|
+
* `$ chid` - To start the **chid** terminal app
|
60
|
+
|
61
|
+
**Note:** To run the commands listed bellow you must started the chid app.
|
62
|
+
|
63
|
+
#### Help
|
64
|
+
|
65
|
+
* `help` or `:h` - Show all tasks available
|
66
|
+
|
67
|
+
#### Quit
|
68
|
+
|
69
|
+
* `:q` or `quit` or `bye` or `exit` - Will finish the **chid** app
|
70
|
+
|
71
|
+
#### Currency
|
72
|
+
|
73
|
+
* `current` - Get the current conversion for USD to BRL amount
|
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**
|
77
|
+
|
78
|
+
#### Install apps
|
79
|
+
|
80
|
+
**Note:** All install tasks, chid will always ask if you really want to install it. Also
|
81
|
+
will install the dependencies if necessary.
|
82
|
+
|
83
|
+
* `install dotfiles` - Install [YADR Dotfiles](https://github.com/skwp/dotfiles)
|
84
|
+
* `install node` - Install Node
|
85
|
+
* `install postgres` - Install Postgres
|
86
|
+
* `install rvm` - Install stable RVM version
|
87
|
+
|
88
|
+
#### Run
|
89
|
+
|
90
|
+
* `run postgres` - Run the postgresql if you already have installed.
|
91
|
+
|
92
|
+
#### Update
|
93
|
+
|
94
|
+
* `update os` or `update` - Will update the linux os. For osx is not available
|
95
|
+
|
96
|
+
#### News
|
97
|
+
|
98
|
+
* `news` - Will show all news from some sites. BBC news, CNN, Espn,
|
99
|
+
Mashable, Google, Techcrunch, Reddit
|
100
|
+
|
101
|
+
#### Translate
|
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**
|
105
|
+
|
106
|
+
Example:
|
107
|
+
`t hello world` or `t hello world en to pt`
|
108
|
+
|
109
|
+
#### Search on StackOverflow
|
110
|
+
|
111
|
+
A simple search in StackOverflow
|
112
|
+
|
113
|
+
* `stack [TEXT_TO_SEACH]` - Will search on StackOverflow all results for that
|
114
|
+
text.
|
115
|
+
|
116
|
+
* `stack` - Will ask what you want to search on StackOverflow all results for that
|
117
|
+
|
118
|
+
<p align="left">
|
119
|
+
<img src="etc/img/stack.png" alt="stack sample" />
|
120
|
+
</p>
|
121
|
+
|
122
|
+
#### Search GitHub repositories
|
123
|
+
|
124
|
+
A simple search for repository name
|
125
|
+
|
126
|
+
* `github [SEARCH_EXPRESSION]` - Show results for expression paginated every 10
|
127
|
+
|
128
|
+
#### Workstations
|
129
|
+
|
130
|
+
Workstations are a way to make it easy for you to open a set of applications by
|
131
|
+
simple commands.
|
132
|
+
|
133
|
+
The set of configurations are saved on **.chid.config** file.
|
134
|
+
|
135
|
+
**Note:** All commands bellow is possible run with prefix: `workstation [command]`
|
136
|
+
or `work [command]`.
|
137
|
+
|
138
|
+
* `work list` - List all workstations
|
139
|
+
* `work create` - Create a new workstation. Chid will ask for a name to set the
|
140
|
+
new workstation and after that will list all **applications** available on your
|
141
|
+
system to chosse witch one you wanna add
|
142
|
+
* `work destroy` - Chid will ask which workstation you want to destroy and chid
|
143
|
+
will destroy it after choose
|
144
|
+
* `work open` - Open a specific workstation. Chid will list all workstations to
|
145
|
+
choose one of them to open all applications
|
146
|
+
* `work open [workstation_name]` - Open a specific workstation without choose
|
147
|
+
from a list. Eg.: `work open base` - It will open all applications inside the
|
148
|
+
**base** workstation
|
149
|
+
|
150
|
+

|
151
|
+
|
152
|
+
**Note:** For linux users the **work create** is not working. You need create
|
153
|
+
manually (editing the .chid.config file). Will be explained how on
|
154
|
+
**How configure and customize your workstations** topic
|
155
|
+
|
156
|
+
#### Chid configuration
|
157
|
+
|
158
|
+
* `chid config` or `config` - Open the **.chid.config** file
|
159
|
+
|
160
|
+
## How configure and customize your workstations
|
161
|
+
|
162
|
+
The chid configuration file is installed on **~/.chid.config**. You can open: `$ chid
|
163
|
+
chid_config`
|
164
|
+
|
165
|
+
Chid config is a **YAML** file.
|
166
|
+
|
167
|
+
You can create the workstations just adding on :workstations: key.
|
168
|
+
|
169
|
+
The initial chid config file will be like:
|
170
|
+
|
171
|
+
```YAML
|
172
|
+
---
|
173
|
+
:chid:
|
174
|
+
:chid_path: "[CHID_FOLDER_PROJECT_PATH]"
|
175
|
+
:workstations: {}
|
176
|
+
```
|
177
|
+
|
178
|
+
#### Base configuration
|
179
|
+
|
180
|
+
To add a new *workstation* you can edit like:
|
181
|
+
|
182
|
+
```YAML
|
183
|
+
---
|
184
|
+
:chid:
|
185
|
+
:chid_path: "[CHID_FOLDER_PROJECT_PATH]"
|
186
|
+
:workstations:
|
187
|
+
:base: # Workstation Name
|
188
|
+
- iTerm #Application Name
|
189
|
+
- Safari
|
190
|
+
- Slack
|
191
|
+
```
|
192
|
+
|
193
|
+
After edit you can open the **base** workstation running:
|
194
|
+
|
195
|
+
* `$ chid workstation:open['base']` - As rake task
|
196
|
+
* `work open base` - With the **chid** app running
|
197
|
+
|
198
|
+

|
199
|
+
|
200
|
+
#### Advance configuration
|
201
|
+
|
202
|
+
Is possible you can customize some options with each Application when will open it
|
203
|
+
|
204
|
+
- Open the Terminal in a specific folder
|
205
|
+
- Open a Safari with a specific URL
|
206
|
+
- Any options which your application can use
|
207
|
+
|
208
|
+
```YAML
|
209
|
+
---
|
210
|
+
:chid:
|
211
|
+
:chid_path: "[CHID_FOLDER_PROJECT_PATH]"
|
212
|
+
:workstations:
|
213
|
+
:base: # Workstation Name
|
214
|
+
- iTerm ~/Workspaces/rake-workspace/chid/ & rake tmux_config # Will open
|
215
|
+
# in a specific folder and will run some Rake Task
|
216
|
+
- Safari https://github.com/rachidcalazans/chid # Will open the Safari
|
217
|
+
# in a specific URL
|
218
|
+
```
|
219
|
+
|
220
|
+

|
221
|
+
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -1,17 +1,18 @@
|
|
1
|
+
#require 'chid'
|
1
2
|
# Require all files inside the lib folder only
|
2
|
-
|
3
|
-
dir = File.join(File.dirname(__FILE__), inc)
|
4
|
-
glob = Dir.glob(dir + "/*.rb")
|
5
|
-
glob.each { |r| require r }
|
6
|
-
end
|
7
|
-
|
3
|
+
#%w(lib).each do |inc|
|
4
|
+
# dir = File.join(File.dirname(__FILE__), inc)
|
5
|
+
# glob = Dir.glob(dir + "/*.rb")
|
6
|
+
# glob.each { |r| require r }
|
7
|
+
#end
|
8
|
+
#
|
8
9
|
# Load all rake tasks inside the tasks folder
|
9
|
-
dir = File.join(File.dirname(__FILE__), 'tasks')
|
10
|
-
glob = Dir.glob(dir + "/**/*.rake")
|
11
|
-
glob.each { |r| load r }
|
10
|
+
#dir = File.join(File.dirname(__FILE__), 'tasks')
|
11
|
+
#glob = Dir.glob(dir + "/**/*.rake")
|
12
|
+
#glob.each { |r| load r }
|
12
13
|
|
13
14
|
|
14
15
|
# Initialize the default variable to use on all rake tasks
|
15
|
-
|
16
|
+
#@chid_config = ChidConfig.new
|
16
17
|
|
17
18
|
task :default => :chid
|
data/bin/chid
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'chid'
|
4
|
+
require 'rake'
|
5
|
+
|
6
|
+
task = ARGV.join(" ")
|
7
|
+
|
8
|
+
if task.empty?
|
9
|
+
#Rake.application.run
|
10
|
+
Chid::start
|
11
|
+
else
|
12
|
+
puts "TASK: #{ARGV.join(" ")}"
|
13
|
+
if task == 'install node'
|
14
|
+
Chid::Commands::Installs::Node.new().run
|
15
|
+
elsif task == 'install postgres'
|
16
|
+
Chid::Commands::Installs::Postgres.new().run
|
17
|
+
elsif task == 'install rvm'
|
18
|
+
Chid::Commands::Installs::Rvm.new().run
|
19
|
+
elsif task == 'install dotfile'
|
20
|
+
Chid::Commands::Installs::Dotfile.new().run
|
21
|
+
elsif task == 'install'
|
22
|
+
Chid::Commands::Install.new(Chid::chid_config_path).run
|
23
|
+
else
|
24
|
+
puts "Invalid task name. Try again"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
#Rake.application[task].invoke
|
data/lib/chid.rb
CHANGED
@@ -1,14 +1,81 @@
|
|
1
|
+
require 'rake'
|
1
2
|
require 'yaml'
|
2
3
|
require 'tty-prompt'
|
3
4
|
require 'http'
|
4
5
|
require 'easy_translate'
|
5
6
|
|
7
|
+
require 'chid/commands/install'
|
8
|
+
require 'chid/commands/installs/dotfile'
|
9
|
+
require 'chid/commands/installs/node'
|
10
|
+
require 'chid/commands/installs/postgres'
|
11
|
+
require 'chid/commands/installs/rvm'
|
12
|
+
|
6
13
|
# Require all files inside the chid folder
|
7
14
|
dir = File.join(File.dirname(__FILE__))
|
8
15
|
glob = Dir.glob(dir + "/chid/*.rb")
|
9
16
|
glob.each { |r| require r }
|
10
17
|
|
18
|
+
dir_tasks = File.expand_path('..', File.dirname(__FILE__))
|
19
|
+
dir = File.join(dir_tasks, 'tasks')
|
20
|
+
glob = Dir.glob(dir + "/**/*.rake")
|
21
|
+
glob.each { |r| load r }
|
22
|
+
|
23
|
+
|
11
24
|
module Chid
|
25
|
+
def self.start
|
26
|
+
chid_config = ChidConfig.new
|
27
|
+
prompt = TTY::Prompt.new(help_color: :green)
|
28
|
+
confirm_install = -> (action, &block) {
|
29
|
+
matched = /^install:(.*)/.match(action)
|
30
|
+
return block.() unless matched
|
31
|
+
|
32
|
+
action_name = matched.captures.first
|
33
|
+
if prompt.yes?("Can I install the #{action_name}?")
|
34
|
+
block.()
|
35
|
+
else
|
36
|
+
puts "\nNo problem. What do you need?"
|
37
|
+
end
|
38
|
+
}
|
39
|
+
|
40
|
+
Main.new(chid_config).init do |action, args|
|
41
|
+
rake_task = Rake::Task[action]
|
42
|
+
task_args = Rake::TaskArguments.new(rake_task.arg_names, args)
|
43
|
+
|
44
|
+
confirm_install.(action) do
|
45
|
+
rake_task.execute(task_args)
|
46
|
+
end
|
47
|
+
|
48
|
+
puts "\nDone! What else?"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.chid_config_path
|
53
|
+
home_path = File.expand_path("~/")
|
54
|
+
chid_config_path = File.join(home_path, '.chid.config')
|
55
|
+
chid_config_path
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.username
|
59
|
+
on_linux { return %x[echo $USER].strip }
|
60
|
+
on_osx { return %x[echo $(logname)].strip }
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.on_linux
|
64
|
+
if platform =~ /Linux/
|
65
|
+
yield
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.on_osx
|
70
|
+
if platform =~ /Darwin/
|
71
|
+
yield
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.platform
|
76
|
+
%x{echo $(uname -s)}.strip
|
77
|
+
end
|
78
|
+
|
12
79
|
|
13
80
|
# The Regex Actions are used to execute automatically some Rake::Task
|
14
81
|
#
|
data/lib/chid/chid_config.rb
CHANGED
@@ -17,6 +17,14 @@ class ChidConfig
|
|
17
17
|
print "\nConfiguration done!\n"
|
18
18
|
end
|
19
19
|
|
20
|
+
def configure_chid_file_only
|
21
|
+
print "\nConfigurating the Chid app...\n"
|
22
|
+
|
23
|
+
create_an_empty_chid_config_file
|
24
|
+
|
25
|
+
print "\nConfiguration done!\n"
|
26
|
+
end
|
27
|
+
|
20
28
|
def username
|
21
29
|
on_linux { return %x[echo $USER].strip }
|
22
30
|
on_osx { return %x[echo $(logname)].strip }
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Chid
|
2
|
+
module Commands
|
3
|
+
class Install
|
4
|
+
|
5
|
+
def initialize(chid_config_path)
|
6
|
+
@chid_config_path = chid_config_path
|
7
|
+
end
|
8
|
+
|
9
|
+
def run
|
10
|
+
create_or_update_chid_config_file
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
attr_reader :chid_config_path
|
16
|
+
|
17
|
+
def create_or_update_chid_config_file
|
18
|
+
print "\n--- Installing chid ---\n "
|
19
|
+
print "\nCreating the " unless chid_config_file_exist?
|
20
|
+
print "\nUpdating the " if chid_config_file_exist?
|
21
|
+
print "~/.chid.config ".blue
|
22
|
+
print "file\n"
|
23
|
+
|
24
|
+
base_config = chid_configurations
|
25
|
+
|
26
|
+
File.open(chid_config_path, 'w') do |file|
|
27
|
+
YAML.dump(base_config, file)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def chid_configurations
|
32
|
+
base_config = {
|
33
|
+
chid: {
|
34
|
+
workstations: {}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
if chid_config_file_exist?
|
39
|
+
data = YAML.load_file chid_config_path
|
40
|
+
data[:chid][:workstations] = data[:chid].fetch(:workstations, {})
|
41
|
+
base_config = data
|
42
|
+
end
|
43
|
+
|
44
|
+
base_config
|
45
|
+
end
|
46
|
+
|
47
|
+
def chid_config_file_exist?
|
48
|
+
File.exist?(chid_config_path)
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Chid
|
2
|
+
module Commands
|
3
|
+
module Installs
|
4
|
+
class Dotfile
|
5
|
+
|
6
|
+
def run
|
7
|
+
puts "\nInstalling the YADR Dotfiles..."
|
8
|
+
::Chid::on_linux do
|
9
|
+
system('sudo apt-get update')
|
10
|
+
system('sudo apt-get install curl')
|
11
|
+
system('sudo apt-get install zsh')
|
12
|
+
system('sudo apt-get install git-core')
|
13
|
+
end
|
14
|
+
|
15
|
+
system('sh -c "`curl -fsSL https://raw.githubusercontent.com/skwp/dotfiles/master/install.sh`"')
|
16
|
+
|
17
|
+
puts 'Updating YARD...'
|
18
|
+
home_path = File.expand_path("~/")
|
19
|
+
path = "#{home_path}/.yadr"
|
20
|
+
Dir.chdir path
|
21
|
+
system('git pull --rebase')
|
22
|
+
system('rake update')
|
23
|
+
|
24
|
+
puts "\nYARD Dotfiles installed successfully"
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Chid
|
2
|
+
module Commands
|
3
|
+
module Installs
|
4
|
+
class Node
|
5
|
+
|
6
|
+
def run
|
7
|
+
puts "\nInstalling the Node..."
|
8
|
+
|
9
|
+
::Chid::on_linux do
|
10
|
+
system('sudo apt-get install nodejs')
|
11
|
+
end
|
12
|
+
|
13
|
+
::Chid::on_osx do
|
14
|
+
system('brew install node')
|
15
|
+
end
|
16
|
+
|
17
|
+
puts "\nNode installed successfully"
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Chid
|
2
|
+
module Commands
|
3
|
+
module Installs
|
4
|
+
class Postgres
|
5
|
+
|
6
|
+
def run
|
7
|
+
puts "\nInstalling the Postgres..."
|
8
|
+
|
9
|
+
::Chid::on_linux do
|
10
|
+
system('sudo apt-get install postgresql postgresql-contrib')
|
11
|
+
end
|
12
|
+
|
13
|
+
::Chid::on_osx do
|
14
|
+
system('brew install postgres')
|
15
|
+
end
|
16
|
+
|
17
|
+
puts "\nPostgres installed successfully"
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Chid
|
2
|
+
module Commands
|
3
|
+
module Installs
|
4
|
+
class Rvm
|
5
|
+
|
6
|
+
def run
|
7
|
+
puts "\nInstalling the RVM..."
|
8
|
+
|
9
|
+
::Chid::on_linux do
|
10
|
+
system('sudo apt-add-repository -y ppa:rael-gc/rvm')
|
11
|
+
system('sudo apt-get update')
|
12
|
+
system('sudo apt-get install curl')
|
13
|
+
system('sudo apt-get install rvm')
|
14
|
+
end
|
15
|
+
|
16
|
+
::Chid::on_osx do
|
17
|
+
system('\curl -sSL https://get.rvm.io | bash')
|
18
|
+
end
|
19
|
+
|
20
|
+
puts "\nRVM installed successfully"
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/chid/version.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
desc 'Initial configuration for Chid app'
|
2
|
+
task :install do
|
3
|
+
print "Chid is an assistant to help your day-to-day life.\n\n"
|
4
|
+
print "You can use it as "
|
5
|
+
print "a terminal App ".green
|
6
|
+
print "or through "
|
7
|
+
print "Rake Tasks".green
|
8
|
+
print", having a greater interaction with it.\n\n"
|
9
|
+
|
10
|
+
print "To initialize the app you can run the command: "
|
11
|
+
print "$ chid\n".blue
|
12
|
+
|
13
|
+
@chid_config.configure_chid_file_only
|
14
|
+
end
|
data/tasks/help.rake
CHANGED
@@ -1,8 +1,178 @@
|
|
1
1
|
desc 'Show all tasks availabe'
|
2
2
|
task :help do
|
3
|
-
Dir.chdir @chid_config.chid_rake_path
|
4
|
-
system("rake -T")
|
3
|
+
#Dir.chdir @chid_config.chid_rake_path
|
4
|
+
#system("rake -T")
|
5
5
|
puts "\nTell me what you need"
|
6
|
+
|
7
|
+
a = <<MY
|
8
|
+
# Chid
|
9
|
+
|
10
|
+
**Note:** All tasks are available for **osx** and **linux**. The *chid* will automatically
|
11
|
+
knows how run the specific **comand** for each plataform.
|
12
|
+
|
13
|
+
#### Install chid configuration
|
14
|
+
|
15
|
+
* `$ chid init` - Will install all necessary confiuration.
|
16
|
+
|
17
|
+
#### Start the app
|
18
|
+
|
19
|
+
* `$ chid` - To start the **chid** terminal app
|
20
|
+
|
21
|
+
**Note:** To run the commands listed bellow you must started the chid app.
|
22
|
+
|
23
|
+
#### Help
|
24
|
+
|
25
|
+
* `help` or `:h` - Show all tasks available
|
26
|
+
|
27
|
+
#### Quit
|
28
|
+
|
29
|
+
* `:q` or `quit` or `bye` or `exit` - Will finish the **chid** app
|
30
|
+
|
31
|
+
#### Currency
|
32
|
+
|
33
|
+
* `current` - Get the current conversion for USD to BRL amount
|
34
|
+
* `currency list` - Show all types of currencies available to convert
|
35
|
+
* `convert [amount] [type_from] to [type_to]` - You can convert an amount between
|
36
|
+
types. Eg.: **convert 10 USD to BRL**
|
37
|
+
|
38
|
+
#### Install apps
|
39
|
+
|
40
|
+
**Note:** All install tasks, chid will always ask if you really want to install it. Also
|
41
|
+
will install the dependencies if necessary.
|
42
|
+
|
43
|
+
* `install dotfiles` - Install [YADR Dotfiles](https://github.com/skwp/dotfiles)
|
44
|
+
* `install node` - Install Node
|
45
|
+
* `install postgres` - Install Postgres
|
46
|
+
* `install rvm` - Install stable RVM version
|
47
|
+
|
48
|
+
#### Run
|
49
|
+
|
50
|
+
* `run postgres` - Run the postgresql if you already have installed.
|
51
|
+
|
52
|
+
#### Update
|
53
|
+
|
54
|
+
* `update os` or `update` - Will update the linux os. For osx is not available
|
55
|
+
|
56
|
+
#### News
|
57
|
+
|
58
|
+
* `news` - Will show all news from some sites. BBC news, CNN, Espn,
|
59
|
+
Mashable, Google, Techcrunch, Reddit
|
60
|
+
|
61
|
+
#### Translate
|
62
|
+
|
63
|
+
* `t [TEXT]` or `t [TEXT] [FROM] to [TO]` - Will translate the given text. By
|
64
|
+
default the **from** is **en** and **to** is **pt**
|
65
|
+
|
66
|
+
Example:
|
67
|
+
`t hello world` or `t hello world en to pt`
|
68
|
+
|
69
|
+
#### Search on StackOverflow
|
70
|
+
|
71
|
+
A simple search in StackOverflow
|
72
|
+
|
73
|
+
* `stack [TEXT_TO_SEACH]` - Will search on StackOverflow all results for that
|
74
|
+
text.
|
75
|
+
|
76
|
+
* `stack` - Will ask what you want to search on StackOverflow all results for that
|
77
|
+
|
78
|
+
#### Search GitHub repositories
|
79
|
+
|
80
|
+
A simple search for repository name
|
81
|
+
|
82
|
+
* `github [SEARCH_EXPRESSION]` - Show results for expression paginated every 10
|
83
|
+
|
84
|
+
#### Workstations
|
85
|
+
|
86
|
+
Workstations are a way to make it easy for you to open a set of applications by
|
87
|
+
simple commands.
|
88
|
+
|
89
|
+
The set of configurations are saved on **.chid.config** file.
|
90
|
+
|
91
|
+
**Note:** All commands bellow is possible run with prefix: `workstation [command]`
|
92
|
+
or `work [command]`.
|
93
|
+
|
94
|
+
* `work list` - List all workstations
|
95
|
+
* `work create` - Create a new workstation. Chid will ask for a name to set the
|
96
|
+
new workstation and after that will list all **applications** available on your
|
97
|
+
system to chosse witch one you wanna add
|
98
|
+
* `work destroy` - Chid will ask which workstation you want to destroy and chid
|
99
|
+
will destroy it after choose
|
100
|
+
* `work open` - Open a specific workstation. Chid will list all workstations to
|
101
|
+
choose one of them to open all applications
|
102
|
+
* `work open [workstation_name]` - Open a specific workstation without choose
|
103
|
+
from a list. Eg.: `work open base` - It will open all applications inside the
|
104
|
+
**base** workstation
|
105
|
+
|
106
|
+
**Note:** For linux users the **work create** is not working. You need create
|
107
|
+
manually (editing the .chid.config file). Will be explained how on
|
108
|
+
**How configure and customize your workstations** topic
|
109
|
+
|
110
|
+
#### Chid configuration
|
111
|
+
|
112
|
+
* `chid config` or `config` - Open the **.chid.config** file
|
113
|
+
|
114
|
+
## How configure and customize your workstations
|
115
|
+
|
116
|
+
The chid configuration file is installed on **~/.chid.config**. You can open: `$ chid
|
117
|
+
chid_config`
|
118
|
+
|
119
|
+
Chid config is a **YAML** file.
|
120
|
+
|
121
|
+
You can create the workstations just adding on :workstations: key.
|
122
|
+
|
123
|
+
The initial chid config file will be like:
|
124
|
+
|
125
|
+
```YAML
|
126
|
+
---
|
127
|
+
:chid:
|
128
|
+
:chid_path: "[CHID_FOLDER_PROJECT_PATH]"
|
129
|
+
:workstations: {}
|
130
|
+
```
|
131
|
+
|
132
|
+
#### Base configuration
|
133
|
+
|
134
|
+
To add a new *workstation* you can edit like:
|
135
|
+
|
136
|
+
```YAML
|
137
|
+
---
|
138
|
+
:chid:
|
139
|
+
:chid_path: "[CHID_FOLDER_PROJECT_PATH]"
|
140
|
+
:workstations:
|
141
|
+
:base: # Workstation Name
|
142
|
+
- iTerm #Application Name
|
143
|
+
- Safari
|
144
|
+
- Slack
|
145
|
+
```
|
146
|
+
|
147
|
+
After edit you can open the **base** workstation running:
|
148
|
+
|
149
|
+
* `$ chid workstation:open['base']` - As rake task
|
150
|
+
* `work open base` - With the **chid** app running
|
151
|
+
|
152
|
+
#### Advance configuration
|
153
|
+
|
154
|
+
Is possible you can customize some options with each Application when will open it
|
155
|
+
|
156
|
+
- Open the Terminal in a specific folder
|
157
|
+
- Open a Safari with a specific URL
|
158
|
+
- Any options which your application can use
|
159
|
+
|
160
|
+
```YAML
|
161
|
+
---
|
162
|
+
:chid:
|
163
|
+
:chid_path: "[CHID_FOLDER_PROJECT_PATH]"
|
164
|
+
:workstations:
|
165
|
+
:base: # Workstation Name
|
166
|
+
- iTerm ~/Workspaces/rake-workspace/chid/ & rake tmux_config # Will open
|
167
|
+
# in a specific folder and will run some Rake Task
|
168
|
+
- Safari https://github.com/rachidcalazans/chid # Will open the Safari
|
169
|
+
# in a specific URL
|
170
|
+
```
|
171
|
+
|
172
|
+
MY
|
173
|
+
|
174
|
+
puts a
|
175
|
+
|
6
176
|
end
|
7
177
|
|
8
178
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4.pre.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rachid Calazans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -84,19 +84,27 @@ description: Chid is an assistant to help your day-to-day life. It can be used i
|
|
84
84
|
some installations, news, configurations, workstations and more.
|
85
85
|
email:
|
86
86
|
- rachidcalazans@gmail.com
|
87
|
-
executables:
|
87
|
+
executables:
|
88
|
+
- chid
|
88
89
|
extensions: []
|
89
90
|
extra_rdoc_files: []
|
90
91
|
files:
|
92
|
+
- "#README.md#"
|
91
93
|
- CHANGELOG.md
|
92
94
|
- Gemfile
|
93
95
|
- Gemfile.lock
|
94
96
|
- README.md
|
95
97
|
- Rakefile
|
98
|
+
- bin/chid
|
96
99
|
- chid.gemspec
|
97
100
|
- etc/img/stack.png
|
98
101
|
- lib/chid.rb
|
99
102
|
- lib/chid/chid_config.rb
|
103
|
+
- lib/chid/commands/install.rb
|
104
|
+
- lib/chid/commands/installs/dotfile.rb
|
105
|
+
- lib/chid/commands/installs/node.rb
|
106
|
+
- lib/chid/commands/installs/postgres.rb
|
107
|
+
- lib/chid/commands/installs/rvm.rb
|
100
108
|
- lib/chid/currency_api.rb
|
101
109
|
- lib/chid/github_api.rb
|
102
110
|
- lib/chid/main.rb
|
@@ -107,6 +115,7 @@ files:
|
|
107
115
|
- lib/chid/yandex_translate_api.rb
|
108
116
|
- tasks/chid/config.rake
|
109
117
|
- tasks/chid/init.rake
|
118
|
+
- tasks/chid/install.rake
|
110
119
|
- tasks/chid/start.rake
|
111
120
|
- tasks/chid/update.rake
|
112
121
|
- tasks/currency/convert.rake
|
@@ -146,9 +155,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
155
|
version: '0'
|
147
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
157
|
requirements:
|
149
|
-
- - "
|
158
|
+
- - ">"
|
150
159
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
160
|
+
version: 1.3.1
|
152
161
|
requirements: []
|
153
162
|
rubyforge_project:
|
154
163
|
rubygems_version: 2.6.6
|