dealwithify 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/bin/dealwithify CHANGED
@@ -40,11 +40,25 @@ def align_images(image1, image2, coords1, coords2)
40
40
  image2.composite(image1, x_shift, y_shift, Magick::OverCompositeOp)
41
41
  end
42
42
 
43
+ if FACE_API_KEY.nil? || FACE_API_KEY == "" || FACE_API_SECRET.nil? || FACE_API_SECRET == ""
44
+ puts <<-eos
45
+ You need to set your API key and secret to environment variables before you can use dealwithify!
46
+
47
+ Read how to here: https://github.com/tomelm/deal-withify#setting-environment-variables
48
+ eos
49
+ exit
50
+ end
51
+
43
52
  img_src = ARGV[0]
44
53
  if img_src
45
54
  response = Net::HTTP.get(URI("http://api.face.com/faces/detect.json?api_key=#{FACE_API_KEY}&api_secret=#{FACE_API_SECRET}&urls=#{img_src}"))
46
55
  parsed_response = JSON.parse(response)
47
56
 
57
+ if parsed_response['status'] != 'success'
58
+ puts 'There was a problem with the face.com API. Try again later.'
59
+ exit
60
+ end
61
+
48
62
  tags = parsed_response['photos'].first['tags']
49
63
  rotate = false #!(params[:rotate]=='false' || params[:rotate]=='no')
50
64
  flip_flag = false #!(params[:flip]=='false' || params[:flip]=='no')
@@ -1,3 +1,3 @@
1
1
  module DealWithify
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dealwithify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -40,7 +40,6 @@ files:
40
40
  - Gemfile.lock
41
41
  - Rakefile
42
42
  - bin/dealwithify
43
- - config.ru
44
43
  - dealwithify.gemspec
45
44
  - glasses.png
46
45
  - lib/dealwithify.rb
data/config.ru DELETED
@@ -1,2 +0,0 @@
1
- require './server.rb'
2
- run Sinatra::Application