mvclient 0.0.2 → 0.0.3
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/Gemfile +4 -3
- data/bin/mvclient +8 -3
- data/lib/mvclient.rb +1 -1
- data/lib/mvclient/auth.rb +9 -2
- data/lib/mvclient/client.rb +1 -1
- data/lib/mvclient/error.rb +1 -1
- data/mvclient.gemspec +5 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ea6a1b9366e1da7d0fac237aad1024c6b8fffc5
|
4
|
+
data.tar.gz: dd3d9817debf4ba0a6048df0ed790d5b21f9effa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ecae15a3d1b599c37430e0042412a7ef65ac3101f9fde2bded4f47ba612ea44b6677bd7f73a3a11bb0dd6f6f1a81d7fe73642e3dc99934a722c469264df74b3
|
7
|
+
data.tar.gz: fe58bf261dcd226071644b99b807fac23810ec6fad17a653cccc895e42a1c30d337e21946b42665246cafb54bf231ab2250c525c5b1ffce035e41eac226e7d3f
|
data/Gemfile
CHANGED
data/bin/mvclient
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'highline/import'
|
3
4
|
require 'optparse'
|
4
|
-
|
5
|
+
require 'mvclient'
|
5
6
|
|
6
7
|
USER_ID_REGEX = /\A\h{8}-\h{4}-user-\h{4}-\h{12}\z/
|
7
8
|
|
@@ -43,8 +44,12 @@ COMMANDS = {
|
|
43
44
|
$options[:password] = password
|
44
45
|
end
|
45
46
|
end
|
46
|
-
|
47
|
-
|
47
|
+
username = $options[:username]
|
48
|
+
username ||= ask("Enter your username: ")
|
49
|
+
password = $options[:password]
|
50
|
+
password ||= ask("Enter your password: ") { |q| q.echo = false }
|
51
|
+
|
52
|
+
$client.login!(username, password)
|
48
53
|
nil
|
49
54
|
},
|
50
55
|
|
data/lib/mvclient.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
require 'mvclient/client'
|
data/lib/mvclient/auth.rb
CHANGED
@@ -2,7 +2,7 @@ require 'json'
|
|
2
2
|
require 'httparty'
|
3
3
|
require 'fileutils'
|
4
4
|
require 'http-cookie'
|
5
|
-
|
5
|
+
require 'mvclient/error'
|
6
6
|
|
7
7
|
module Motivosity
|
8
8
|
class Auth
|
@@ -12,7 +12,14 @@ module Motivosity
|
|
12
12
|
debug_output $stderr if ENV['MOTIVOSITY_DEBUG'].to_i == 1
|
13
13
|
|
14
14
|
def initialize
|
15
|
-
|
15
|
+
cookie_jar_path = File.expand_path("~/.motivosity-session")
|
16
|
+
# make sure to create the cookie jar as read/write to current user only
|
17
|
+
old_umask = File.umask(0177)
|
18
|
+
begin
|
19
|
+
@cookies = HTTP::CookieJar.new(store: :mozilla, filename: cookie_jar_path)
|
20
|
+
ensure
|
21
|
+
File.umask(old_umask)
|
22
|
+
end
|
16
23
|
end
|
17
24
|
|
18
25
|
def login!(username, password)
|
data/lib/mvclient/client.rb
CHANGED
data/lib/mvclient/error.rb
CHANGED
data/mvclient.gemspec
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
1
4
|
Gem::Specification.new do |s|
|
2
5
|
s.name = 'mvclient'
|
3
|
-
s.version = '0.0.
|
6
|
+
s.version = '0.0.3'
|
4
7
|
s.date = '2015-04-09'
|
5
8
|
s.summary = "Motivosity API Client"
|
6
9
|
s.description = "A minimal Motivosity API v1 wrapper for Ruby, plus a command-line tool"
|
@@ -14,4 +17,5 @@ Gem::Specification.new do |s|
|
|
14
17
|
s.required_ruby_version = '>= 1.9.3'
|
15
18
|
s.add_dependency 'httparty', '~> 0'
|
16
19
|
s.add_dependency 'http-cookie', '~> 1'
|
20
|
+
s.add_dependency 'highline', '~> 1.7'
|
17
21
|
end
|
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.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Stanley
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: highline
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.7'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.7'
|
41
55
|
description: A minimal Motivosity API v1 wrapper for Ruby, plus a command-line tool
|
42
56
|
email: jstanley0@gmail.com
|
43
57
|
executables:
|