Sha256: f6b02aece76bcc81f13d1631e2b8055798e371214ec5fe3f5b7a6e3db1830a7a

Contents?: true

Size: 699 Bytes

Versions: 2

Compression:

Stored size: 699 Bytes

Contents

module Dumper
  class Dependency
    LIBS = {
      'thor'       => { :version => '~> 0.19' },
      'rainbow'    => { :version => '~> 2.1', :require => 'rainbow/ext/string' },
      'net-ntp'    => { :version => '~> 2.1', :require => 'net/ntp' },
      'ipaddress'  => { :version => '~> 0.8.3' },
    }

    def self.load(name)
      begin
        gem name, LIBS[name][:version]
        require LIBS[name][:require] || name
      rescue LoadError
        abort <<-EOS
Dependency missing: #{name}
To install the gem, issue the following command:

    gem install #{name} -v '#{LIBS[name][:version]}'

Please try again after installing the missing dependency.
        EOS
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dumper-1.7.3 lib/dumper/dependency.rb
dumper-1.7.2 lib/dumper/dependency.rb