mvclient 0.0.3 → 0.0.4
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/README.md +1 -0
- data/bin/mvclient +6 -5
- data/mvclient.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d652b378faa8d7e6a0be19c5777a183d68ff5c8
|
4
|
+
data.tar.gz: 416e0f964c6f6157584ca6cb915225c6e49ddd00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcbe9d0b3cd2239e9099a7d5747fa2b1c28a5fde1c717d6bf645b990f10bd80b20db2d87719255b626dbd6fc9719f90bbb593b4a444caefac4eeedbfdb564584
|
7
|
+
data.tar.gz: 852f9dc5a46fa934966f4d4c337114d9c6ca566693e862f2825f227fd1b7e3f360ec866bafe1c545ebf404aa1fe217f454e084001e6e2191ae44655c91987dee
|
data/README.md
CHANGED
@@ -101,6 +101,7 @@ A command-line tool is also provided in `bin/mvclient`. Use `--help` to receive
|
|
101
101
|
```
|
102
102
|
mvclient login -u "user@example.com" -p "correct horse battery staple"
|
103
103
|
```
|
104
|
+
If either argument is omitted, you will be prompted to enter it.
|
104
105
|
|
105
106
|
### Log out
|
106
107
|
|
data/bin/mvclient
CHANGED
@@ -130,13 +130,10 @@ COMMANDS = {
|
|
130
130
|
user_id = $options[:user]
|
131
131
|
else
|
132
132
|
users = $client.search_for_user($options[:user])
|
133
|
-
if users.
|
134
|
-
puts "User '#{$options[:user]}' not found"
|
135
|
-
exit(1)
|
136
|
-
elsif users.size > 1
|
133
|
+
if users.size > 1
|
137
134
|
# check for an exact match among the search results
|
138
135
|
matching_users = users.select { |user| user['fullName'] == $options[:user] }
|
139
|
-
if matching_users.size
|
136
|
+
if matching_users.size != 1
|
140
137
|
puts "Multiple users match '#{$options[:user]}'; please be more specific."
|
141
138
|
puts "Try one of #{users.map{|user| "'#{user['fullName']}'"}.join(', ')}"
|
142
139
|
exit(1)
|
@@ -144,6 +141,10 @@ COMMANDS = {
|
|
144
141
|
users = matching_users
|
145
142
|
end
|
146
143
|
end
|
144
|
+
if users.empty?
|
145
|
+
puts "User '#{$options[:user]}' not found"
|
146
|
+
exit(1)
|
147
|
+
end
|
147
148
|
user_id = users[0]['id']
|
148
149
|
end
|
149
150
|
|
data/mvclient.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'mvclient'
|
6
|
-
s.version = '0.0.
|
6
|
+
s.version = '0.0.4'
|
7
7
|
s.date = '2015-04-09'
|
8
8
|
s.summary = "Motivosity API Client"
|
9
9
|
s.description = "A minimal Motivosity API v1 wrapper for Ruby, plus a command-line tool"
|