red_drop 0.1.0 → 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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +15 -14
- data/exe/red_drop +5 -0
- data/lib/red_drop/create.rb +6 -2
- data/lib/red_drop/delete.rb +6 -2
- data/lib/red_drop/status.rb +6 -2
- data/lib/red_drop/version.rb +2 -2
- data/lib/red_drop.rb +21 -21
- metadata +5 -4
- data/lib/red_drop/droplet_wizard.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e8d4807cbe21026e6016b4405af8c01927d7b4fcdf3db1fdaa554bd29010922
|
4
|
+
data.tar.gz: 575f53939c2f7226da78fa1b7a11dade5a271839c0384c0cc359aaf065a7fcab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 682a2b88b20d60249cade64720125d7a38c6f2208f23dd64cf4cbd761503250c9f1822bb8419bb553cbdaeef023a310f571f6e857fa5643f3fab7140fd900a66
|
7
|
+
data.tar.gz: 6507c953860a854f34aa475a4adaaf01d5b8b928c40d25888333a87622e9e80d602ecb1ba5644be4052e763a1a3f41f6ef034ea564387ad0e3aeccd938696704
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# red_drop
|
2
|
+
|
3
|
+
Simple cli for automating droplet management with sane defaults baked in.
|
2
4
|
|
3
5
|
## Installation
|
4
6
|
|
@@ -12,7 +14,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
12
14
|
|
13
15
|
## Usage
|
14
16
|
|
15
|
-
|
17
|
+
$ red_drop
|
16
18
|
|
17
19
|
## Development
|
18
20
|
|
@@ -20,22 +22,21 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
20
22
|
|
21
23
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
22
24
|
|
23
|
-
### Todos
|
24
|
-
|
25
|
-
- Research making gem executable
|
26
|
-
- Research TDD and minitest vs rspec
|
27
|
-
- refactor status module to match delete module droplets var structure
|
28
|
-
- maybe convert delete module droplets array to hash with array index as key to avoid accidental deletions
|
29
|
-
- refactor delete while loop to match that of red_drop.rb
|
30
|
-
- refactor auth to use Faraday which is used by DropletKit
|
31
|
-
- refactor status to get ip address of runnning droplets
|
32
|
-
- Research having delete get status before executing
|
33
|
-
- use cloud_init to automate server config for SSH, ufw, docker
|
34
|
-
|
35
25
|
## Contributing
|
36
26
|
|
37
27
|
Bug reports and pull requests are welcome on GitHub at https://github.com/sergio-ortiz/red_drop.
|
38
28
|
|
29
|
+
### Todos
|
30
|
+
|
31
|
+
- Research: TDD whether its w/ minitest or rspec
|
32
|
+
- Refactor: status module to match delete module droplets data structure
|
33
|
+
- Research: converting delete module droplets array to hash to avoid accidental deletions
|
34
|
+
- Refactor: delete module while loop to match that of red_drop.rb
|
35
|
+
- Research: Faraday, used by DropletKit, to replace built-in HTTP client library
|
36
|
+
- Research: status module to get ip address of runnning droplets
|
37
|
+
- Research: delete module to get droplet status before executing
|
38
|
+
- Research: using cloud_init to automate server config for SSH, ufw, docker
|
39
|
+
|
39
40
|
## License
|
40
41
|
|
41
42
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/exe/red_drop
ADDED
data/lib/red_drop/create.rb
CHANGED
data/lib/red_drop/delete.rb
CHANGED
data/lib/red_drop/status.rb
CHANGED
data/lib/red_drop/version.rb
CHANGED
data/lib/red_drop.rb
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
1
|
require "red_drop/auth"
|
4
|
-
auth = Auth.new
|
5
|
-
token = auth.token
|
6
|
-
|
7
2
|
require 'droplet_kit'
|
8
|
-
|
9
|
-
|
10
|
-
require "red_drop/
|
11
|
-
|
12
|
-
|
3
|
+
require "red_drop/create"
|
4
|
+
require "red_drop/status"
|
5
|
+
require "red_drop/delete"
|
6
|
+
|
7
|
+
class RedDrop
|
8
|
+
def initialize
|
9
|
+
client = DropletKit::Client.new(access_token: Auth.new.token)
|
10
|
+
|
11
|
+
@task_menu = {
|
12
|
+
"create" => Create.new(client),
|
13
|
+
"status" => Status.new(client),
|
14
|
+
"delete" => Delete.new(client)
|
15
|
+
}
|
16
|
+
end
|
13
17
|
|
14
|
-
|
18
|
+
def start
|
19
|
+
input = nil
|
15
20
|
|
16
|
-
|
17
|
-
|
21
|
+
until input.eql? "exit"
|
22
|
+
puts "\nEnter from task menu below.\n#{@task_menu.keys << "exit"}\n\n"
|
18
23
|
|
19
|
-
|
24
|
+
input = gets.chomp
|
20
25
|
|
21
|
-
|
22
|
-
|
23
|
-
droplet_wizard.create
|
24
|
-
when "status"
|
25
|
-
droplet_wizard.status
|
26
|
-
when "delete"
|
27
|
-
droplet_wizard.delete
|
26
|
+
@task_menu[input].execute if @task_menu.has_key? input
|
27
|
+
end
|
28
28
|
end
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: red_drop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Ortiz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest-reporters
|
@@ -42,7 +42,8 @@ description: A cli wriiten in ruby for executing automated droplet tasks with sa
|
|
42
42
|
configurations baked in.
|
43
43
|
email:
|
44
44
|
- ortiz.sergio0303@gmail.com
|
45
|
-
executables:
|
45
|
+
executables:
|
46
|
+
- red_drop
|
46
47
|
extensions: []
|
47
48
|
extra_rdoc_files: []
|
48
49
|
files:
|
@@ -52,11 +53,11 @@ files:
|
|
52
53
|
- LICENSE.txt
|
53
54
|
- README.md
|
54
55
|
- Rakefile
|
56
|
+
- exe/red_drop
|
55
57
|
- lib/red_drop.rb
|
56
58
|
- lib/red_drop/auth.rb
|
57
59
|
- lib/red_drop/create.rb
|
58
60
|
- lib/red_drop/delete.rb
|
59
|
-
- lib/red_drop/droplet_wizard.rb
|
60
61
|
- lib/red_drop/status.rb
|
61
62
|
- lib/red_drop/version.rb
|
62
63
|
- red_drop.gemspec
|