ohmage 0.0.16 → 0.0.17

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: 19a4c58afedd2f5d94c5673a3b0f784098c6d77d
4
- data.tar.gz: 7603826b429d72afad3190da49064cc2ec7fae7c
3
+ metadata.gz: 6b6af6c44dcf7a91158b0648f24d4ad39d708292
4
+ data.tar.gz: 49c032816319058a8eb5b536681c83753d62c19e
5
5
  SHA512:
6
- metadata.gz: 0c4a9c3164e0dd93ec3bed7a729d4788f9b2acac8463b0133a405bf8138b1690b3302ce823152f0689e2b97e5567beb303052509cea22ceb7a092456757bd580
7
- data.tar.gz: c0321efe74a6a286da0996c6e02a9ee73e5319aef5de0b0fd6334bb08122906dab48a2019644bdf6dbb940971388e385b08946c6c3f6c0c191c29657a32740f4
6
+ metadata.gz: eae03f34e5d08f8add1724204123dddadbaf9564594cceebcd6ddb8f4afd1846403ad1ad4b75af5e0dbaf5209aaa9a4031dcef83280a41c2407b26fed27f5c3b
7
+ data.tar.gz: 14c9110115b478dcad18800973c9e25847090e429a18a3c598829f04d89667f71477112ff4361fb4b4eac2ad2cd7d348d0c92ea98f867d4f36609b57b8790443
data/lib/ohmage/cli.rb CHANGED
@@ -150,6 +150,27 @@ module Ohmage
150
150
  def password(username)
151
151
  Ohmage.user_password(username: username, new_password: options[:password])
152
152
  end
153
+
154
+ desc 'update class <class urn> <options>', 'updates values for a given class'
155
+ option :description, aliases: :d, type: :string, desc: 'description of class'
156
+ option :name, aliases: :n, type: :string, desc: 'name of class'
157
+ option :privileged, type: :string, desc: 'privileged users to add'
158
+ option :restricted, type: :string, desc: 'restricted users to add'
159
+ option :remove, type: :string, desc: 'users to remove'
160
+ def clazz(urn) # rubocop:disable all
161
+ params = {}
162
+ params[:class_urn] = urn
163
+ params[:class_name] = options[:name] if options[:name]
164
+ params[:description] = options[:description] if options[:description]
165
+ user_list = ''
166
+ user_list << options[:privileged].gsub(',', ';privileged,') + ';privileged,' if options[:privileged]
167
+ user_list << options[:restricted].gsub(',', ';restricted,') + ';restricted' if options[:restricted]
168
+ params[:user_role_list_add] = user_list
169
+ params[:user_list_remove] = options[:remove] if options[:remove]
170
+ update_class = Ohmage.class_update(params)
171
+ Ohmage::CliHelpers.format_output(update_class, options[:table], [:urn, :name, :description, :role, :users], :urn)
172
+ end
173
+ map class: :clazz
153
174
  end
154
175
 
155
176
  desc 'hi', 'returns current config'
@@ -14,7 +14,7 @@ module Ohmage
14
14
 
15
15
  # @return [Integer]
16
16
  def patch
17
- 16
17
+ 17
18
18
  end
19
19
 
20
20
  # @return [Integer, NilClass]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohmage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Nolen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-16 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable