cody 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6b78eae6c5cdfbaf38cfad9111c3900698d66c9fb43d6ff4f56439d4b22fd5b
4
- data.tar.gz: 249d4c906eb35b9175a8cd77b3f5c68847802f391d2d57e75f3a07b30c6bab51
3
+ metadata.gz: 3ced92e5c3ceacd71102a3f6501a0436ff14f4af9fbcaaa13bd29980a107e47e
4
+ data.tar.gz: e2a1d2624728f7d57f5fd825e2c6c7b91489119b072a5c4e7b3e439044c058e8
5
5
  SHA512:
6
- metadata.gz: e7ebe2dc3e7c2924cc0b19f7585acfc2c3ae0f622b9fa58cfd8aaba2177ceb45fe090d90602e1a57f81947a30662028605c6845e875f12479108a6e18aa584d4
7
- data.tar.gz: 312bb50599a5881262b9dd848f9ea731bd31f859aa18794440397c91ab8861fa629082babd32de13dfef6d44ba0a542b7b8c262f36b55aedf94122fb276c1521
6
+ metadata.gz: 7b586e1cca3f2d5a84982ce3db857037d6cbafdfad5389be350e4aeab31e07ca8aab13dbc78977dd75bcf604da18fffa9a410dde6922f65df42c20c77b1567af
7
+ data.tar.gz: cea281d6d71645ba05ca0de2c410b75205d2434362b813b0ca2dc82b97c28f70817e0f4088751b72d2a01f9427153e4f5f687f721d0d148fd7d5ec2464f99fc3
@@ -3,6 +3,10 @@
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.9.6]
7
+ - #24 refactor: add dsl base class so `project_name` method is available to all dsl classes
8
+ - cody list: fix for projects with no builds yet
9
+
6
10
  ## [0.9.5]
7
11
  - write info messsage to stderr so we can pipe to jq
8
12
 
@@ -0,0 +1,11 @@
1
+ module Cody::Dsl
2
+ class Base
3
+ attr_reader :project_name, :full_project_name
4
+ def initialize(options={})
5
+ @options = options
6
+ @project_name = options[:project_name]
7
+ @full_project_name = options[:full_project_name] # includes -development at the end
8
+ @properties = default_properties # defaults make project.rb simpler
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # Represents a project with no builds yet. In this case we just return an info message for the columns.
2
+ # This allows `cody list` to work without breaking for Fresh projects with zero builds.
3
+ class Cody::List
4
+ class NoBuildsProject
5
+ def method_missing(meth, *args, &block)
6
+ "no builds"
7
+ end
8
+ end
9
+ end
@@ -12,8 +12,9 @@ class Cody::List
12
12
  end
13
13
 
14
14
  def build
15
+ return NoBuildsProject.new unless build_id # most recent build
15
16
  resp = codebuild.batch_get_builds(ids: [build_id])
16
- resp.builds.first # most recent build
17
+ resp.builds.first
17
18
  end
18
19
  memoize :build
19
20
  alias_method :load, :build # interface to eager load
@@ -1,18 +1,15 @@
1
1
  require "yaml"
2
2
 
3
3
  module Cody
4
- class Project
4
+ class Project < Dsl::Base
5
5
  include Dsl::Project
6
6
  include Evaluate
7
7
  include Variables
8
8
 
9
- attr_reader :project_name, :full_project_name, :project_path
9
+ attr_reader :project_path
10
10
  def initialize(options={})
11
- @options = options
12
- @project_name = options[:project_name]
13
- @full_project_name = options[:full_project_name] # includes -development at the end
11
+ super
14
12
  @project_path = options[:project_path] || get_project_path
15
- @properties = default_properties # defaults make project.rb simpler
16
13
  end
17
14
 
18
15
  def exist?
@@ -1,15 +1,14 @@
1
1
  require "yaml"
2
2
 
3
3
  module Cody
4
- class Role
4
+ class Role < Dsl::Base
5
5
  include Cody::Dsl::Role
6
6
  include Evaluate
7
7
  include Variables
8
8
 
9
9
  def initialize(options={})
10
- @options = options
10
+ super
11
11
  @role_path = options[:role_path] || get_role_path
12
- @properties = default_properties
13
12
  @iam_policy = {}
14
13
  end
15
14
 
@@ -1,13 +1,12 @@
1
1
  module Cody
2
- class Schedule
2
+ class Schedule < Dsl::Base
3
3
  include Cody::Dsl::Schedule
4
4
  include Evaluate
5
5
  include Variables
6
6
 
7
7
  def initialize(options={})
8
- @options = options
8
+ super
9
9
  @schedule_path = options[:schedule_path] || get_schedule_path
10
- @properties = default_properties
11
10
  @iam_policy = {}
12
11
  end
13
12
 
@@ -1,3 +1,3 @@
1
1
  module Cody
2
- VERSION = "0.9.5"
2
+ VERSION = "0.9.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cody
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
@@ -288,6 +288,7 @@ files:
288
288
  - lib/cody/default/settings.yml
289
289
  - lib/cody/delete.rb
290
290
  - lib/cody/deploy.rb
291
+ - lib/cody/dsl/base.rb
291
292
  - lib/cody/dsl/project.rb
292
293
  - lib/cody/dsl/project/ssm.rb
293
294
  - lib/cody/dsl/role.rb
@@ -304,6 +305,7 @@ files:
304
305
  - lib/cody/help/stop.md
305
306
  - lib/cody/init.rb
306
307
  - lib/cody/list.rb
308
+ - lib/cody/list/no_builds_project.rb
307
309
  - lib/cody/list/project.rb
308
310
  - lib/cody/logs.rb
309
311
  - lib/cody/project.rb