aris-control 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/aris-control/bookkeeper.rb +3 -4
- data/lib/aris-control/thor.rb +7 -5
- data/lib/aris-control/version.rb +1 -1
- metadata +1 -2
- data/lib/aris-control-thor.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc8d35cb9bb2b5c37bee23c4670d833bd3f4eb2f
|
4
|
+
data.tar.gz: 412e501ff0d538c18edd2fa988cdd550b17a9827
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36d18242ef129581d0bc0354508b54dd857156273c8bd252e3bffd6a30182ef37596da37b5a93d0ff3b80f5cac0a279c1ad10f16d5d882713783fa5338e6ab30
|
7
|
+
data.tar.gz: 2e0f98c55500a6a6d664bdb79f5a2c40f35a4af3e89053da07516a039dd29846c46d2b2bcf40e76e2ebdcdf43c39fc39ec9cf04d4ae059191c5357af4063d6de
|
data/.gitignore
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
require_relative 'persistence'
|
2
2
|
|
3
3
|
module ArisControl
|
4
|
-
ModificationError = Class.new(StandardError)
|
5
|
-
|
6
4
|
class Bookkeeper
|
7
5
|
attr_reader :persistence, :users
|
8
6
|
|
@@ -16,8 +14,9 @@ module ArisControl
|
|
16
14
|
end
|
17
15
|
|
18
16
|
def add(name:, email:, **opts)
|
19
|
-
|
20
|
-
users[name]
|
17
|
+
email or raise ArgumentError
|
18
|
+
user = users[name] || {}
|
19
|
+
users[name] = user.merge(opts).merge(email: email)
|
21
20
|
persistence.store_users(users)
|
22
21
|
end
|
23
22
|
|
data/lib/aris-control/thor.rb
CHANGED
@@ -2,11 +2,13 @@ require 'thor'
|
|
2
2
|
require 'pp'
|
3
3
|
|
4
4
|
class ArisControl::Thor < Thor
|
5
|
-
desc 'add username
|
6
|
-
method_option :
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
desc 'add/update username', 'Adds/Updates an aris user.'
|
6
|
+
method_option :email, type: :string, required: true, desc: 'The users email address. Used for web login.'
|
7
|
+
method_option :ssh_key, type: :string, desc: 'The users ssh public key. Used for git access via ssh.'
|
8
|
+
method_option :env_vars, type: :hash, desc: 'The users app env vars. Env vars will be accessible inside the app via ENV[VAR-NAME].'
|
9
|
+
def add(name)
|
10
|
+
bookkeeper.add(name: name, **options)
|
11
|
+
puts "Added/Updated user: #{name}, #{options}"
|
10
12
|
puts "-----------------------------"
|
11
13
|
print_current_aris_users
|
12
14
|
end
|
data/lib/aris-control/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aris-control
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregory Igelmund
|
@@ -97,7 +97,6 @@ files:
|
|
97
97
|
- aris-control.gemspec
|
98
98
|
- bin/aris-control
|
99
99
|
- bin/console
|
100
|
-
- lib/aris-control-thor.rb
|
101
100
|
- lib/aris-control.rb
|
102
101
|
- lib/aris-control/bookkeeper.rb
|
103
102
|
- lib/aris-control/persistence.rb
|
data/lib/aris-control-thor.rb
DELETED
File without changes
|