lib/wolverine.rb in wolverine-0.2.7 vs lib/wolverine.rb in wolverine-0.3.0
- old
+ new
@@ -21,26 +21,17 @@
# @return [Redis] the redis connection used by Wolverine
def self.redis
config.redis
end
- def self.statsd_enabled?
- @statsd_enabled
- end
-
- def self.enable_statsd!
- @statsd_enabled = true
- end
-
# Resets all the scripts cached by Wolverine. Scripts are lazy-loaded and
# cached in-memory, so if a file changes on disk, it will be necessary to
# manually reset the cache using +reset!+.
#
# @return [void]
def self.reset!
@root_directory = nil
- reset_cached_methods
end
# Used to handle dynamic accesses to scripts. Successful lookups will be
# cached on the {PathComponent} object. See {PathComponent#method_missing}
# for more detail on how this works.
@@ -65,11 +56,10 @@
config.redis
end
def reset!
@root_directory = nil
- reset_cached_methods
end
def method_missing sym, *args
root_directory.send(sym, *args)
rescue PathComponent::MissingTemplate
@@ -77,33 +67,13 @@
end
private
def self.root_directory
- @root_directory ||= PathComponent.new(config.script_path, {:cache_to => self})
+ @root_directory ||= PathComponent.new(config.script_path)
end
- def self.cached_methods
- @cached_methods ||= Hash.new
- end
-
- def self.reset_cached_methods
- metaclass = class << self; self; end
- cached_methods.each_key { |method| metaclass.send(:undef_method, method) }
- cached_methods.clear
- end
-
def root_directory
- @root_directory ||= PathComponent.new(config.script_path, {:cache_to => self, :config => config, :redis => redis})
- end
-
- def cached_methods
- @cached_methods ||= Hash.new
- end
-
- def reset_cached_methods
- metaclass = class << self; self; end
- cached_methods.each_key { |method| metaclass.send(:undef_method, method) }
- cached_methods.clear
+ @root_directory ||= PathComponent.new(config.script_path, {:config => config, :redis => redis})
end
end