chid 0.1.6.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/CONTRIBUTING.md +75 -1
  4. data/Gemfile.lock +23 -36
  5. data/README.md +129 -79
  6. data/bin/chid +2 -25
  7. data/chid.gemspec +0 -6
  8. data/lib/chid.rb +0 -66
  9. data/lib/chid/chid_config.rb +4 -81
  10. data/lib/chid/commands/config.rb +48 -0
  11. data/lib/chid/commands/currency/convert.rb +50 -0
  12. data/lib/chid/commands/currency/list.rb +34 -0
  13. data/lib/chid/commands/currency/now.rb +47 -0
  14. data/lib/chid/commands/gitflow/commit.rb +0 -1
  15. data/lib/chid/commands/github.rb +40 -0
  16. data/lib/chid/commands/init.rb +1 -2
  17. data/lib/chid/commands/install.rb +1 -0
  18. data/lib/chid/commands/installs/dotfile.rb +1 -1
  19. data/lib/chid/commands/installs/node.rb +2 -2
  20. data/lib/chid/commands/installs/postgres.rb +2 -2
  21. data/lib/chid/commands/installs/rvm.rb +2 -2
  22. data/lib/chid/commands/installs/vim.rb +2 -2
  23. data/lib/chid/version.rb +1 -1
  24. data/spec/lib/chid/commands/init_spec.rb +4 -2
  25. data/tasks/install/yadr_dotfiles.rake +1 -0
  26. data/tasks/run/postgres.rake +1 -0
  27. data/tasks/update/os.rake +1 -0
  28. metadata +7 -52
  29. data/#README.md# +0 -222
  30. data/Rakefile +0 -18
  31. data/lib/chid/yandex_translate_api.rb +0 -39
  32. data/tasks/chid/config.rake +0 -5
  33. data/tasks/chid/init.rake +0 -19
  34. data/tasks/chid/install.rake +0 -14
  35. data/tasks/chid/start.rake +0 -26
  36. data/tasks/chid/update.rake +0 -14
  37. data/tasks/currency/convert.rake +0 -9
  38. data/tasks/currency/current.rake +0 -11
  39. data/tasks/currency/list.rake +0 -10
  40. data/tasks/github.rake +0 -12
  41. data/tasks/help.rake +0 -178
  42. data/tasks/install/node.rake +0 -18
  43. data/tasks/install/postgres.rake +0 -18
  44. data/tasks/install/rvm.rake +0 -21
  45. data/tasks/news.rake +0 -11
  46. data/tasks/stack_overflow.rake +0 -20
  47. data/tasks/tmux/config_windows.rake +0 -8
  48. data/tasks/tmux/new_session.rake +0 -9
  49. data/tasks/translate/yandex_list.rake +0 -7
  50. data/tasks/translate/yandex_translate.rake +0 -8
@@ -24,7 +24,7 @@ Usage:
24
24
 
25
25
  private
26
26
  def chid_config_path
27
- @chid_config_path ||= ::Chid::chid_config_path
27
+ @chid_config_path ||= ::ChidConfig.new.chid_config_path
28
28
  end
29
29
 
30
30
  def create_or_update_chid_config_file
@@ -67,7 +67,6 @@ Usage:
67
67
  def chid_config_file_exist?
68
68
  File.exist?(chid_config_path)
69
69
  end
70
-
71
70
  end
72
71
  end
73
72
  end
@@ -1,3 +1,4 @@
1
+ # @deprecated
1
2
  module Chid
2
3
  module Commands
3
4
  class Install
@@ -21,7 +21,7 @@ Usage:
21
21
 
22
22
  def run
23
23
  puts "\nInstalling the YADR Dotfiles..."
24
- ::Chid::on_linux do
24
+ ::ChidConfig.on_linux do
25
25
  system('sudo apt-get update')
26
26
  system('sudo apt-get install curl')
27
27
  system('sudo apt-get install zsh')
@@ -22,11 +22,11 @@ Usage:
22
22
  def run
23
23
  puts "\nInstalling the Node..."
24
24
 
25
- ::Chid::on_linux do
25
+ ::ChidConfig.on_linux do
26
26
  system('sudo apt-get install nodejs')
27
27
  end
28
28
 
29
- ::Chid::on_osx do
29
+ ::ChidConfig.on_osx do
30
30
  system('brew install node')
31
31
  end
32
32
 
@@ -24,11 +24,11 @@ Usage:
24
24
  def run
25
25
  puts "\nInstalling the Postgres..."
26
26
 
27
- ::Chid::on_linux do
27
+ ::ChidConfig.on_linux do
28
28
  system('sudo apt-get install postgresql postgresql-contrib')
29
29
  end
30
30
 
31
- ::Chid::on_osx do
31
+ ::ChidConfig.on_osx do
32
32
  system('brew install postgres')
33
33
  end
34
34
 
@@ -23,14 +23,14 @@ Usage:
23
23
  def run
24
24
  puts "\nInstalling the RVM..."
25
25
 
26
- ::Chid::on_linux do
26
+ ::ChidConfig.on_linux do
27
27
  system('sudo apt-add-repository -y ppa:rael-gc/rvm')
28
28
  system('sudo apt-get update')
29
29
  system('sudo apt-get install curl')
30
30
  system('sudo apt-get install rvm')
31
31
  end
32
32
 
33
- ::Chid::on_osx do
33
+ ::ChidConfig.on_osx do
34
34
  system('\curl -sSL https://get.rvm.io | bash')
35
35
  end
36
36
 
@@ -24,12 +24,12 @@ Usage:
24
24
  is_vim = do_vim?
25
25
  is_gvim = do_gvim?
26
26
 
27
- ::Chid::on_linux do
27
+ ::ChidConfig.on_linux do
28
28
  system('sudo apt-get install vim') if is_vim
29
29
  system('sudo apt-get install vim-gnome') if is_gvim
30
30
  end
31
31
 
32
- ::Chid::on_osx do
32
+ ::ChidConfig.on_osx do
33
33
  system('brew install vim && brew install macvim')
34
34
  end
35
35
 
@@ -1,3 +1,3 @@
1
1
  module Chid
2
- VERSION = "0.1.6.2"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -36,7 +36,8 @@ describe Chid::Commands::Init do
36
36
  let(:base_configuration) do
37
37
  {
38
38
  chid: {
39
- workstations: {}
39
+ workstations: {},
40
+ tmux_templates: {}
40
41
  }
41
42
  }
42
43
  end
@@ -52,7 +53,8 @@ describe Chid::Commands::Init do
52
53
  chid: {
53
54
  workstations: {
54
55
  base: 'vim'
55
- }
56
+ },
57
+ tmux_templates: {}
56
58
  }
57
59
  }
58
60
  end
@@ -1,3 +1,4 @@
1
+ # @todo: Extract it for a Command feature
1
2
  namespace :install do
2
3
 
3
4
  desc 'Install YADR Dotfiles'
@@ -1,3 +1,4 @@
1
+ # @todo: Extract it for a Command feature
1
2
  namespace :run do
2
3
 
3
4
  desc 'Start Postgres'
@@ -1,3 +1,4 @@
1
+ # @todo: Extract it for a Command feature
1
2
  namespace :update do
2
3
 
3
4
  desc 'Update os'
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.6.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rachid Calazans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-11 00:00:00.000000000 Z
11
+ date: 2019-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: http
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +66,6 @@ dependencies:
80
66
  - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: easy_translate
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
69
  description: Chid is an assistant to help your day-to-day life. It can be used in
98
70
  some installations, news, configurations, workstations and more.
99
71
  email:
@@ -103,20 +75,23 @@ executables:
103
75
  extensions: []
104
76
  extra_rdoc_files: []
105
77
  files:
106
- - "#README.md#"
107
78
  - CHANGELOG.md
108
79
  - CONTRIBUTING.md
109
80
  - Gemfile
110
81
  - Gemfile.lock
111
82
  - README.md
112
- - Rakefile
113
83
  - bin/chid
114
84
  - chid.gemspec
115
85
  - etc/img/stack.png
116
86
  - lib/chid.rb
117
87
  - lib/chid/chid_config.rb
118
88
  - lib/chid/command.rb
89
+ - lib/chid/commands/config.rb
90
+ - lib/chid/commands/currency/convert.rb
91
+ - lib/chid/commands/currency/list.rb
92
+ - lib/chid/commands/currency/now.rb
119
93
  - lib/chid/commands/gitflow/commit.rb
94
+ - lib/chid/commands/github.rb
120
95
  - lib/chid/commands/init.rb
121
96
  - lib/chid/commands/install.rb
122
97
  - lib/chid/commands/installs/dotfile.rb
@@ -139,32 +114,12 @@ files:
139
114
  - lib/chid/paginator.rb
140
115
  - lib/chid/stack_overflow_api.rb
141
116
  - lib/chid/version.rb
142
- - lib/chid/yandex_translate_api.rb
143
117
  - spec/lib/chid/command_spec.rb
144
118
  - spec/lib/chid/commands/init_spec.rb
145
119
  - spec/lib/chid/commands/workstation/open_spec.rb
146
120
  - spec/spec_helper.rb
147
- - tasks/chid/config.rake
148
- - tasks/chid/init.rake
149
- - tasks/chid/install.rake
150
- - tasks/chid/start.rake
151
- - tasks/chid/update.rake
152
- - tasks/currency/convert.rake
153
- - tasks/currency/current.rake
154
- - tasks/currency/list.rake
155
- - tasks/github.rake
156
- - tasks/help.rake
157
- - tasks/install/node.rake
158
- - tasks/install/postgres.rake
159
- - tasks/install/rvm.rake
160
121
  - tasks/install/yadr_dotfiles.rake
161
- - tasks/news.rake
162
122
  - tasks/run/postgres.rake
