tipjoy 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.8
data/lib/tipjoy.rb CHANGED
@@ -20,6 +20,14 @@ module Tipjoy
20
20
  self.on = on
21
21
  end
22
22
 
23
+ def warn(msg)
24
+ info(msg)
25
+ end
26
+
27
+ def error(msg)
28
+ info(msg)
29
+ end
30
+
23
31
  def info(msg)
24
32
  puts msg if self.on?
25
33
  end
@@ -31,15 +31,15 @@ module Tipjoy
31
31
  private
32
32
 
33
33
  def tweet_payment
34
+ Tipjoy.logger.error("tweeting payment")
34
35
  response = self.client.update("p $#{amount} @#{to_account.twitter_username} #{message}")
36
+ Tipjoy.logger.error(" response " + response.inspect)
35
37
  self.tweet_id = response["id"]
36
38
  end
37
39
 
38
40
  def notify_tipjoy
39
41
  json = tipjoy_request(:post,"http://tipjoy.com/api/tweetpayment/notify/", { "tweet_id" => self.tweet_id })
40
- p json
41
42
  Transaction.new(json)
42
43
  end
43
-
44
44
  end
45
45
  end
@@ -21,11 +21,11 @@ module Tipjoy
21
21
  end
22
22
 
23
23
  def tipjoy_request(method, url, data={})
24
- Tipjoy.logger.info("requesting via #{method} " + url + "with args " + data.inspect)
24
+ Tipjoy.logger.error("requesting via #{method} " + url + "with args " + data.inspect)
25
25
  response = tipjoy_http_request(method, url, data)
26
26
 
27
27
  if !(200..299).include?(response.code.to_i)
28
- Tipjoy.logger.info(" RequestError " + response.inspect)
28
+ Tipjoy.logger.error(" RequestError " + response.inspect)
29
29
  raise RequestError.new('ah!')
30
30
  end
31
31
 
@@ -33,11 +33,11 @@ module Tipjoy
33
33
  json = JSON.parse(response.body)
34
34
 
35
35
  if json['result'] != 'success'
36
- Tipjoy.logger.info(" ResultError " + json.inspect)
36
+ Tipjoy.logger.error(" ResultError " + json.inspect)
37
37
  raise ::Tipjoy::ResultError.new(json.inspect)
38
38
  end
39
39
 
40
- Tipjoy.logger.info(" response: " + json.inspect)
40
+ Tipjoy.logger.error(" response: " + json.inspect)
41
41
  json
42
42
  end
43
43
  end
data/tipjoy.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tipjoy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Thompson
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tipjoy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Thompson