Top Level Namespace

Defined Under Namespace

Modules: IRuby

Instance Method Summary collapse

Instance Method Details

#dependencies(**params, &block) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/iruby/dependencies.rb', line 57

def dependencies **params, &block
  config={}

  begin 
    if config_path = Bundler.settings['dependencies.config']
      uri = URI config_path
  
      json = case uri.scheme
        when /http/
          Net::HTTP.get(uri)
        else 
          File.read(uri.path)
        end
  
      config = JSON.parse(json)
    end
  
  rescue => ex
    warn "iruby-dependencies could not load #{config_path}: #{ex.message}"
  end

  IRuby::Dependencies.new config, **params, &block
end