Sha256: b05daff94f7d514c900fec00b5d305d3a09dcea78a9e0f160cb2447e3a3b5160

Contents?: true

Size: 844 Bytes

Versions: 4

Compression:

Stored size: 844 Bytes

Contents

require 'orats/commands/common'
require 'orats/commands/new/rails'

module Orats
  module Commands
    class Play < Common
      include New::Rails

      def initialize(target_path = '', options = {})
        super
      end

      def init
        return unless can_play?
        rails_template 'play'
        custom_rails_template unless @options[:template].empty?
      end

      private

      def can_play?
        log_thor_task 'shell', 'Checking for the ansible binary'

        has_ansible = run('which ansible', capture: true)

        log_error 'error', 'Cannot access ansible', 'question', 'Are you sure you have ansible setup correctly?', true do
          log_status_bottom 'tip', 'http://docs.ansible.com/intro_installation.html', :white
        end if has_ansible.empty?

        !has_ansible.empty?
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
orats-0.6.3 lib/orats/commands/play.rb
orats-0.6.2 lib/orats/commands/play.rb
orats-0.6.1 lib/orats/commands/play.rb
orats-0.6.0 lib/orats/commands/play.rb