aws-ec2 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ae0142627fc2b449f8caec43ae66c0544fd8144d2457d814b369351c9b0825c
4
- data.tar.gz: 5e1c6190b37d41e91e80d6c4f92064e4075bb33a173654d5b858c72c4f8cca98
3
+ metadata.gz: 5a7783fbdf32f51f3a71ac3d71b14a6806bef0f865aca87f6a68a3f952148398
4
+ data.tar.gz: 2cac98bb451c4576b52ac1503af2101ddd5aa6659af016b012484ae03bfd9b3a
5
5
  SHA512:
6
- metadata.gz: c9e1b3007c14f25caf40bda48d94d705f28d5ae9c915f0dbf57756e24ef8fbd88feedece9f06e98f68d44839777668833e602be1e20c11f48f4518e46c22dac0
7
- data.tar.gz: 52e55c58bd52eca7ae11b7a4e4c0608215d552887718cc961bad2d1a9466d74f8913ac7e22b1dcf2f6b4d1a2fec5f042a8a3927fb556dc4b01dcb4c20dfcfa5f
6
+ metadata.gz: a07313a039186ba63a3b0f833586d8824799f37abfc71674781a1405d50819d85b1b278d511e71836ef932b7e9d92c383874dd6787e78e778138040beaf02411
7
+ data.tar.gz: b038d96c8ba36fe40550163af47cee2cc4dc89469680c941cb04830d62ba45ee44d6e7ae1b9d8c92a16818a2df75bd95c6d9cf0124ef3e4d99295d108528fa6d
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.5.1]
7
+ - show a friendly user message if not an aws-ec2 project
8
+
6
9
  ## [0.5.0]
7
10
  - compile_scripts compiles both app/user-data and app/scripts
8
11
 
data/lib/aws-ec2.rb CHANGED
@@ -7,6 +7,7 @@ module AwsEc2
7
7
  autoload :Command, "aws_ec2/command"
8
8
  autoload :CLI, "aws_ec2/cli"
9
9
  autoload :AwsServices, "aws_ec2/aws_services"
10
+ autoload :Base, "aws_ec2/base"
10
11
  autoload :Create, "aws_ec2/create"
11
12
  autoload :Ami, "aws_ec2/ami"
12
13
  autoload :TemplateHelper, "aws_ec2/template_helper"
data/lib/aws_ec2/ami.rb CHANGED
@@ -1,9 +1,5 @@
1
1
  module AwsEc2
2
- class Ami
3
- def initialize(options)
4
- @options = options.clone
5
- end
6
-
2
+ class Ami < Base
7
3
  def run
8
4
  # Delegates to the Create command.
9
5
  # So we just have to set up the option for it.
@@ -0,0 +1,8 @@
1
+ module AwsEc2
2
+ class Base
3
+ def initialize(options={})
4
+ @options = options.clone
5
+ AwsEc2.validate_in_project!
6
+ end
7
+ end
8
+ end
@@ -1,14 +1,10 @@
1
1
  require 'fileutils'
2
2
 
3
3
  module AwsEc2
4
- class CompileScripts
4
+ class CompileScripts < Base
5
5
  include TemplateHelper
6
6
  BUILD_ROOT = "tmp"
7
7
 
8
- def initialize(options)
9
- @options = options
10
- end
11
-
12
8
  def compile
13
9
  clean
14
10
  compile_folder("scripts")
@@ -1,9 +1,10 @@
1
1
  require 'yaml'
2
2
 
3
3
  module AwsEc2
4
- class Config
5
- def initialize(path="#{AwsEc2.root}/config/#{AwsEc2.env}.yml")
6
- @path = path
4
+ class Config < Base
5
+ def initialize(options={})
6
+ super
7
+ @path = options[:path] || "#{AwsEc2.root}/config/#{AwsEc2.env}.yml"
7
8
  end
8
9
 
9
10
  def settings
data/lib/aws_ec2/core.rb CHANGED
@@ -15,5 +15,12 @@ module AwsEc2
15
15
  path = ENV['AWS_EC2_ROOT'] || '.'
16
16
  Pathname.new(path)
17
17
  end
18
+
19
+ def validate_in_project!
20
+ unless File.exist?("#{root}/profiles")
21
+ 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)
22
+ exit
23
+ end
24
+ end
18
25
  end
19
26
  end
@@ -2,14 +2,10 @@ require 'yaml'
2
2
  require 'active_support/core_ext/hash'
3
3
 
4
4
  module AwsEc2
5
- class Create
5
+ class Create < Base
6
6
  autoload :Params, "aws_ec2/create/params"
7
7
  include AwsServices
8
8
 
9
- def initialize(options)
10
- @options = options
11
- end
12
-
13
9
  def run
14
10
  puts "Creating EC2 instance #{@options[:name]}..."
15
11
  display_info
@@ -1,3 +1,3 @@
1
1
  module AwsEc2
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
@@ -204,6 +204,7 @@ files:
204
204
  - lib/aws-ec2.rb
205
205
  - lib/aws_ec2/ami.rb
206
206
  - lib/aws_ec2/aws_services.rb
207
+ - lib/aws_ec2/base.rb
207
208
  - lib/aws_ec2/cli.rb
208
209
  - lib/aws_ec2/command.rb
209
210
  - lib/aws_ec2/compile_scripts.rb