Sha256: 3a375899a10005ed5209056664f2a7ab816317e52e11512e6e68a334e419b2e4

Contents?: true

Size: 788 Bytes

Versions: 2

Compression:

Stored size: 788 Bytes

Contents

module Sunzi
  class Dependency
    def self.all
      {
        'linode' =>   { :require => 'linode',   :version => '>= 0.7.9' },
        'highline' => { :require => 'highline', :version => '>= 1.6.11'},
        'route53' =>  { :require => 'route53',  :version => '>= 0.2.1' },
        'digital_ocean' =>  { :require => 'digital_ocean',  :version => '>= 1.0.0' },
      }
    end

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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sunzi-1.1.1 lib/sunzi/dependency.rb
sunzi-1.1.0 lib/sunzi/dependency.rb