vps_cli 0.1.6 → 0.1.8

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: a2243d4825c7f22e627f104f87e98fb90af187dd68721def56b7eaa01e9fae5a
4
- data.tar.gz: 5c77170b9ca3639430959a9d3d4a370bc4d3e4ae61db03deb6e0298b10d81a0e
3
+ metadata.gz: 8c79f00707b5c1498935dbcd4c2d6cf9574a819a95431e0be14a315ea176efdd
4
+ data.tar.gz: 3a40b7df15968833f90308a1f9bb6955854350fd2bc39982af7d41b9198c2536
5
5
  SHA512:
6
- metadata.gz: 00afe546a96f0ea28480739cfcafd15651644218f66407ae2ae753d4be39498edd52542b4e893cbc0348c9a78806839c1fc97a9c4235ba96255c078b3a32c9ee
7
- data.tar.gz: 90e3e5697d6b580dd7aac0028362943cded6599cd6a35f7c2c3e51a3f9fda2589feb3d2ec2e67d320cb24db7d4084713e15fd31b83992dacd9219e002d421717
6
+ metadata.gz: d4230105862398502026744aa13fc7cd2c0fe0bfad6150d648ee1cb23fc5e450eac48272eae71c1821db1d162f5a6b23723d45c994d6ca193049019cab6be580
7
+ data.tar.gz: f2c38c5a5d2f521c07b3d8cd612d95eef34ccadd2c43d8c10899a1143ae54a0de1b0c1ab26ab650a462c2b26700cfba64c97744fa5bb5b147c1638bf2688df1f
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
 
13
13
  *logs*
14
14
  /.tmp
15
+ /Gemfile.lock
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # VpsCli
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vps_cli`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This is merely a gem so I do not have dotfiles and vps-cli concerns mixed
4
4
 
5
5
  This gem is currently unfinished and purely for my own personal use.
6
6
  This project of pulling and pushing dotfiles as well as performing installations
@@ -11,7 +11,7 @@ etc has taken many iterations and this is its 3rd iteration
11
11
  Add this line to your application's Gemfile:
12
12
 
13
13
  ```ruby
14
- gem 'vps_cli', git: 'https://github.com/ParamagicDev/vps_cli'
14
+ gem 'vps_cli'
15
15
  ```
16
16
 
17
17
  And then execute:
@@ -53,6 +53,10 @@ vps-cli git_pull
53
53
  vps-cli git_push
54
54
  # pushes changes in your config_files directory
55
55
 
56
+ vps-cli fresh_install
57
+ # used for my own personal purposes, please dont run it if you havent
58
+ # glossed over the contents
59
+
56
60
  vps-cli
57
61
  # will list all available commands
58
62
  ```
@@ -65,7 +69,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
65
69
 
66
70
  ## Contributing
67
71
 
68
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/vps_cli.
72
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ParamagicDev/vps_cli.
69
73
 
70
74
  ## License
71
75
 
data/lib/vps_cli/cli.rb CHANGED
@@ -11,6 +11,12 @@ module VpsCli
11
11
  # this is available as a flag for all methods
12
12
  class_option :config, aliases: :c, default: File.join(Dir.home, '.vps_cli')
13
13
 
14
+ desc 'version', 'prints the vps-cli version information'
15
+ def version
16
+ puts "vps-cli version #{VpsCli::VERSION}"
17
+ end
18
+ map %w[-v --version] => :version
19
+
14
20
  desc 'fresh_install', 'accepts no arguments, my own personal command'
15
21
  def fresh_install
16
22
  VpsCli.load_configuration(options[:config])
@@ -22,7 +28,6 @@ module VpsCli
22
28
  VpsCli.errors.each { |error| puts error.message }
23
29
  end
24
30
 
25
-
26
31
  desc 'init [-c (File)]', 'Creates a default vps_cli configuration file in the home directory'
27
32
  def init(file = options[:config])
28
33
  VpsCli.create_configuration(file)
@@ -73,8 +78,7 @@ module VpsCli
73
78
 
74
79
  desc 'git_push [message]', 'Automatically pushes changes of your config_files'
75
80
  def git_push(message = nil)
76
-
77
- message ||= "auto push files"
81
+ message ||= 'auto push files'
78
82
 
79
83
  swap_dir do
80
84
  Rake.sh('git add -A')
@@ -5,6 +5,9 @@ module VpsCli
5
5
  OMZ_PLUGINS = File.join(OMZ_DIR, 'custom', 'plugins')
6
6
  # Installes the required packages
7
7
  class Install
8
+ # Runs the #all_install method, simply a wrapper to catch errors
9
+ # and check if the user is running linux
10
+ # @see all_install
8
11
  def self.full
