jets 0.8.10 → 0.8.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +7 -0
- data/lib/jets/cfn/builders/api_deployment_builder.rb +0 -1
- data/lib/jets/cfn/builders/api_gateway_builder.rb +0 -1
- data/lib/jets/cfn/builders/parent_builder.rb +3 -1
- data/lib/jets/commands/build.rb +0 -1
- data/lib/jets/core_ext/kernel.rb +30 -11
- data/lib/jets/job/dsl.rb +1 -0
- data/lib/jets/resource/base.rb +0 -1
- data/lib/jets/resource/function.rb +18 -1
- data/lib/jets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3264a5fe8f2efe3fd744fa432d0ae6e73ada5bde0d9b816be1e39f0ba57e710d
|
4
|
+
data.tar.gz: a375816841050159a774bb104f97327fae41ab0935466fff959c3f54127aa26e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74694ae655562a8d40610a4f3ceba61d845f1695100966fd6bb424ad8c9a083f818f2921cdd40274c8b2844afa4ca61fcfaecb7d245b7528752fb72d37f2a039
|
7
|
+
data.tar.gz: 7fc5634ed17b2abd762cdf3014686caafec5e7bfc6add32ccc5c3172b6d75dae7406010a5275658a45dfb1dae0d705a3e17e4aa0621d54c4afe0ee7f022f041e
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.8.11]
|
7
|
+
- Inherit class properties from parent classes PR #25
|
8
|
+
- Make more puts like methods show up in cloudwatch logs
|
9
|
+
- Fix add_logical_id_counter to events
|
10
|
+
|
6
11
|
## [0.8.10]
|
7
12
|
- allow perform_now to run with default empty event
|
8
13
|
- fix env_properties in function resource, fixes stage name
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -131,3 +131,10 @@ For more documentation, check out the official docs: [Ruby on Jets](http://rubyo
|
|
131
131
|
* [CLI Reference](http://rubyonjets.com/reference/)
|
132
132
|
* [Contributing](http://rubyonjets.com/docs/contributing/)
|
133
133
|
* [Support Jets](http://rubyonjets.com/support-jets/)
|
134
|
+
|
135
|
+
## Articles
|
136
|
+
|
137
|
+
* [Introducing Jets: A Ruby Serverless Framework](https://blog.boltops.com/2018/08/18/introducing-jets-a-ruby-serverless-framework)
|
138
|
+
* [AWS Lambda Ruby Support at Native Speed with Jets](https://blog.boltops.com/2018/09/02/aws-lambda-ruby-support-at-native-speed-with-jets)
|
139
|
+
* [Jets Tutorial An Introductory CRUD App Part 1](https://blog.boltops.com/2018/09/07/jets-tutorial-crud-app-introduction-part-1)
|
140
|
+
* [Jets Tutorial Deploy to AWS Lambda Part 2](https://blog.boltops.com/2018/09/08/jets-tutorial-deploy-to-aws-lambda-part-2)
|
@@ -12,7 +12,6 @@ class Jets::Cfn::Builders
|
|
12
12
|
def compose
|
13
13
|
return if @options[:stack_type] == :minimal
|
14
14
|
|
15
|
-
puts "Building API Gateway Deployment template."
|
16
15
|
deployment = Jets::Resource::ApiGateway::Deployment.new
|
17
16
|
add_resource(deployment)
|
18
17
|
add_parameters(deployment.parameters)
|
@@ -12,7 +12,7 @@ class Jets::Cfn::Builders
|
|
12
12
|
|
13
13
|
# compose is an interface method
|
14
14
|
def compose
|
15
|
-
puts "Building parent template."
|
15
|
+
puts "Building parent CloudFormation template."
|
16
16
|
|
17
17
|
build_minimal_resources
|
18
18
|
build_child_resources unless @options[:stack_type] == :minimal
|
@@ -36,6 +36,8 @@ class Jets::Cfn::Builders
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def build_child_resources
|
39
|
+
puts "Building child CloudFormation templates."
|
40
|
+
|
39
41
|
expression = "#{Jets::Naming.template_path_prefix}-*"
|
40
42
|
# IE: path: #{Jets.build_root}/templates/demo-dev-2-comments_controller.yml
|
41
43
|
Dir.glob(expression).each do |path|
|
data/lib/jets/commands/build.rb
CHANGED
@@ -42,7 +42,6 @@ module Jets::Commands
|
|
42
42
|
def build_all_templates
|
43
43
|
clean_templates
|
44
44
|
# CloudFormation templates
|
45
|
-
puts "Building Lambda functions as CloudFormation templates."
|
46
45
|
# 1. Shared templates - child templates needs them
|
47
46
|
build_api_gateway_templates
|
48
47
|
# 2. Child templates - parent template needs them
|
data/lib/jets/core_ext/kernel.rb
CHANGED
@@ -2,16 +2,36 @@
|
|
2
2
|
module Kernel
|
3
3
|
@@io_buffer = []
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
# List from https://ruby-doc.org/core-2.5.1/Kernel.html
|
6
|
+
# Note, will lose pp format in the @io_buffer but looks like a lot of work to keep the pp format.
|
7
|
+
# Must override stdout which can be messy quick: https://www.ruby-forum.com/topic/43725
|
8
|
+
OVERRIDE_METHODS = %w[
|
9
|
+
p
|
10
|
+
pp
|
11
|
+
print
|
12
|
+
printf
|
13
|
+
putc
|
14
|
+
puts
|
15
|
+
sprintf
|
16
|
+
]
|
17
|
+
OVERRIDE_METHODS.each do |meth|
|
18
|
+
# Example of generated code:
|
19
|
+
#
|
20
|
+
# alias_method :original_puts, :puts
|
21
|
+
# def puts(*args, &block)
|
22
|
+
# @@io_buffer << args.first # message
|
23
|
+
# original_puts(*args, &block)
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
class_eval <<~CODE
|
27
|
+
alias_method :original_#{meth}, :#{meth}
|
28
|
+
def #{meth}(*args, &block)
|
29
|
+
@@io_buffer << args.first # message
|
30
|
+
original_#{meth}(*args, &block)
|
31
|
+
end
|
32
|
+
CODE
|
9
33
|
end
|
10
34
|
|
11
|
-
# TODO: implement other methods that write output:
|
12
|
-
# p, print, printf, putc, puts, sprintf?
|
13
|
-
# Also, would be nice to figure out pp method also.
|
14
|
-
|
15
35
|
def io_buffer
|
16
36
|
@@io_buffer
|
17
37
|
end
|
@@ -24,9 +44,8 @@ module Kernel
|
|
24
44
|
begin
|
25
45
|
IO.write("/tmp/jets-output.log", chunk)
|
26
46
|
# Writing to log with binary content will crash the process so rescuing it and writing an info message.
|
27
|
-
rescue Encoding::UndefinedConversionError
|
28
|
-
|
29
|
-
IO.write("/tmp/jets-output.log", error_message)
|
47
|
+
rescue Encoding::UndefinedConversionError
|
48
|
+
IO.write("/tmp/jets-output.log", "[BINARY DATA]")
|
30
49
|
end
|
31
50
|
@@io_buffer = []
|
32
51
|
end
|
data/lib/jets/job/dsl.rb
CHANGED
data/lib/jets/resource/base.rb
CHANGED
@@ -81,11 +81,28 @@ class Jets::Resource
|
|
81
81
|
def class_properties
|
82
82
|
# klass is PostsController, HardJob, GameRule, Hello or HelloFunction
|
83
83
|
klass = Jets::Klass.from_task(@task)
|
84
|
-
|
84
|
+
|
85
|
+
class_properties = lookup_class_properties(klass)
|
85
86
|
if klass.build_class_iam?
|
86
87
|
iam_policy = Jets::Resource::Iam::ClassRole.new(klass)
|
87
88
|
class_properties[:role] = "!GetAtt #{iam_policy.logical_id}.Arn"
|
88
89
|
end
|
90
|
+
|
91
|
+
class_properties
|
92
|
+
end
|
93
|
+
|
94
|
+
# Accounts for inherited class_properties
|
95
|
+
def lookup_class_properties(klass)
|
96
|
+
all_classes = []
|
97
|
+
while klass != Object
|
98
|
+
all_classes << klass
|
99
|
+
klass = klass.superclass
|
100
|
+
end
|
101
|
+
class_properties = {}
|
102
|
+
# Go back down class heirachry top to down
|
103
|
+
all_classes.reverse.each do |k|
|
104
|
+
class_properties.merge!(k.class_properties)
|
105
|
+
end
|
89
106
|
class_properties
|
90
107
|
end
|
91
108
|
|
data/lib/jets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|