syslog_client 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,4 +2,5 @@ require 'syslog_client/base'
2
2
  require 'syslog_client/editor'
3
3
  require 'syslog_client/match_shop'
4
4
  require 'syslog_client/deal_flow'
5
+ require 'syslog_client/exception'
5
6
  require 'syslog_client/version'
@@ -11,15 +11,10 @@ module SyslogClient
11
11
  def _normalize_options(options)
12
12
  raise ArgumentError, 'options should be instance of Hash' unless options.is_a?(::Hash)
13
13
  options.symbolize_keys!
14
- options.assert_valid_keys(:deal_id, :operation, :operation_time, :operator, :result, :message )
14
+ options.assert_valid_keys(:deal_id, :operation, :operation_time, :operator, :result, :message)
15
15
 
16
16
  options.slice(:operation, :message, :operator, :result).map { |k, v| options[k] = v.to_s }
17
17
  options[:deal_id] = options[:deal_id].to_i
18
- if [Date, DateTime, Time].include?(options[:operation_time].class)
19
- options[:operation_time] = options[:operation_time].to_s(:db)
20
- else
21
- options[:operation_time] = options[:operation_time].to_s
22
- end
23
18
  end
24
19
 
25
20
  def get_operator(operation)
@@ -15,11 +15,6 @@ module SyslogClient
15
15
 
16
16
  options.slice(:user_id, :entry_id).map { |k, v| options[k] = v.to_i }
17
17
  options.slice(:reason, :entry_class).map { |k, v| options[k] = v.to_s }
18
- if [Date, DateTime, Time].include?(options[:operation_time].class)
19
- options[:operation_time] = options[:operation_time].to_s(:db)
20
- else
21
- options[:operation_time] = options[:operation_time].to_s
22
- end
23
18
 
24
19
  if options[:changes]
25
20
  _normalize_changes(options)
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+ module SyslogClient
3
+ class Exception < Base
4
+ class << self
5
+ protected
6
+ def log_of_options(options)
7
+ _normalize_options(options)
8
+ options.merge(:type => 'exception')
9
+ end
10
+
11
+ def _normalize_options(options)
12
+ raise ArgumentError, 'options should be instance of Hash' unless options.is_a?(::Hash)
13
+ options.symbolize_keys!
14
+ options.assert_valid_keys(:operator, :exception_class, :message, :operation_time)
15
+
16
+ options.slice(:operator, :exception_class, :message).map { |k, v| options[k] = v.to_s }
17
+ end
18
+ end
19
+ end
20
+ end
@@ -15,11 +15,6 @@ module SyslogClient
15
15
 
16
16
  options.slice(:reason, :source, :tuan_shop_id, :shop_info_id).map { |k, v| options[k] = v.to_s }
17
17
  options[:deal_id] = options[:deal_id].to_i
18
- if [Date, DateTime, Time].include?(options[:operation_time].class)
19
- options[:operation_time] = options[:operation_time].to_s(:db)
20
- else
21
- options[:operation_time] = options[:operation_time].to_s
22
- end
23
18
  end
24
19
  end
25
20
  end
@@ -1,3 +1,3 @@
1
1
  module SyslogClient
2
- Version = VERSION = '0.1.7'
2
+ Version = VERSION = '0.1.8'
3
3
  end
@@ -9,8 +9,9 @@ Gem::Specification.new do |s|
9
9
  s.authors = ['tumayun']
10
10
  s.email = 'tumayun.2010@gmail.com'
11
11
  s.files = `git ls-files`.split($/)
12
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
12
13
  s.require_paths = ["lib"]
13
14
  s.homepage = 'https://github.com/tumayun/syslog_client'
14
15
  s.add_dependency "logglier", "~> 0.2.8"
15
- s.add_dependency "mongo", "1.7.1"
16
+ s.add_dependency "mongo", "~> 1.7.1"
16
17
  end
metadata CHANGED
@@ -1,85 +1,107 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: syslog_client
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.7
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ hash: 11
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 8
10
+ version: 0.1.8
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - tumayun
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-12-28 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-12-28 00:00:00 +08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
15
22
  name: logglier
16
- requirement: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
17
25
  none: false
18
- requirements:
26
+ requirements:
19
27
  - - ~>
20
- - !ruby/object:Gem::Version
28
+ - !ruby/object:Gem::Version
29
+ hash: 7
30
+ segments:
31
+ - 0
32
+ - 2
33
+ - 8
21
34
  version: 0.2.8
22
35
  type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: mongo
23
39
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
40
+ requirement: &id002 !ruby/object:Gem::Requirement
25
41
  none: false
26
- requirements:
42
+ requirements:
27
43
  - - ~>
28
- - !ruby/object:Gem::Version
29
- version: 0.2.8
30
- - !ruby/object:Gem::Dependency
31
- name: mongo
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - '='
36
- - !ruby/object:Gem::Version
44
+ - !ruby/object:Gem::Version
45
+ hash: 9
46
+ segments:
47
+ - 1
48
+ - 7
49
+ - 1
37
50
  version: 1.7.1
38
51
  type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - '='
44
- - !ruby/object:Gem::Version
45
- version: 1.7.1
52
+ version_requirements: *id002
46
53
  description: syslog client with tuan800
47
54
  email: tumayun.2010@gmail.com
48
55
  executables: []
56
+
49
57
  extensions: []
58
+
50
59
  extra_rdoc_files: []
51
- files:
60
+
61
+ files:
52
62
  - .gitignore
53
63
  - README.md
54
64
  - lib/syslog_client.rb
55
65
  - lib/syslog_client/base.rb
56
66
  - lib/syslog_client/deal_flow.rb
57
67
  - lib/syslog_client/editor.rb
68
+ - lib/syslog_client/exception.rb
58
69
  - lib/syslog_client/match_shop.rb
59
70
  - lib/syslog_client/version.rb
60
71
  - syslog_client.gemspec
72
+ has_rdoc: true
61
73
  homepage: https://github.com/tumayun/syslog_client
62
74
  licenses: []
75
+
63
76
  post_install_message:
64
77
  rdoc_options: []
65
- require_paths:
78
+
79
+ require_paths:
66
80
  - lib
67
- required_ruby_version: !ruby/object:Gem::Requirement
81
+ required_ruby_version: !ruby/object:Gem::Requirement
68
82
  none: false
69
- requirements:
70
- - - ! '>='
71
- - !ruby/object:Gem::Version
72
- version: '0'
73
- required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ hash: 3
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
91
  none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ hash: 3
96
+ segments:
97
+ - 0
98
+ version: "0"
79
99
  requirements: []
100
+
80
101
  rubyforge_project:
81
- rubygems_version: 1.8.24
102
+ rubygems_version: 1.3.7
82
103
  signing_key:
83
104
  specification_version: 3
84
105
  summary: syslog client!
85
106
  test_files: []
107
+