9
12
  unless OS.linux?
10
13
  puts 'You are not running on linux. No packages installed.'
@@ -18,6 +21,17 @@ module VpsCli
18
21
  end
19
22
  end
20
23
 
24
+ # Runs through multiple methods listed below
25
+ # @see #prep
26
+ # @see #packages
27
+ # @see #other_tools
28
+ # @see #neovim_support
29
+ # @see #omz_full_install
30
+ # @see Setup#full
31
+ # @see #install_tmux_plugin_manager_and_plugins
32
+ # @see #plug_install_vim_neovim
33
+ # @see #install_gems
34
+ # @see add_language_servers
21
35
  def self.all_install
22
36
  prep
23
37
  packages
@@ -28,14 +42,18 @@ module VpsCli
28
42
  install_tmux_plugin_manager_and_plugins
29
43
  plug_install_vim_neovim
30
44
  install_gems
45
+ add_language_servers
31
46
  end
32
47
 
48
+ # simply runs apt update, upgrade, and dist-upgrade
33
49
  def self.prep
34
50
  Rake.sh('sudo apt-get update')
35
51
  Rake.sh('sudo apt-get upgrade -y')
36
52
  Rake.sh('sudo apt-get dist-upgrade -y')
37
53
  end
38
54
 
55
+ # Runs through items found in Packages::UBUNTU
56
+ # @see Packages::UBUNTU
39
57
  def self.packages
40
58
  Packages::UBUNTU.each do |item|
41
59
  Rake.sh("sudo apt-get install -y #{item}")
@@ -44,6 +62,8 @@ module VpsCli
44
62
  end
45
63
  end
46
64
 
65
+ # installs various other tools and fixes an issue with npm / nodejs
66
+ # installs heroku, ngrok, and adds docker groups
47
67
  def self.other_tools
48
68
  # update npm, there are some issues with ubuntu 18.10 removing npm
49
69
  # and then being unable to update it
@@ -66,14 +86,16 @@ module VpsCli
66
86
  # add docker
67
87
  username = Dir.home.split('/')[2]
68
88
  begin
69
- Rake.sh('groupadd docker')
70
- Rake.sh("usermod -aG docker #{username}")
89
+ Rake.sh('sudo groupadd docker')
90
+ Rake.sh("sudo usermod -aG docker #{username}")
71
91
  rescue RuntimeError
72
92
  puts 'docker group already exists.'
73
93
  puts 'moving on...'
74
94
  end
75
95
  end
76
96
 
97
+ # adds neovim support via pip3
98
+ # Also adds neovim via npm for js support
77
99
  def self.neovim_support
78
100
  Rake.sh('sudo -H pip2 install neovim --system')
79
101
  Rake.sh('sudo -H pip3 install neovim --system')
@@ -82,12 +104,18 @@ module VpsCli
82
104
  Rake.sh(%(yes "\n" | sudo npm install -g neovim))
83
105
  end
84
106
 
107
+ # Runs the following commands, simply a wrapper
108
+ # @see #install_oh_my_zsh
109
+ # @see #install_syntax_highlighting
110
+ # @see #install_autosuggestions
85
111
  def self.omz_full_install
86
112
  install_oh_my_zsh
87
113
  install_syntax_highlighting
88
114
  install_autosuggestions
89
115
  end
90
116
 
117
+ # Install Oh my zsh
118
+ # @see https://github.com/zsh-users/zsh-autosuggestions
91
119
  def self.install_oh_my_zsh
92
120
  return if Dir.exist?(OMZ_DIR)
93
121
 
@@ -102,6 +130,8 @@ module VpsCli
102
130
  Rake.sh("git clone https://github.com/zsh-users/zsh-autosuggestions #{auto}")
103
131
  end
104
132
 
133
+ # Install Oh my zsh syntax highlighting
134
+ # @see https://github.com/zsh-users/zsh-syntax-highlighting.git
105
135
  def self.install_syntax_highlighting
106
136
  syntax = File.join(OMZ_PLUGINS, 'zsh-syntax-highlighting')
107
137
  return if File.exist?(syntax)
@@ -109,18 +139,18 @@ module VpsCli
109
139
  Rake.sh("git clone https://github.com/zsh-users/zsh-syntax-highlighting.git #{syntax}")
110
140
  end
111
141
 
142
+ # Runs PlugInstall for neovim
112
143
  def self.plug_install_vim_neovim
113
- # Rake.sh(%(vim +'PlugInstall --sync' +qa))
114
- # Rake.sh(%(vim +'PlugUpdate --sync' +qa))
115
144
  Rake.sh(%(nvim +'PlugInstall --sync' +qa))
