lib/ridley.rb in ridley-0.5.2 vs lib/ridley.rb in ridley-0.6.0
- old
+ new
@@ -6,10 +6,11 @@
require 'multi_json'
require 'active_model'
require 'active_support/inflector'
require 'forwardable'
require 'thread'
+require 'pathname'
if jruby?
require 'json/pure'
else
require 'json/ext'
@@ -39,38 +40,29 @@
autoload :Role, 'ridley/resources/role'
autoload :Search, 'ridley/resources/search'
autoload :SSH, 'ridley/ssh'
class << self
- attr_accessor :logger
+ extend Forwardable
+ def_delegator "Ridley::Logging", :logger
+ alias_method :log, :logger
+
+ def_delegator "Ridley::Logging", :logger=
+ def_delegator "Ridley::Logging", :set_logger
+
def connection(*args)
Connection.new(*args)
end
def sync(*args, &block)
Connection.sync(*args, &block)
end
- # @return [Logger]
- def logger
- Ridley::Logging.logger
- end
- alias_method :log, :logger
-
- # @param [Logger, nil] obj
- #
- # @return [Logger]
- def set_logger(obj)
- Ridley::Logging.set_logger(obj)
- end
-
# @return [Pathname]
def root
@root ||= Pathname.new(File.expand_path('../', File.dirname(__FILE__)))
end
end
end
-
-Celluloid.logger = Ridley.logger
require 'ridley/middleware'