163
- - tasks/stack_overflow.rake
164
- - tasks/tmux/config_windows.rake
165
- - tasks/tmux/new_session.rake
166
- - tasks/translate/yandex_list.rake
167
- - tasks/translate/yandex_translate.rake
168
123
  - tasks/update/os.rake
169
124
  homepage: https://github.com/rachidcalazans/chid
170
125
  licenses:
@@ -1,222 +0,0 @@
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
- ![](http://g.recordit.co/pKS2oKCUuU.gif)
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
- * `install vim and/or gvim` - Install Vim
88
-
89
- #### Run
90
-
91
- * `run postgres` - Run the postgresql if you already have installed.
92
-
93
- #### Update
94
-
95
- * `update os` or `update` - Will update the linux os. For osx is not available
96
-
97
- #### News
98
-
99
- * `news` - Will show all news from some sites. BBC news, CNN, Espn,
100
- Mashable, Google, Techcrunch, Reddit
101
-
102
- #### Translate
103
-
104
- * `t [TEXT]` or `t [TEXT] [FROM] to [TO]` - Will translate the given text. By
105
- default the **from** is **en** and **to** is **pt**
106
-
107
- Example:
108
- `t hello world` or `t hello world en to pt`
109
-
110
- #### Search on StackOverflow
111
-
112
- A simple search in StackOverflow
113
-
114
- * `stack [TEXT_TO_SEACH]` - Will search on StackOverflow all results for that
115
- text.
116
-
117
- * `stack` - Will ask what you want to search on StackOverflow all results for that
118
-
119
- <p align="left">
120
- <img src="etc/img/stack.png" alt="stack sample" />
121
- </p>
122
-
123
- #### Search GitHub repositories
124
-
125
- A simple search for repository name
126
-
127
- * `github [SEARCH_EXPRESSION]` - Show results for expression paginated every 10
128
-
129
- #### Workstations
130
-
131
- Workstations are a way to make it easy for you to open a set of applications by
132
- simple commands.
133
-
134
- The set of configurations are saved on **.chid.config** file.
135
-
136
- **Note:** All commands bellow is possible run with prefix: `workstation [command]`
137
- or `work [command]`.
138
-
139
- * `work list` - List all workstations
140
- * `work create` - Create a new workstation. Chid will ask for a name to set the
141
- new workstation and after that will list all **applications** available on your
142
- system to chosse witch one you wanna add
143
- * `work destroy` - Chid will ask which workstation you want to destroy and chid
144
- will destroy it after choose
145
- * `work open` - Open a specific workstation. Chid will list all workstations to
146
- choose one of them to open all applications
147
- * `work open [workstation_name]` - Open a specific workstation without choose
148
- from a list. Eg.: `work open base` - It will open all applications inside the
149
- **base** workstation
150
-
151
- ![](http://g.recordit.co/WFqNuxORRd.gif)
152
-
153
- **Note:** For linux users the **work create** is not working. You need create
154
- manually (editing the .chid.config file). Will be explained how on
155
- **How configure and customize your workstations** topic
156
-
157
- #### Chid configuration
158
-
159
- * `chid config` or `config` - Open the **.chid.config** file
160
-
161
- ## How configure and customize your workstations
162
-
163
- The chid configuration file is installed on **~/.chid.config**. You can open: `$ chid
164
- chid_config`
165
-
166
- Chid config is a **YAML** file.
167
-
168
- You can create the workstations just adding on :workstations: key.
169
-
170
- The initial chid config file will be like:
171
-
172
- ```YAML
173
- ---
174
- :chid:
175
- :chid_path: "[CHID_FOLDER_PROJECT_PATH]"
176
- :workstations: {}
177
- ```
178
-
179
- #### Base configuration
180
-
181
- To add a new *workstation* you can edit like:
182
-
183
- ```YAML
184
- ---
185
- :chid:
186
- :chid_path: "[CHID_FOLDER_PROJECT_PATH]"
187
- :workstations:
188
- :base: # Workstation Name
189
- - iTerm #Application Name
190
- - Safari
191
- - Slack
192
- ```
193
-
194
- After edit you can open the **base** workstation running:
195
-
196
- * `$ chid workstation:open['base']` - As rake task
197
- * `work open base` - With the **chid** app running
198
-
199
- ![](http://g.recordit.co/VqTjUsQ9fy.gif)
200
-
201
- #### Advance configuration
202
-
203
- Is possible you can customize some options with each Application when will open it
204
-
205
- - Open the Terminal in a specific folder
206
- - Open a Safari with a specific URL
207
- - Any options which your application can use
208
-
209
- ```YAML
210
- ---
211
- :chid:
212
- :chid_path: "[CHID_FOLDER_PROJECT_PATH]"
213
- :workstations:
214
- :base: # Workstation Name
215
- - iTerm ~/Workspaces/rake-workspace/chid/ & rake tmux_config # Will open
216
- # in a specific folder and will run some Rake Task
217
- - Safari https://github.com/rachidcalazans/chid # Will open the Safari
218
- # in a specific URL
219
- ```
220
-
221
- ![](http://g.recordit.co/40rFYBBR1t.gif)
222
-