Sha256: 60190477eb87f25bc00af5416189adbc325304cb81fa7f1d8519537d2122ce2a

Contents?: true

Size: 777 Bytes

Versions: 1

Compression:

Stored size: 777 Bytes

Contents

Sunzi::Dependency.load('highline')

module Sunzi
  module Cloud
    class Base < Thor
      include Thor::Actions

      class << self
        def source_root
          File.expand_path('../../../',__FILE__)
        end

        def choose(target)
          case target
          when 'linode'
            Cloud::Linode.new
          when 'ec2'
            Cloud::EC2.new
          else
            say shell.set_color("#{target} is not valid!", :red, true)
            abort
          end
        end
      end

      def initialize(*args)
        @ui = HighLine.new
        super
      end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sunzi-0.4.0 lib/sunzi/cloud/base.rb