bixby-common 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,10 +28,12 @@ GIT
28
28
 
29
29
  GIT
30
30
  remote: https://github.com/chetan/test_guard.git
31
- revision: dc2f30da10945323a3e8f377311b6df54f46ad4c
31
+ revision: ad59542db1fca57018dd771d19b1d636252e4c98
32
32
  specs:
33
- test_guard (0.1.2)
33
+ test_guard (0.2.0)
34
34
  awesome_print
35
+ debugger
36
+ debugger-pry
35
37
  growl
36
38
  guard
37
39
  simplecov
@@ -42,61 +44,72 @@ GIT
42
44
  GEM
43
45
  remote: https://rubygems.org/
44
46
  specs:
45
- addressable (2.3.2)
47
+ addressable (2.3.3)
46
48
  ansi (1.4.3)
47
49
  awesome_print (1.1.0)
48
- bouncy-castle-java (1.5.0146.1)
49
- coderay (1.0.8)
50
+ bouncy-castle-java (1.5.0147)
51
+ coderay (1.0.9)
50
52
  colorize (0.5.8)
53
+ columnize (0.3.6)
51
54
  crack (0.3.2)
52
55
  curb (0.8.3)
53
- ffi (1.3.1)
54
- ffi (1.3.1-java)
56
+ debugger (1.5.0)
57
+ columnize (>= 0.3.1)
58
+ debugger-linecache (~> 1.2.0)
59
+ debugger-ruby_core_source (~> 1.2.0)
60
+ debugger-linecache (1.2.0)
61
+ debugger-pry (0.1.1)
62
+ debugger (~> 1)
63
+ pry (>= 0.9.9)
64
+ debugger-ruby_core_source (1.2.0)
65
+ ffi (1.6.0)
66
+ ffi (1.6.0-java)
67
+ formatador (0.2.4)
55
68
  git (1.2.5)
56
69
  growl (1.0.3)
57
- guard (1.6.2)
70
+ guard (1.7.0)
71
+ formatador (>= 0.2.4)
58
72
  listen (>= 0.6.0)
59
73
  lumberjack (>= 1.0.2)
60
74
  pry (>= 0.9.10)
61
- terminal-table (>= 1.4.3)
62
75
  thor (>= 0.14.6)
63
76
  hirb (0.7.1)
64
- httpclient (2.3.2)
65
- jruby-openssl (0.8.2)
66
- bouncy-castle-java (>= 1.5.0146.1)
77
+ httpclient (2.3.3)
78
+ jruby-openssl (0.8.7)
79
+ bouncy-castle-java (>= 1.5.0147)
67
80
  json (1.7.7)
68
81
  json (1.7.7-java)
69
- listen (0.7.2)
82
+ listen (0.7.3)
70
83
  little-plugger (1.1.3)
71
84
  logging (1.8.1)
72
85
  little-plugger (>= 1.1.3)
73
86
  multi_json (>= 1.3.6)
74
- lumberjack (1.0.2)
87
+ lumberjack (1.0.3)
75
88
  metaclass (0.0.1)
76
89
  method_source (0.8.1)
77
- minitest (4.6.0)
78
- mocha (0.13.2)
90
+ minitest (4.7.0)
91
+ mocha (0.13.3)
79
92
  metaclass (~> 0.0.1)
80
- multi_json (1.5.1)
81
- oj (2.0.4)
82
- pry (0.9.11.4)
93
+ multi_json (1.7.2)
94
+ oj (2.0.10)
95
+ pry (0.9.12)
83
96
  coderay (~> 1.0.5)
84
97
  method_source (~> 0.8)
85
98
  slop (~> 3.4)
86
- pry (0.9.11.4-java)
99
+ pry (0.9.12-java)
87
100
  coderay (~> 1.0.5)
88
101
  method_source (~> 0.8)
89
102
  slop (~> 3.4)
90
103
  spoon (~> 0.0)
91
104
  rack (1.5.2)
92
- rake (10.0.3)
105
+ rake (10.0.4)
93
106
  rb-fchange (0.0.6)
94
107
  ffi
95
108
  rb-fsevent (0.9.3)
96
109
  rb-inotify (0.9.0)
97
110
  ffi (>= 0.5.0)
98
111
  rcov (1.0.0)
99
- rdoc (3.12.1)
112
+ rdoc (4.0.1)
100
113
  json (~> 1.4)
101
114
  simplecov-console (0.1.1)
102
115
  colorize
@@ -105,17 +118,17 @@ GEM
105
118
  simplecov-html (0.7.1)
106
119
  single_test (0.5.2)
107
120
  rake (> 0.9)
