jets 2.1.4 → 2.1.5
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/jets/controller/rendering/rack_renderer.rb +5 -1
- data/lib/jets/job/base.rb +13 -3
- data/lib/jets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c88605b05a1cab1ca62e2c64ccb6a626cf292d2c7a033dba435754c8448f695
|
4
|
+
data.tar.gz: 6294de6054d3a1cd06cc865439eba6c83467f464ceeb116f6c5af83423d3868a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27c9b31e58672f9d82eeaca489b2e1fce6c0f2e2cc24fa973d5deb6c06908d137148c41bc38b06bc43c02819548de96151a61638ac4fa1ae4464889207ec9d15
|
7
|
+
data.tar.gz: cd7d124386d22ee30de783c64ee361a86b44b0a683bc2b5eefd70bb727d194a1bf6e17cc8ec55dadd44e5f47a6c763b719c2808feade605266d18c25b346aaab
|
data/CHANGELOG.md
CHANGED
@@ -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/).
|
5
5
|
|
6
|
+
## [2.1.5]
|
7
|
+
- perform_later calls perform_now in local mode when not on lambda
|
8
|
+
- fix: clear view cache in development mode
|
9
|
+
|
6
10
|
## [2.1.4]
|
7
11
|
- allow jets code to access event object values with symbols also
|
8
12
|
|
@@ -33,6 +33,7 @@ module Jets::Controller::Rendering
|
|
33
33
|
# _prefixes provided by jets/overrides/rails/action_controller.rb
|
34
34
|
ActionController::Base._prefixes = @controller.controller_paths
|
35
35
|
renderer = ActionController::Base.renderer.new(renderer_options)
|
36
|
+
clear_view_cache
|
36
37
|
body = renderer.render(render_options)
|
37
38
|
body = StringIO.new(body)
|
38
39
|
end
|
@@ -150,6 +151,10 @@ module Jets::Controller::Rendering
|
|
150
151
|
instance_vars
|
151
152
|
end
|
152
153
|
|
154
|
+
def clear_view_cache
|
155
|
+
ActionView::LookupContext::DetailsKey.clear if Jets.env.development?
|
156
|
+
end
|
157
|
+
|
153
158
|
private
|
154
159
|
# From jets/controller/response.rb
|
155
160
|
def drop_content_info?(status)
|
@@ -213,7 +218,6 @@ module Jets::Controller::Rendering
|
|
213
218
|
end
|
214
219
|
|
215
220
|
ActionController::Base.append_view_path("#{Jets.root}/app/views")
|
216
|
-
ActionView::Resolver.caching = !Jets.env.development?
|
217
221
|
|
218
222
|
setup_webpacker if Jets.webpacker?
|
219
223
|
end
|
data/lib/jets/job/base.rb
CHANGED
@@ -30,9 +30,19 @@ module Jets::Job
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def perform_later(meth, event={}, context={})
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
if on_lambda?
|
34
|
+
function_name = "#{self.to_s.underscore}-#{meth}"
|
35
|
+
call = Jets::Commands::Call.new(function_name, JSON.dump(event), invocation_type: "Event")
|
36
|
+
call.run
|
37
|
+
else
|
38
|
+
puts "INFO: Not on AWS Lambda. In local mode perform_later executes the job with perform_now instead."
|
39
|
+
perform_now(meth, event, context)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
def on_lambda?
|
45
|
+
!!ENV['AWS_LAMBDA_FUNCTION_NAME'] || Jets.env.test?
|
36
46
|
end
|
37
47
|
end
|
38
48
|
end
|
data/lib/jets/version.rb
CHANGED