tzispa 0.4.7 → 0.4.8

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
  SHA1:
3
- metadata.gz: be0264dbd88974cd802bdc9e3e4d71413d90b47e
4
- data.tar.gz: 9d27f6794453d3d9f351c608463fc492000ac474
3
+ metadata.gz: d63bac87f861d60db3bd3239cfd7feab000ba0d7
4
+ data.tar.gz: 893406a35ea1ea3ee6653f14b10f9061ba937371
5
5
  SHA512:
6
- metadata.gz: be70785ed4efbe53d86c975e99832a62eb91ca50ac46877e0de19727b1bbb2714c3217c96e937892146309c8b3e0f1f8b19c6897d2b6e778bb7d47dd758d82b2
7
- data.tar.gz: d72f41fcd6edabadc31276bdf935f260adf6f44ec4194089c25f60afd8329202ab0a384d7c8831a833a641b50349ac91bb5938d672dbb5b6ae990eec0ecce2b1
6
+ metadata.gz: f28e6825678907a553d98243d9f4dad1778507a22612da51c51a3bdb4f3b4bb8d5d065382d37139e0e4f80bf91ab6bd882262e822273c8f3fd79d7925322c769
7
+ data.tar.gz: 9793576f8b9aa3409e1970d3303c6f09df2b22a4b3598b454a958cfe8ac273a19a13cbc264124f8515f97bde981305afc6bea86fe2ca0a7699a85a0986fe5946
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@ Tzispa
2
2
 
3
3
  General purpose web framework
4
4
 
5
+ ## v0.4.8
6
+ - rename context method error to error_500 for conflict with response helper error method
7
+ - pass response.status to error_page in controller base class
8
+
5
9
  ## v0.4.7
6
10
  - remove browser detection obsolete code
7
11
  - remake app error handling and reporting
data/lib/tzispa/app.rb CHANGED
@@ -83,9 +83,9 @@ module Tzispa
83
83
  rescue StandardError, ScriptError => ex
84
84
  logger.error "#{ex.message}\n#{ex.backtrace.map { |trace| "\t #{trace}" }.join('\n') if ex.respond_to?(:backtrace) && ex.backtrace}"
85
85
  if config.developing
86
- context.error error_report(ex)
86
+ context.error_500 error_report(ex)
87
87
  else
88
- context.error error_page(domain)
88
+ context.error_500 error_page(domain)
89
89
  end
90
90
  context.response.finish
91
91
  end
@@ -12,7 +12,7 @@ module Tzispa
12
12
  extend Forwardable
13
13
 
14
14
  attr_reader :context
15
- def_delegators :@context, :request, :response, :config, :error
15
+ def_delegators :@context, :request, :response, :config
16
16
 
17
17
  def initialize(callmethod=nil)
18
18
  @callmethod = callmethod
@@ -31,7 +31,7 @@ module Tzispa
31
31
  send "#{@callmethod}"
32
32
  }
33
33
  response.status = status if status.is_a?(Integer)
34
- error context.app.error_page(response.status) if (response.client_error? || response.server_error?)
34
+ context.error_500 context.app.error_page(context.app.domain, status: response.status) if (response.client_error? || response.server_error?)
35
35
  end
36
36
 
37
37
 
@@ -38,12 +38,12 @@ module Tzispa
38
38
  router_params&.fetch(:layout, nil)
39
39
  end
40
40
 
41
- def error(body)
41
+ def error_500(body)
42
42
  500.tap { |code|
43
43
  response.status = code
44
44
  response.body = body
45
45
  }
46
- end
46
+ end
47
47
 
48
48
  def set_last_access
49
49
  session[SESSION_LAST_ACCESS] = Time.now.utc.iso8601
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tzispa
4
- VERSION = '0.4.7'
4
+ VERSION = '0.4.8'
5
5
  FRAMEWORK_NAME = 'Tzispa'
6
6
  GEM_NAME = 'tzispa'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tzispa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Antonio Piñero