108
- slop (3.4.3)
109
- spoon (0.0.1)
110
- terminal-table (1.4.5)
121
+ slop (3.4.4)
122
+ spoon (0.0.3)
123
+ ffi
111
124
  test-unit (2.5.4)
112
- thor (0.17.0)
125
+ thor (0.18.1)
113
126
  turn (0.9.6)
114
127
  ansi
115
- webmock (1.9.0)
128
+ webmock (1.11.0)
116
129
  addressable (>= 2.2.7)
117
- crack (>= 0.1.7)
118
- yard (0.8.4.1)
130
+ crack (>= 0.3.2)
131
+ yard (0.8.5.2)
119
132
 
120
133
  PLATFORMS
121
134
  java
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.8
1
+ 0.3.9
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bixby-common"
8
- s.version = "0.3.8"
8
+ s.version = "0.3.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Chetan Sarva"]
12
- s.date = "2013-03-23"
12
+ s.date = "2013-04-06"
13
13
  s.description = "Bixby Common files/libs"
14
14
  s.email = "chetan@pixelcop.net"
15
15
  s.files = [
@@ -39,7 +39,7 @@ class CommandSpec
39
39
  raise CommandNotFound.new("repo = #{@repo}; bundle = #{@bundle}; command = #{@command}")
40
40
  end
41
41
  if self.digest != expected_digest then
42
- raise BundleNotFound, "digest does not match ('#{self.digest}' != '#{expected_digest}'", caller
42
+ raise BundleNotFound, "digest does not match ('#{self.digest}' != '#{expected_digest}')", caller
43
43
  end
44
44
  return true
45
45
  end
@@ -27,22 +27,35 @@ module Bixby
27
27
 
28
28
  # Setup logging
29
29
  #
30
- # @param [Symbol] level Log level to use (default = :warn)
31
- # @param [String] pattern Log pattern
32
- def self.setup_logger(level=nil, pattern=nil)
30
+ # @param [Hash] opts Options for the rolling file appender
31
+ # @option opts [String] :filename Filename to log to
32
+ # @option opts [Symbol] :level Log level to use (default = :warn)
33
+ # @option opts [String] :pattern Log pattern
34
+ def self.setup_logger(opts={})
35
+
33
36
  # set level: ENV flag overrides; default to warn
34
- level = :debug if ENV["BIXBY_DEBUG"]
35
- level ||= :warn
36
-
37
- pattern ||= '%.1l, [%d] %5l -- %c: %m\n'
38
-
39
- # TODO always use stdout for now
40
- Logging.appenders.stdout(
41
- :level => level,
42
- :layout => Logging.layouts.pattern(:pattern => pattern)
43
- )
44
- Logging::Logger.root.add_appenders(Logging.appenders.stdout)
45
- Logging::Logger.root.level = level
37
+ opts[:level] = :debug if ENV["BIXBY_DEBUG"]
38
+ opts[:level] ||= :warn
39
+
40
+ pattern = opts.delete(:pattern) || '%.1l, [%d] %5l -- %c: %m\n'
41
+ layout = Logging.layouts.pattern(:pattern => pattern)
42
+
43
+ opts[:filename] ||= Bixby.path("var", "bixby-agent.log")
44
+ FileUtils.mkdir_p(File.dirname(opts[:filename]))
45
+
46
+ options = {
47
+ :keep => 7,
48
+ :roll_by => 'date',
49
+ :age => 'daily',
50
+ :truncate => false,
51
+ :auto_flushing => true,
52
+ :layout => layout
53
+ }.merge(opts)
54
+
55
+ Logging.appenders.rolling_file("file", options)
56
+
57
+ Logging::Logger.root.add_appenders("file")
58
+ Logging::Logger.root.level = opts[:level]
46
59
  end
47
60
 
48
61
  end # Log
@@ -16,7 +16,7 @@ class TestLog < MiniTest::Unit::TestCase
16
16
  assert_equal 2, Logging::Logger.root.level # warn
17
17
 
18
18
  ENV.delete("BIXBY_DEBUG")
19
- Bixby::Log.setup_logger(:info)
19
+ Bixby::Log.setup_logger(:level => :info)
20
20
  assert_equal 1, Logging::Logger.root.level # info
21
21
  end
22
22
 
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: bixby-common
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.8
5
+ version: 0.3.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - Chetan Sarva
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-23 00:00:00.000000000 Z
12
+ date: 2013-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -430,7 +430,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
430
430
  requirements:
431
431
  - - ! '>='
432
432
  - !ruby/object:Gem::Version
433
- hash: -31160847080355140
433
+ hash: -739099892354726925
434
434
  segments:
435
435
  - 0
436
436
  version: '0'