razing_ruby 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,18 +20,11 @@ class Logger
20
20
  end
21
21
 
22
22
  class LogDevice
23
- attr_reader :loggers
24
-
25
- # Create the logger cache
26
- def raze_initialize(*a, &b)
27
- ruby_initialize(*a, &b)
28
- @loggers ||= {}
29
- end
30
23
 
31
24
  # Write a log
32
25
  def raze_write(*a, &b)
33
26
  results = [ruby_write(*a, &b)]
34
- @loggers.values.map(&:logdev).reduce(results) do |out, logger|
27
+ loggers.values.map(&:logdev).reduce(results) do |out, logger|
35
28
  logger.respond_to?(:write) ? out << logger.write(*a, &b) : out
36
29
  end
37
30
  end
@@ -40,23 +33,25 @@ class Logger
40
33
  def add_logger(name, logger = nil)
41
34
  name, logger = __prep_logger__(name, logger)
42
35
  return false if logger.logdev == self
43
- @loggers[name] = logger
36
+ loggers[name] = logger
44
37
  end
45
38
 
46
39
  # Remove a logger
47
40
  def del_logger(name)
48
- @loggers[name].close
49
- @loggers.delete(name)
41
+ loggers[name].close
42
+ loggers.delete(name)
50
43
  end
51
44
 
52
45
  # Get a logger
53
46
  def get_logger(name)
54
- @loggers[name]
47
+ loggers[name]
48
+ end
49
+
50
+ def loggers
51
+ @loggers ||= {}
55
52
  end
56
53
 
57
54
  # Swap the methods with the raze ones
58
- alias_method :ruby_initialize, :initialize
59
- alias_method :initialize, :raze_initialize
60
55
  alias_method :ruby_write, :write
61
56
  alias_method :write, :raze_write
62
57
 
@@ -1,3 +1,3 @@
1
1
  module RazingRuby
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: razing_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-19 00:00:00.000000000 Z
12
+ date: 2014-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler