Sha256: 86b7883c62db1f7efbeb2e7329036ff3a7c91ecedc7799152441d27d13dbd42c

Contents?: true

Size: 594 Bytes

Versions: 111

Compression:

Stored size: 594 Bytes

Contents

module PrependDependenciesCheckable
  def check_prepend_dependencies(target, dependencies)
    order = Array(dependencies[:before]) + [target] + Array(dependencies[:after])
    self.class.ancestors.reverse.each { |cls| order.shift if cls == order.first }
    order.empty?
  end

  def check_prepend_dependencies!(target, dependencies)
    unless check_prepend_dependencies(target, dependencies)
      raise "Invalid prepend dependencies. target:#{target} ancestors:#{self.class.ancestors} dependencies:#{dependencies}"
    end
  end
end

class Object
  include PrependDependenciesCheckable
end

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
flydata-0.8.10.2 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.10.1 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.9.11 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.10 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.9 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.8 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.7 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.6 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.5 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.4 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.3 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.2 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.1 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.8.0 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.7.19 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.7.18 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.7.17 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.7.16 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.7.15 flydata-core/lib/flydata-core/core_ext/object/prepend.rb
flydata-0.7.14 flydata-core/lib/flydata-core/core_ext/object/prepend.rb