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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b67030fdc44b79b88f9968d5a98107c1fff7411f
4
- data.tar.gz: 52f21f73b062bc3deaf763cbe94e87b8fee0cbe4
3
+ metadata.gz: dbaee0b43e5ecd4ab1e7a8e21f505dd9987004d7
4
+ data.tar.gz: aa61f4ae5eee159dffe08a81267f8c1359c95d90
5
5
  SHA512:
6
- metadata.gz: 9f0f5c6dfc22ba6b72265055b59c5cac7a81f7b82fbc72a5a8683f5083bac4fcd3cb2a5a72ab4e7979522c01ac20e41d47daa8d1bb1a0f7747ba1beafd591dd8
7
- data.tar.gz: 494cd142e11392783895dcc7cf81b6ddb901cd573b68db96c0334a7e03664c2fcb79252ae6663e46587749f4dea5016e50a7413ac8d5c612f276912ea2d59dd8
6
+ metadata.gz: a5d9f0b00c3a926394d04c75ff3885002a622ba218a9e7180144172d9ef2eba8c8be6d6f9ae35cf4ff37f3a4e1dd0c6c424fb7f3e246ff82fd531d5220cefedd
7
+ data.tar.gz: f1a0959055f80e20a82d546bcfbbde9e1042b971a3cf8d2f9a51970509b1e7b8a48459c38fb7c04a7b42c7f2099079bdd4fb3fc812297ce78b0297e510b0557e
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module RestclientApiBase
4
- VERSION = "0.0.7"
4
+ VERSION = "0.0.8"
5
5
  end
@@ -3,7 +3,7 @@
3
3
  require "restclient_api_base/version"
4
4
  require "json"
5
5
  require "rest-client"
6
- require "logger"
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 + '::Error'
108
+ @logger_name ||= self.to_s.downcase.gsub(/::/, '_')
109
109
  end
110
110
 
111
111
  def write_log *args
112
- log_tag = logger_name + '-' + Time.now.strftime('%Y-%m-%d %H:%M:%S')
113
- if Object.const_defined? :Rails
114
- Rails.logger.tagged(log_tag) do
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
@@ -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.7
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-12 00:00:00.000000000 Z
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