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 +4 -4
- data/README.md +4 -2
- data/lib/restclient_api_base.rb +1 -2
- data/lib/restclient_api_base/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 009f94631761bcbbb178c07edc5d6d89eb5b52e8
|
4
|
+
data.tar.gz: 43016c1e9a1f62e336c1e3fd18c30fd610750875
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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) # => [
|
49
|
+
write_log(res) # => [2014-08-19T22:10:29.438 INFO (32890)] res..
|
48
50
|
|
49
51
|
```
|
50
52
|
|
data/lib/restclient_api_base.rb
CHANGED
@@ -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
|
-
|
114
|
-
logger.info("[#{log_tag}] " + args.join('-'))
|
113
|
+
logger.info(args.join('-'))
|
115
114
|
end
|
116
115
|
|
117
116
|
end
|