Sha256: 332f265cc50f33dd5464afd1d6f0de1273034156ad12033b00c451500fa335ed

Contents?: true

Size: 733 Bytes

Versions: 3

Compression:

Stored size: 733 Bytes

Contents

module Terraform
  module Binary
    # Generic helper methods
    module Helpers
      module_function

      # Runs given commands using mixlib-shellout
      def system_command(*command_args)
        cmd = Mixlib::ShellOut.new(*command_args)
        cmd.run_command
        cmd
      end

      # prints to `stderr`
      def err(message)
        stderr.print("#{message}\n")
      end

      # prints to `stdout`
      def msg(message)
        stdout.print("#{message}\n")
      end

      # prints to `stfout` if `ENV['DEBUG']` is set
      def debug(message)
        stdout.print("#{message}\n") if ENV['DEBUG']
      end

      def stdout
        $stdout
      end

      def stderr
        $stderr
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
terraform-binary-1.0.1 lib/terraform/binary/helpers.rb
terraform-binary-0.1.1 lib/terraform/binary/helpers.rb
terraform-binary-0.1.0 lib/terraform/binary/helpers.rb