Sha256: 3b28cdb47bd75602bbe027897582d8a49263540b0857fbdcbd2993e011e29fce

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

Sunzi::Dependency.load('highline')

module Sunzi
  module Cloud
    class Base
      include Sunzi::Utility

      def self.choose(cli, target)
        case target
        when 'linode'
          Cloud::Linode.new(cli)
        when 'digital_ocean'
          Cloud::DigitalOcean.new(cli)
        else
          abort_with "#{target} is not valid!"
        end
      end

      def initialize(cli)
        @cli = cli
        @ui = HighLine.new
      end

      def ask(question, answer_type, &details)
        @ui.ask(@ui.color(question, :green, :bold), answer_type, &details)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sunzi-1.1.0 lib/sunzi/cloud/base.rb
sunzi-1.0.0 lib/sunzi/cloud/base.rb