Sha256: 1950ea57bd23fbb8aa249d39ba96d95301a24c4489a9b97a55a54a84c79c3fe4

Contents?: true

Size: 779 Bytes

Versions: 37

Compression:

Stored size: 779 Bytes

Contents

# frozen_string_literal: true

module RailsAppGenerator
  # XXXX
  class Dependencies
    def initialize(addon, context)
      @addon = addon
      @context = context
      @options = context.options
    end

    def satisfied?
      @addon.dependencies.each do |dependency|
        return false unless dependencies_satisfied?(dependency)
      end

      true
    end

    private

    def dependencies_satisfied?(addon, visited = [])
      return false if @options["skip_#{addon}".to_sym]

      return true if @context.default_addons.include?(addon)

      visited << addon
      dependencies = AddOn.get(addon).dependencies - visited
      dependencies.each do |dependency|
        return false unless dependencies_satisfied?(dependency, visited)
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
rails_app_generator-0.1.26 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.25 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.24 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.23 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.22 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.21 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.20 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.19 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.18 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.17 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.16 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.15 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.14 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.13 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.12 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.11 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.10 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.9 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.8 lib/rails_app_generator/dependencies.rb
rails_app_generator-0.1.7 lib/rails_app_generator/dependencies.rb