jets 0.8.9 → 0.8.10

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: ce580a14e5051954606f507aa2a9f4edcca4930045970966762d8ceb9857c814
4
- data.tar.gz: da3d1d6d89c829ee6c28b9808f45c4db6b648925502f20164a725a5ad2acc59f
3
+ metadata.gz: 240ea62121417687a7b24ed6cf556ac1d6f4f2c543238af1b4ac83b6893b28dc
4
+ data.tar.gz: 45856a9db0ae99ad504f07e83620b96e45a461261103ed336b02e35705ccc5fa
5
5
  SHA512:
6
- metadata.gz: 9a77865cdc7eea19c9bbfb7a82d33c1196c9dbfdb29a990c5c5e268cd9cb3c4dc569d59fe88be10f0ad68b59af9800ed7809fede94f691d4a8e10763af46ea90
7
- data.tar.gz: b1fab039f595fa5555d4239499868d66d9e1ed72f007c7e9f0fa10bb85fadb41c4cb26e470eedd839f42bd5fcb7da8412a069c5a658e49f004ccc5544178c4a5
6
+ metadata.gz: 1d9d8ab908e3206a94011151ea57200f8ddd2d4a6f30adb962d29b7282f11a724fd72ad5ad4682726ff66f20de3fe204b0492bae9fdcb3b92083322a7e7bb45d
7
+ data.tar.gz: c9a98f6f292ef8383533b7de5bc62d75f15374c932028a5c8e7370c79961b7693d5152754e74b4c1208de7b07dc8ab3e589d92336eafe77730a9d33246987e31
@@ -3,6 +3,10 @@
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.10]
7
+ - allow perform_now to run with default empty event
8
+ - fix env_properties in function resource, fixes stage name
9
+
6
10
  ## [0.8.9]
7
11
  - clean up convenience properties and add rest of them PR #24
8
12
 
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (0.8.9)
14
+ jets (0.8.10)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -14,8 +14,6 @@ module Jets::Commands
14
14
 
15
15
  desc "deploy [environment]", "Builds and deploys project to AWS Lambda"
16
16
  long_desc Help.text(:deploy)
17
- option :capabilities, type: :array, desc: "iam capabilities. Ex: CAPABILITY_IAM, CAPABILITY_NAMED_IAM"
18
- option :iam, type: :boolean, desc: "Shortcut for common IAM capabilities: CAPABILITY_IAM, CAPABILITY_NAMED_IAM"
19
17
  # Note the environment is here to trick the Thor parser to allowing an
20
18
  # environment parameter. It is not actually set here. It is set earlier
21
19
  # in cli.rb: set_jets_env_for_deploy_command!
@@ -62,7 +62,7 @@ class Jets::Controller
62
62
  return url unless actual_host
63
63
 
64
64
  if actual_host.include?("amazonaws.com") && url.starts_with?('/')
65
- stage_name = [Jets.config.short_env, Jets.config.env_extra].compact.join('_').gsub('-','_') # Stage name only allows a-zA-Z0-9_
65
+ stage_name = Jets::Resource::ApiGateway::Deployment.stage_name
66
66
  url = "/#{stage_name}#{url}"
67
67
  end
68
68
  url
@@ -15,11 +15,11 @@ class Jets::Job
15
15
  job.send(meth)
16
16
  end
17
17
 
18
- def perform_now(meth, event, context=nil)
18
+ def perform_now(meth, event={}, context={})
19
19
  new(event, context, meth).send(meth)
20
20
  end
21
21
 
22
- def perform_later(meth, event, context=nil)
22
+ def perform_later(meth, event={}, context={})
23
23
  function_name = "#{self.to_s.underscore}-#{meth}"
24
24
  call = Jets::Commands::Call.new(function_name, JSON.dump(event), invocation_type: "Event")
25
25
  call.run
@@ -23,16 +23,24 @@ class Jets::Resource
23
23
  end
24
24
 
25
25
  def combined_properties
26
- props = env_file_properties
26
+ props = env_properties
27
27
  .deep_merge(global_properties)
28
28
  .deep_merge(class_properties)
29
29
  .deep_merge(function_properties)
30
30
  finalize_properties!(props)
31
31
  end
32
32
 
33
- def env_file_properties
33
+ def env_properties
34
34
  env_vars = Jets::Dotenv.load!(true)
35
- {environment: { variables: env_vars }}
35
+ variables = environment.merge(env_vars)
36
+ {environment: { variables: variables }}
37
+ end
38
+
39
+ def environment
40
+ env = Jets.config.environment ? Jets.config.environment.to_h : {}
41
+ jets_env_options = {JETS_ENV: Jets.env.to_s}
42
+ jets_env_options[:JETS_ENV_EXTRA] = Jets.config.env_extra if Jets.config.env_extra
43
+ env.deep_merge(jets_env_options)
36
44
  end
37
45
 
38
46
  # Global properties example:
@@ -173,12 +181,5 @@ class Jets::Resource
173
181
  method = method.sub('/','-') + "-#{@task.meth}"
174
182
  "#{Jets.config.project_namespace}-#{method}"
175
183
  end
176
-
177
- def environment
178
- env = Jets.config.environment ? Jets.config.environment.to_h : {}
179
- jets_env_options = {JETS_ENV: Jets.env.to_s}
180
- jets_env_options[:JETS_ENV_EXTRA] = Jets.config.env_extra if Jets.config.env_extra
181
- env.deep_merge(jets_env_options)
182
- end
183
184
  end
184
185
  end
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "0.8.9"
2
+ VERSION = "0.8.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen