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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e742d6192a504881c3296e54bf633b160ae905220a026e949bb750ab53dc716
4
- data.tar.gz: d2c073a7434b4c5f981fc81400f9eb03997cce41d897b2b62adc2e0cb3bb3928
3
+ metadata.gz: 8c88605b05a1cab1ca62e2c64ccb6a626cf292d2c7a033dba435754c8448f695
4
+ data.tar.gz: 6294de6054d3a1cd06cc865439eba6c83467f464ceeb116f6c5af83423d3868a
5
5
  SHA512:
6
- metadata.gz: 30abc7d999564b142099973343fb609cc1d7cf071239842565ea60bffb41aba861f2a9503b60158aff0e462c71799e65ec1d0a11add0011250a04c863b1d0a4e
7
- data.tar.gz: 34ea659906266b3c5388b5fa05d64dd19521a6529ba0d02b2fb2f9ac3fab3bb9d3c71d18e540ad7ec21f92a7f9db4a2c0acc946c6a8c309d28fa1457b3ad940c
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
- function_name = "#{self.to_s.underscore}-#{meth}"
34
- call = Jets::Commands::Call.new(function_name, JSON.dump(event), invocation_type: "Event")
35
- call.run
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
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "2.1.4"
2
+ VERSION = "2.1.5"
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: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen