Class: GemfileHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/huginn_agent/patches/gemfile_helper.rb

Overview

This Gemfile modification was generated by the ‘rake prepare` command

Class Method Summary collapse

Class Method Details

.parse_huginn_agent_gems(dependencies) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/huginn_agent/patches/gemfile_helper.rb', line 5

def self.parse_huginn_agent_gems(dependencies)
  base_path = File.expand_path('../../../', __FILE__)
  gemspec = Dir["#{base_path}/*.gemspec"].first
  previous_gems = Hash[dependencies.map { |dep| [dep.name, dep] }]
  Gem::Specification.load(gemspec).development_dependencies.each do |args|
    previous_gem = previous_gems[args.name]
    if previous_gem
      abort "Gem #{args.to_s} in #{gemspec} conflicts with huginn/Gemfile" unless previous_gem.match?(args.to_spec)
    else
      yield args.name, *args.requirements_list
    end
  end
end