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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bcc9b2350949da64d9361170d4408babe8dd77fd
4
- data.tar.gz: 20d3cce981bceddaf96070f3ec30f6b43a89ff3d
3
+ metadata.gz: bc8d35cb9bb2b5c37bee23c4670d833bd3f4eb2f
4
+ data.tar.gz: 412e501ff0d538c18edd2fa988cdd550b17a9827
5
5
  SHA512:
6
- metadata.gz: eb4410226c47d6e7ee8f0d13b53cff492609ac255d6cc6353a72ad042db2963b0118beeac5d82e7239e64aa3edb67a8892e4db49c8fc0730716e29e4d86574d7
7
- data.tar.gz: d95e36bb4ff59644b9f9d946b0c45e8ae6663bd60adbcdcbd8eec2407bdb8b735df5fcf564a9679b3dea40df747126e110f25a43fa37648af3b8a1f20943004e
6
+ metadata.gz: 36d18242ef129581d0bc0354508b54dd857156273c8bd252e3bffd6a30182ef37596da37b5a93d0ff3b80f5cac0a279c1ad10f16d5d882713783fa5338e6ab30
7
+ data.tar.gz: 2e0f98c55500a6a6d664bdb79f5a2c40f35a4af3e89053da07516a039dd29846c46d2b2bcf40e76e2ebdcdf43c39fc39ec9cf04d4ae059191c5357af4063d6de
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  Gemfile.lock
2
+ pkg/
@@ -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
- raise ArisControl::ModificationError if users.has_key?(name)
20
- users[name] = opts.merge(email: email)
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
 
@@ -2,11 +2,13 @@ require 'thor'
2
2
  require 'pp'
3
3
 
4
4
  class ArisControl::Thor < Thor
5
- desc 'add username email', 'Adds a new aris user'
6
- method_option :ssh_key, type: :string, desc: 'The users ssh public key for git access'
7
- def add(name, email)
8
- bookkeeper.add(name: name, email: email, **options.dup)
9
- puts "Added user: #{name}, #{email}"
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
@@ -1,3 +1,3 @@
1
1
  module ArisControl
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
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.0.0
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
File without changes