lib/lazy_resource.rb in lazy_resource-0.4.0 vs lib/lazy_resource.rb in lazy_resource-0.5.0

- old
+ new

@@ -5,10 +5,11 @@ require 'active_support' require 'active_support/core_ext/class/attribute_accessors' require 'active_support/core_ext/class/attribute' require 'active_support/core_ext/hash/indifferent_access' +require 'active_support/core_ext/hash/reverse_merge' require 'active_support/core_ext/kernel/reporting' require 'active_support/core_ext/module/delegation' require 'active_support/core_ext/module/aliasing' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/object/to_query' @@ -19,10 +20,12 @@ require 'active_support/core_ext/uri' require 'lazy_resource/version' require 'lazy_resource/errors' +require 'lazy_resource/log_subscriber' + require 'lazy_resource/ext/typhoeus' module LazyResource extend ActiveSupport::Autoload @@ -52,7 +55,21 @@ @debug = debug end def self.debug @debug = @debug.nil? ? false : @debug + end + + def self.max_concurrency + @max_concurrency ||= 200 + end + + def self.max_concurrency=(max) + @max_concurrency = max + end + + def self.deprecate(message, file, line) + if self.logger && self.debug + self.logger.info "#{message} from #{file}##{line}" + end end end