restclient_api_base 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbaee0b43e5ecd4ab1e7a8e21f505dd9987004d7
4
- data.tar.gz: aa61f4ae5eee159dffe08a81267f8c1359c95d90
3
+ metadata.gz: 009f94631761bcbbb178c07edc5d6d89eb5b52e8
4
+ data.tar.gz: 43016c1e9a1f62e336c1e3fd18c30fd610750875
5
5
  SHA512:
6
- metadata.gz: a5d9f0b00c3a926394d04c75ff3885002a622ba218a9e7180144172d9ef2eba8c8be6d6f9ae35cf4ff37f3a4e1dd0c6c424fb7f3e246ff82fd531d5220cefedd
7
- data.tar.gz: f1a0959055f80e20a82d546bcfbbde9e1042b971a3cf8d2f9a51970509b1e7b8a48459c38fb7c04a7b42c7f2099079bdd4fb3fc812297ce78b0297e510b0557e
6
+ metadata.gz: 05f794de4bbf17bd60a234bd82e1afd3f360fe2aa7ef26557e5a3c52b57bdd8734dedf1e81bf7386d85017f4a2e9499400d1df75aaf2d7bd055610017120d11f
7
+ data.tar.gz: 86a7709846cdbaee74d541459ef4e5006cd732162fe2161946c374a6f08560deb361c383a67e51e977dcb027f4efe9fb06847a72b7b7877999c232ba42c5e2bf
data/README.md CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  [rest-client](https://github.com/rest-client/rest-client)
10
10
 
11
+ [lumberjack](https://github.com/bdurand/lumberjack)
12
+
11
13
  ## Installation
12
14
 
13
15
  Add this line to your application's Gemfile:
@@ -32,7 +34,7 @@ module A
32
34
 
33
35
  self.base_url = 'http://www.example.com' # define app base url
34
36
  self.private_params = { key: 'api_key' } # define app secret key
35
- self.logger_name = 'Error' # define error name in Rails.logger or STDOUT
37
+ self.logger_name = 'Error' # define error name in log dir
36
38
  self.debug = true # debug
37
39
  end
38
40
 
@@ -44,7 +46,7 @@ res.headers # => {:content_type=>"text/html; charset=utf-8", :cache_control=>"p
44
46
  res = A.post('/api/xxx', key_1: value_1, key_2: value_2)
45
47
  res = A.patch('/api/xxx', key_1: value_1, key_2: value_2)
46
48
 
47
- write_log(res) # => [Error-2014-08-11 17:41:46] res..
49
+ write_log(res) # => [2014-08-19T22:10:29.438 INFO (32890)] res..
48
50
 
49
51
  ```
50
52
 
@@ -110,8 +110,7 @@ module RestclientApiBase
110
110
 
111
111
  def write_log *args
112
112
  logger = Lumberjack::Logger.new("log/#{logger_name}.log")
113
- log_tag = Time.now.strftime('%Y-%m-%d %H:%M:%S')
114
- logger.info("[#{log_tag}] " + args.join('-'))
113
+ logger.info(args.join('-'))
115
114
  end
116
115
 
117
116
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module RestclientApiBase
4
- VERSION = "0.0.8"
4
+ VERSION = "0.0.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restclient_api_base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spirit