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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/bin/mvclient +6 -5
  4. data/mvclient.gemspec +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ea6a1b9366e1da7d0fac237aad1024c6b8fffc5
4
- data.tar.gz: dd3d9817debf4ba0a6048df0ed790d5b21f9effa
3
+ metadata.gz: 6d652b378faa8d7e6a0be19c5777a183d68ff5c8
4
+ data.tar.gz: 416e0f964c6f6157584ca6cb915225c6e49ddd00
5
5
  SHA512:
6
- metadata.gz: 0ecae15a3d1b599c37430e0042412a7ef65ac3101f9fde2bded4f47ba612ea44b6677bd7f73a3a11bb0dd6f6f1a81d7fe73642e3dc99934a722c469264df74b3
7
- data.tar.gz: fe58bf261dcd226071644b99b807fac23810ec6fad17a653cccc895e42a1c30d337e21946b42665246cafb54bf231ab2250c525c5b1ffce035e41eac226e7d3f
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
 
@@ -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.empty?
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 > 1
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
 
@@ -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.3'
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"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mvclient
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
  - Jeremy Stanley