116
145
  Rake.sh(%(nvim +'PlugUpdate --sync' +qa))
117
146
  end
118
147
 
148
+ # will install tmux plugin manager
119
149
  def self.install_tmux_plugin_manager_and_plugins
120
150
  install_path = File.join(Dir.home, '.tmux', 'plugins', 'tpm')
121
151
  unless File.exist?(install_path)
122
152
  Rake.mkdir_p(install_path)
123
- Rake.sh("git clone https://github.com/tmux-plugins/tpm #{instal_path}")
153
+ Rake.sh("git clone https://github.com/tmux-plugins/tpm #{install_path}")
124
154
  end
125
155
  # start a server but don't attach to it
126
156
  Rake.sh('tmux start-server')
@@ -132,9 +162,30 @@ module VpsCli
132
162
  Rake.sh('tmux kill-server')
133
163
  end
134
164
 
165
+ # Installs all gems located in Packages::GEMS
166
+ # Also will runs 'yard gems' to document all gems via yard
135
167
  def self.install_gems
136
168
  Packages::GEMS.each { |g| Rake.sh("gem install #{g}") }
169
+ # documents all gems via yard
137
170
  Rake.sh('yard gems')
138
171
  end
172
+
173
+ # Adds the following language servers
174
+ # bash-language-server
175
+ # vscode-html-languageserver-bin
176
+ # vscode-css-languageserver-bin
177
+ # javascript-typescript-langserver
178
+ # does not add solargraph for ruby, installed via gems
179
+ def self.add_language_servers
180
+ npm_install = 'sudo npm install --global'
181
+ # bash
182
+ Rake.sh("#{npm_install} bash-language-server --unsafe-perm")
183
+ # html
184
+ Rake.sh("#{npm_install} vscode-html-languageserver-bin")
185
+ # css
186
+ Rake.sh("#{npm_install} vscode-css-languageserver-bin")
187
+ # js
188
+ Rake.sh("#{npm_install} javascript-typescript-langserver")
189
+ end
139
190
  end
140
191
  end
@@ -1,3 +1,3 @@
1
1
  module VpsCli
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vps_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - paramagicdev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-25 00:00:00.000000000 Z
11
+ date: 2019-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -119,7 +119,6 @@ files:
119
119
  - ".gitignore"
120
120
  - ".travis.yml"
121
121
  - Gemfile
122
- - Gemfile.lock
123
122
  - LICENSE.txt
124
123
  - README.md
125
124
  - Rakefile
data/Gemfile.lock DELETED
@@ -1,62 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- vps_cli (0.1.6)
5
- thor (~> 0.20)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- coderay (1.1.2)
11
- ffi (1.10.0)
12
- formatador (0.2.5)
13
- guard (2.15.0)
14
- formatador (>= 0.2.4)
15
- listen (>= 2.7, < 4.0)
16
- lumberjack (>= 1.0.12, < 2.0)
17
- nenv (~> 0.1)
18
- notiffany (~> 0.0)
19
- pry (>= 0.9.12)
20
- shellany (~> 0.0)
21
- thor (>= 0.18.1)
22
- guard-compat (1.2.1)
23
- guard-minitest (2.4.6)
24
- guard-compat (~> 1.2)
25
- minitest (>= 3.0)
26
- listen (3.1.5)
27
- rb-fsevent (~> 0.9, >= 0.9.4)
28
- rb-inotify (~> 0.9, >= 0.9.7)
29
- ruby_dep (~> 1.2)
30
- lumberjack (1.0.13)
31
- method_source (0.9.2)
32
- minitest (5.11.3)
33
- nenv (0.3.0)
34
- notiffany (0.1.1)
35
- nenv (~> 0.1)
36
- shellany (~> 0.0)
37
- pry (0.12.2)
38
- coderay (~> 1.1.0)
39
- method_source (~> 0.9.0)
40
- rake (10.5.0)
41
- rb-fsevent (0.10.3)
42
- rb-inotify (0.10.0)
43
- ffi (~> 1.0)
44
- ruby_dep (1.5.0)
45
- shellany (0.0.1)
46
- thor (0.20.3)
47
- yard (0.9.19)
48
-
49
- PLATFORMS
50
- ruby
51
-
52
- DEPENDENCIES
53
- bundler (~> 2.0)
54
- guard (~> 2.15)
55
- guard-minitest (~> 2.4)
56
- minitest (~> 5.0)
57
- rake (~> 10.0)
58
- vps_cli!
59
- yard (~> 0.9)
60
-
61
- BUNDLED WITH
62
- 2.0.1