jets 1.1.2 → 1.1.3

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: 5ecc5e447f03b9d40dade6bff50a44934927025c95ccf361f982cc53604df333
4
- data.tar.gz: 73c5f39837c54978981ec64d95fb35357120a9713b607da78489f7c90f2b6dcc
3
+ metadata.gz: f0e2ca4e1e46c54d0900404bd31e09e0d142a2e1b15452e680a1ca61caec0c11
4
+ data.tar.gz: f299c7812a68de607e111195649b948c7099055ebb7db250c351807828ad38ca
5
5
  SHA512:
6
- metadata.gz: f2e6263c94821deef72dede51d7f7bb90f5f23a097a019e934f43244ad281f3aacfe64c7ff11645a13b059927b5d4607de4e299b9290cbd77cd29323643c929a
7
- data.tar.gz: e9d1d33c1941262bca8139d7d0512b0ab89ec9e4b0300d2d232ca4de083c0eeffe009e5e62910ea5c2661fd8bda4f35295246b5cc18e37a129b1126b5b16a65c
6
+ metadata.gz: 50812ce230aad0e1fa837152dcf69ad53436772ce2c4339f1b2e868efe182ae9af7bec4c2f5dc8efc9d86ebd2f0857f3bc8c6dc0faedb4822af2b69c9636cea7
7
+ data.tar.gz: a34ff0de3463ec1db9f4cab3f5f9372de2211c2efa6eb0888a0c680755605b4d82e8843553e9bfca484cf056046b57b7dc36a5d054aba94a47d6dc1bd2641094
data/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
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
+ ## [1.1.3]
7
+ - Merge pull request #79 from tongueroo/misc-fixes
8
+ - fix has_poly? check to account for shared functions
9
+ - fix jets new mode job copy_options
10
+ - fix Jets Turbine require active support fixes issue #78
11
+ - parse for project name as workaround to avoid double loading config/application.rb
12
+
6
13
  ## [1.1.2]
7
14
  - Add option to specify authorization type application-wide option and on a per-route basis.
8
15
  - Add option to specify endpoint type of the ApiGateway: config.api.endpoint_type option
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.1.2)
14
+ jets (1.1.3)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -85,28 +85,32 @@ class Jets::Application
85
85
  config
86
86
  end
87
87
 
88
- def load_app_config
89
- # First time loading will not have all correct values. Some values like
90
- # project_namespace depend on project_name. Loading the config twice
91
- # resolves the chicken-and-egg problem with config.project_name.
92
- # TODO: Improve the way we this is solved.
93
- eval_app_config(squash_exception: true) # first time load to capture the config.project_name
94
- @config = default_config(config.project_name) # reset config with the captured project_name
88
+ # Double evaling config/application.rb causes subtle issues:
89
+ # * double loading of shared resources: Jets::Stack.subclasses will have the same
90
+ # class twice when config is called when declaring a function
91
+ # * forces us to rescue all exceptions, which is a big hammer
92
+ #
93
+ # Lets parse for the project name instead for now.
94
+ #
95
+ def parse_project_name
96
+ lines = IO.readlines("#{Jets.root}config/application.rb")
97
+ project_name_line = lines.find { |l| l =~ /project_name/ }
98
+ project_name_line.gsub(/.*=/,'').strip.gsub(/["']/,'') # project_name
99
+ end
95
100
 
101
+ def load_app_config
102
+ project_name = parse_project_name
103
+ @config = default_config(project_name)
96
104
  set_dependent_configs! # things like project_namespace that need project_name
97
-
98
- # Running eval_app_config the second time, hack to solve the chicken-and-egg problem
99
105
  eval_app_config
100
106
 
101
107
  set_iam_policy # relies on dependent values, must be called afterwards
102
108
  normalize_env_vars!
103
109
  end
104
110
 
105
- def eval_app_config(squash_exception: false)
111
+ def eval_app_config
106
112
  app_config = "#{Jets.root}config/application.rb"
107
- load app_config
108
- rescue NoMethodError => e
109
- raise(e) unless squash_exception
113
+ require app_config
110
114
  end
111
115
 
112
116
  def load_environments_config
@@ -141,12 +141,29 @@ module Jets::Commands
141
141
  # In this case, we can skip a lot of the ruby related building and speed up the
142
142
  # deploy process.
143
143
  def self.poly_only?
144
+ !app_has_ruby? && !shared_has_ruby?
145
+ end
146
+
147
+ def self.app_has_ruby?
144
148
  has_ruby = app_files.detect do |path|
145
149
  app_class = Jets::Klass.from_path(path) # IE: PostsController, Jets::PublicController
146
150
  langs = app_class.tasks.map(&:lang)
147
151
  langs.include?(:ruby)
148
152
  end
149
- !has_ruby
153
+ !!has_ruby
154
+ end
155
+
156
+ def self.shared_has_ruby?
157
+ has_ruby = false
158
+ Jets::Stack.subclasses.each do |klass|
159
+ klass.functions.each do |fun|
160
+ if fun.lang == :ruby
161
+ has_ruby = true
162
+ break
163
+ end
164
+ end
165
+ end
166
+ has_ruby
150
167
  end
151
168
 
152
169
  # Add internal Jets controllers if they are being used
@@ -65,6 +65,15 @@ private
65
65
  database.yml
66
66
  models/application_record
67
67
  ]
68
+ else
69
+ []
70
+ end
71
+
72
+ if excludes.empty?
73
+ {}
74
+ else
75
+ pattern = Regexp.new(excludes.join('|'))
76
+ {exclude_pattern: pattern }
68
77
  end
69
78
  end
70
79
 
data/lib/jets/turbine.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'active_support'
2
+ require 'active_support/core_ext'
3
+
1
4
  module Jets
2
5
  class Turbine
3
6
  class_attribute :initializers
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
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: 1.1.2
4
+ version: 1.1.3
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-11-21 00:00:00.000000000 Z
11
+ date: 2018-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack