ohmage 0.0.3 → 0.0.4

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: 311f4105510d26daff442738344ae19ddc39e6cf
4
- data.tar.gz: b7f10a78a3cd1611edfbf1285dbb2978d549f55c
3
+ metadata.gz: 1b529813fac4bd1f2583b5a66a416486698b6c2b
4
+ data.tar.gz: f0a0bbb1fb4d6e057ef7fb59a2ace3d268268d6d
5
5
  SHA512:
6
- metadata.gz: ffc96de3bbf71909e7c45b97ea00f270218ded998a5dbe704285a9bf0bc0e62ebeacd64dd67c6ebd33a1642ed4bd4c2acc2a38d48dfd2a36452c22ff81193fa6
7
- data.tar.gz: 22ea00c8c84218ca48ec44c4495b144f7f1f2ce5365840dc74cc851fa010670e61a464a4f3e50a10b485434d96938a0f2567c300335a3798c568d3fafa7ec1f7
6
+ metadata.gz: 88ad714c926bfb372f9bb877bd6ac436aae25037c82d7df8389d6a204fef054a0cad4f9bebcd276e767891f6a0a7bdd701f1615021a5c99505b49b7139f06b14
7
+ data.tar.gz: 9d7c731bb2e8c231d208fa6f5f6a322ea95813c2eb1c31fad547b46943212f76ffd8661d49007d58d8d75bcb0c858b408559b3156d0e948ec1dca6adefde5152
@@ -14,6 +14,11 @@ module Ohmage
14
14
  end
15
15
  t
16
16
  end
17
+
18
+ def campaign_delete(params = {})
19
+ request = Ohmage::Request.new(self, :post, 'campaign/delete', params)
20
+ request.perform
21
+ end
17
22
  end
18
23
  end
19
24
  end
data/lib/ohmage/cli.rb CHANGED
@@ -13,20 +13,20 @@ module Ohmage
13
13
  option :search, aliases: :s, desc: 'a search string to limit the returned campaign list'
14
14
  def campaign
15
15
  ls = Ohmage.campaign_read(campaign_name_search: options[:search], output_format: 'short')
16
- Ohmage::CLI_Helpers.format_output(ls, options[:table], [:name, :urn, :description], :urn)
16
+ Ohmage::CliHelpers.format_output(ls, options[:table], [:name, :urn, :description], :urn)
17
17
  end
18
18
 
19
19
  desc 'ls class <options>', 'Lists classes current user has access to'
20
20
  def clazz(urn_list = nil)
21
21
  ls = Ohmage.class_read(class_urn_list: urn_list)
22
- Ohmage::CLI_Helpers.format_output(ls, options[:table], [:name, :urn, :description, :role, :users], :urn)
22
+ Ohmage::CliHelpers.format_output(ls, options[:table], [:name, :urn, :description, :role, :users], :urn)
23
23
  end
24
24
 
25
25
  desc 'ls user <options>', 'Lists users that match criteria of search, all viewable if no search'
26
26
  option :search, aliases: :s, desc: 'a search string to limit the returned user list'
27
27
  def user(username = nil)
28
28
  ls = Ohmage.user_read(user_list: username, username_search: options[:search])
29
- Ohmage::CLI_Helpers.format_output(ls, options[:table], [:username, :email_address, :enabled, :admin, :new_account], :username)
29
+ Ohmage::CliHelpers.format_output(ls, options[:table], [:username, :email_address, :enabled, :admin, :new_account], :username)
30
30
  end
31
31
  end
32
32
 
@@ -44,7 +44,7 @@ module Ohmage
44
44
  admin: options[:admin],
45
45
  enabled: options[:enabled],
46
46
  new_account: options[:new])
47
- Ohmage::CLI_Helpers.format_output(new_user, options[:table], [:username], :username)
47
+ Ohmage::CliHelpers.format_output(new_user, options[:table], [:username], :username)
48
48
  end
49
49
 
50
50
  desc 'create class <class_urn> <class_name> <options>', 'creates a new ohmage class with parameters'
@@ -53,7 +53,7 @@ module Ohmage
53
53
  new_class = Ohmage.class_create(class_urn: urn,
54
54
  class_name: name,
55
55
  description: options[:description])
56
- Ohmage::CLI_Helpers.format_output(new_class, options[:table], [:urn, :name, :description], :urn)
56
+ Ohmage::CliHelpers.format_output(new_class, options[:table], [:urn, :name, :description], :urn)
57
57
  end
58
58
  end
59
59
 
@@ -67,6 +67,11 @@ module Ohmage
67
67
  def user(username)
68
68
  Ohmage.user_delete(user_list: username)
69
69
  end
70
+
71
+ desc 'delete campaign <campaign_urn>', 'deletes an existing ohmage campaign'
72
+ def campaign(urn)
73
+ Ohmage.campaign_delete(campaign_urn: urn)
74
+ end
70
75
  end
71
76
 
72
77
  class Update < Thor
@@ -80,7 +85,7 @@ module Ohmage
80
85
  admin: options[:admin],
81
86
  enabled: options[:enabled],
82
87
  new_account: options[:new])
83
- Ohmage::CLI_Helpers.format_output(updated_user, options[:table], [:username, :admin, :enabled, :new_account], :username)
88
+ Ohmage::CliHelpers.format_output(updated_user, options[:table], [:username, :admin, :enabled, :new_account], :username)
84
89
  end
85
90
 
86
91
  desc 'update password <username> <options>', "updates provided user's password"
@@ -14,7 +14,7 @@ module Ohmage
14
14
 
15
15
  # @return [Integer]
16
16
  def patch
17
- 3
17
+ 4
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.3
4
+ version: 0.0.4
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-03-26 00:00:00.000000000 Z
11
+ date: 2015-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: 1.3.5
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.4.1
115
+ rubygems_version: 2.4.4
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: A Ruby interface for the ohmage 2.x API.