Sha256: 5d423abbaa1e197a7e69619df626b8aa5b6a412b992ea4689037b4919f87a550

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 => '>= 0.0.1' },
      }
    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.0.0 lib/sunzi/dependency.rb
sunzi-0.9.0 lib/sunzi/dependency.rb