ohmage 0.0.8 → 0.0.9
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/lib/ohmage/clazz.rb +10 -0
- data/lib/ohmage/cli.rb +4 -5
- data/lib/ohmage/entity/clazz.rb +2 -0
- data/lib/ohmage/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2169fc32e39f48c29654ae1999aa620bbae898b
|
4
|
+
data.tar.gz: 3801b035b32612fc88ff2c8200d8d5ebb4412778
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 335dd945c810dfd59e84d5cef5816ead69f4ed401df096b3352bb9655a1e8398803b8237da36bed4e33da38e7258873d9e98dfd99cd20bdbd2f285f12b41c2fc
|
7
|
+
data.tar.gz: 02b671f8eb2c8c7700c1432fe71f66e36c6c7da2f738dc146c32361bb22562b9ecc4add0965dc469ea328bc2af4e0f61645aff38b06b8b75885460a2e27c213b
|
data/lib/ohmage/clazz.rb
CHANGED
@@ -32,6 +32,16 @@ module Ohmage
|
|
32
32
|
request.perform
|
33
33
|
class_read(class_urn_list: params[:class_urn])
|
34
34
|
end
|
35
|
+
|
36
|
+
def class_search(params = {})
|
37
|
+
request = Ohmage::Request.new(self, :post, 'class/search', params)
|
38
|
+
# TODO: make a utility to abstract creation of array of base objects
|
39
|
+
t = []
|
40
|
+
request.perform[:data].each do |k, v|
|
41
|
+
t << Ohmage::Clazz.new(k => v)
|
42
|
+
end
|
43
|
+
t
|
44
|
+
end
|
35
45
|
end
|
36
46
|
end
|
37
47
|
end
|
data/lib/ohmage/cli.rb
CHANGED
@@ -36,7 +36,7 @@ module Ohmage
|
|
36
36
|
option :class, desc: 'limit results to only documents attached to given urn list'
|
37
37
|
option :description, aliases: :d, desc: 'limit results to those with this string in description'
|
38
38
|
option :personal, type: :boolean, desc: 'will return only documents explicitly related to user if true'
|
39
|
-
def document
|
39
|
+
def document
|
40
40
|
ls = Ohmage.document_read(document_name_search: options[:search],
|
41
41
|
document_description_search: options[:description],
|
42
42
|
campaign_urn_list: options[:campaign],
|
@@ -79,7 +79,7 @@ module Ohmage
|
|
79
79
|
option :share, type: :boolean, default: false, desc: 'is document private or shared?'
|
80
80
|
option :class_role, type: :string, desc: 'class_role param: like urn:class:public;reader'
|
81
81
|
option :campaign_role, type: :string, desc: 'campaign_role param: like urn:campaign:snack;reader'
|
82
|
-
def document(file)
|
82
|
+
def document(file) # rubocop:disable all
|
83
83
|
case options[:share]
|
84
84
|
when false
|
85
85
|
privacy_state = 'private'
|
@@ -101,10 +101,9 @@ module Ohmage
|
|
101
101
|
privacy_state: privacy_state,
|
102
102
|
description: options[:description],
|
103
103
|
document_name: options[:name])
|
104
|
-
end
|
105
|
-
|
104
|
+
end
|
105
|
+
Ohmage::CliHelpers.format_output(new_document, options[:table], [:urn, :name, :description, :privacy_state], :name)
|
106
106
|
end
|
107
|
-
|
108
107
|
end
|
109
108
|
|
110
109
|
class Delete < Thor
|
data/lib/ohmage/entity/clazz.rb
CHANGED
data/lib/ohmage/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.9
|
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-04-
|
11
|
+
date: 2015-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: 1.3.5
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.4.
|
117
|
+
rubygems_version: 2.4.1
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: A Ruby interface for the ohmage 2.x API.
|