ocelots 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +1 -1
  2. data/lib/ocelots/cli.rb +11 -3
  3. data/ocelots.gemspec +1 -1
  4. metadata +4 -4
data/README.md CHANGED
@@ -18,7 +18,7 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- Set environment variable AUTH_TOKEN with your auth token from ocelots.
21
+ Set environment variable OCELOTS_AUTH_TOKEN with your auth token from ocelots.
22
22
 
23
23
  Override the default url (http://ocelots.herokuapp.com) with your own instance by setting the OCELOTS_URL environment variable.
24
24
 
data/lib/ocelots/cli.rb CHANGED
@@ -6,14 +6,22 @@ module Ocelots::Cli
6
6
  send command, *args
7
7
  end
8
8
 
9
- def phone email
9
+ def profile email
10
10
  persona_id = Digest::MD5.hexdigest email
11
11
  response = request "profiles/#{persona_id}"
12
- puts response['phone'] if response
12
+ if response
13
+ show response, :full_name
14
+ show response, :phone
15
+ show response, :photo_url
16
+ end
13
17
  end
14
18
  private
19
+ def show response, field
20
+ puts response[field.to_s] if response[field.to_s]
21
+ end
22
+
15
23
  def request command
16
- HTTParty.get "#{base_url}/api/#{command}?auth_token=#{ENV['AUTH_TOKEN']}"
24
+ HTTParty.get "#{base_url}/api/#{command}?auth_token=#{ENV['OCELOTS_AUTH_TOKEN']}"
17
25
  end
18
26
 
19
27
  def base_url
data/ocelots.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "ocelots"
7
- gem.version = '0.0.1'
7
+ gem.version = '0.0.2'
8
8
  gem.authors = ["Mark Ryall"]
9
9
  gem.email = ["mark@ryall.name"]
10
10
  gem.description = %q{Command line wrapper for ocelots api}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocelots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-19 00:00:00.000000000 Z
12
+ date: 2012-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -74,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  segments:
76
76
  - 0
77
- hash: -522041219923907600
77
+ hash: 1806221170895511770
78
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  none: false
80
80
  requirements:
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  segments:
85
85
  - 0
86
- hash: -522041219923907600
86
+ hash: 1806221170895511770
87
87
  requirements: []
88
88
  rubyforge_project:
89
89
  rubygems_version: 1.8.24