Sha256: 6f8036639717e27b707e88ed0bbb13e8aef55ced390e4495d1e32147a18e5edf

Contents?: true

Size: 627 Bytes

Versions: 10

Compression:

Stored size: 627 Bytes

Contents

require 'pathname'

module AwsEc2
  module Core
    @@config = nil
    def config
      @@config ||= Config.new.settings
    end

    def env
      ENV['AWS_EC2_ENV'] || 'development'
    end

    def root
      path = ENV['AWS_EC2_ROOT'] || '.'
      Pathname.new(path)
    end

    def validate_in_project!
      unless File.exist?("#{root}/profiles")
        puts "Could not find a profiles folder in the current directory.  It does not look like you are running this command within a aws-ec2 project.  Please confirm that you are in a aws-ec2 project and try again.".colorize(:red)
        exit
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
aws-ec2-0.9.0 lib/aws_ec2/core.rb
aws-ec2-0.8.4 lib/aws_ec2/core.rb
aws-ec2-0.8.3 lib/aws_ec2/core.rb
aws-ec2-0.8.2 lib/aws_ec2/core.rb
aws-ec2-0.8.1 lib/aws_ec2/core.rb
aws-ec2-0.8.0 lib/aws_ec2/core.rb
aws-ec2-0.7.0 lib/aws_ec2/core.rb
aws-ec2-0.6.0 lib/aws_ec2/core.rb
aws-ec2-0.5.2 lib/aws_ec2/core.rb
aws-ec2-0.5.1 lib/aws_ec2/core.rb