Module: AwsEc2::Core
- Included in:
- AwsEc2
- Defined in:
- lib/aws_ec2/core.rb
Constant Summary collapse
- @@config =
nil
- @@env =
nil
Instance Method Summary collapse
Instance Method Details
#config ⇒ Object
7 8 9 |
# File 'lib/aws_ec2/core.rb', line 7 def config @@config ||= Config.new.data end |
#env ⇒ Object
28 29 30 31 32 33 |
# File 'lib/aws_ec2/core.rb', line 28 def env return @@env if @@env env = env_from_profile(ENV['AWS_PROFILE']) || 'development' env = ENV['AWS_EC2_ENV'] if ENV['AWS_EC2_ENV'] # highest precedence @@env = env end |
#root ⇒ Object
15 16 17 18 |
# File 'lib/aws_ec2/core.rb', line 15 def root path = ENV['AWS_EC2_ROOT'] || '.' Pathname.new(path) end |
#validate_in_project! ⇒ Object
20 21 22 23 24 25 |
# File 'lib/aws_ec2/core.rb', line 20 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 |