restclient_api_base 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/restclient_api_base/version.rb +1 -1
- data/lib/restclient_api_base.rb +5 -11
- data/restclient_api_base.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbaee0b43e5ecd4ab1e7a8e21f505dd9987004d7
|
4
|
+
data.tar.gz: aa61f4ae5eee159dffe08a81267f8c1359c95d90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5d9f0b00c3a926394d04c75ff3885002a622ba218a9e7180144172d9ef2eba8c8be6d6f9ae35cf4ff37f3a4e1dd0c6c424fb7f3e246ff82fd531d5220cefedd
|
7
|
+
data.tar.gz: f1a0959055f80e20a82d546bcfbbde9e1042b971a3cf8d2f9a51970509b1e7b8a48459c38fb7c04a7b42c7f2099079bdd4fb3fc812297ce78b0297e510b0557e
|
data/lib/restclient_api_base.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require "restclient_api_base/version"
|
4
4
|
require "json"
|
5
5
|
require "rest-client"
|
6
|
-
require "
|
6
|
+
require "lumberjack"
|
7
7
|
|
8
8
|
# For other framework except Rails
|
9
9
|
begin
|
@@ -105,19 +105,13 @@ module RestclientApiBase
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def logger_name
|
108
|
-
@logger_name ||= self.to_s
|
108
|
+
@logger_name ||= self.to_s.downcase.gsub(/::/, '_')
|
109
109
|
end
|
110
110
|
|
111
111
|
def write_log *args
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
Rails.logger.info(args.join('-'))
|
116
|
-
end
|
117
|
-
else
|
118
|
-
logger = Logger.new(STDOUT)
|
119
|
-
logger.info(log_tag + args.join('-'))
|
120
|
-
end
|
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('-'))
|
121
115
|
end
|
122
116
|
|
123
117
|
end
|
data/restclient_api_base.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency "rest-client", "~> 1.7"
|
22
|
+
spec.add_dependency "lumberjack", "~> 1.0"
|
22
23
|
spec.add_development_dependency "bundler", "~> 1.6"
|
23
24
|
spec.add_development_dependency "rake"
|
24
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restclient_api_base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spirit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: lumberjack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|