Commit a3cc38de authored by Fabio Pelosin's avatar Fabio Pelosin

Fix for Ruby 1.8.7

parent c6be52a7
......@@ -20,7 +20,6 @@ module Pod
require 'cocoapods/downloader'
require 'cocoapods/file_list'
require 'cocoapods/config'
require 'cocoapods/dependency_injection'
autoload :Command, 'cocoapods/command'
autoload :Executable, 'cocoapods/executable'
......
module Pod
# Provides basic support for Dependency Injection in a class.
#
module DependencyInjection
# Declares a dependency in another class specifying a default. The class
# implementing this method should should initialize the dependency
# accessing this property.
#
# @param [Symbol] name
# the name of the dependency.
#
# @param [Class] default_class
# the default class to use for the dependency.
#
# @return [void]
#
def dependency(name, default_class)
singleton_class.class_eval do
attr_writer name
define_method(name) { instance_variable_get("@#{name}") || default_class }
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment