Permalink
Browse files

Provide a compatible interface with define/defined instead of learn/l…

…earned.
  • Loading branch information...
1 parent c98a6f1 commit d2db76a1e6aa56302d759b3fccf365595b9f1661 @cmeiklejohn committed Sep 3, 2011
Showing with 23 additions and 11 deletions.
  1. +22 −10 lib/watchmaker/configuration.rb
  2. +1 −1 lib/watchmaker/version.rb
@@ -20,29 +20,41 @@ def initialize
@profiles = {}
end
- def self.learn(name, dependencies, &block)
- instance.learn(name, dependencies, &block)
- end
+ class << self
+ def define(name, dependencies, &block)
+ instance.define(name, dependencies, &block)
+ end
- def self.learned(name)
- instance.learned(name)
- end
+ alias :learn :define
+
+ def defined(name)
+ instance.defined(name)
+ end
+
+ alias :learned :defined
- def self.learned?(name)
- !!learned(name)
+ def defined?(name)
+ !!defined(name)
+ end
+
+ alias :learned? :defined?
end
- def learn(name, dependencies, &block) # :nodoc:
+ def define(name, dependencies, &block) # :nodoc:
@profiles[name] = {
:dependencies => dependencies,
:block => block
}
end
- def learned(name) # :nodoc:
+ alias :learn :define
+
+ def defined(name) # :nodoc:
@profiles[name]
end
+ alias :learned :defined
+
end
end
@@ -1,5 +1,5 @@
# encoding: UTF-8
module Watchmaker # :nodoc:
- VERSION = "0.1.2"
+ VERSION = "0.2.0"
end

0 comments on commit d2db76a

Please sign in to comment.