pakyow-support 1.0.0.rc2 → 1.0.0.rc3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bca7371b208b214e0e6d11b34c18e1e2a3ed07ee928c3a6bf294735ead3c788c
|
4
|
+
data.tar.gz: 37f763da6ce98cc8834e3dbd54154b9cb235071fbedcab9e62b47cf8baa06783
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2295387652388a3f3e6c24c3c4edcd478270c9f6972015183c98761f5dbdcbc0afc51437a498c71cc508d072543dc90ec267c63ea45889108b14fba5a344d511
|
7
|
+
data.tar.gz: a1fd0a60b5e80ac1c0e55da3220453c1e676c0e874d854fdc174ddc744ec56937a06f0d8fca58f311f47463e14f6ddc2a1f0d9ccfc95b4502998e548c0d8c7f8
|
@@ -110,6 +110,7 @@ module Pakyow
|
|
110
110
|
indifferentize_update_method :merge!, :update, :replace, :clear, :keep_if, :delete_if, :compact!, :reject!, :select!
|
111
111
|
indifferentize_argument_method :>, :>=, :<=>, :<, :<=, :==
|
112
112
|
|
113
|
+
# @api private
|
113
114
|
def internal_hash
|
114
115
|
__getobj__
|
115
116
|
end
|
@@ -9,7 +9,7 @@ module Pakyow
|
|
9
9
|
# can halt the pipeline, causing the result to be immediately returned without calling other
|
10
10
|
# actions. State passed through the pipeline should include {Pipelined::Object}.
|
11
11
|
#
|
12
|
-
# See {Pakyow::App} and {Pakyow::Controller} for examples of more complex pipelines.
|
12
|
+
# See {Pakyow::App} and {Pakyow::Routing::Controller} for examples of more complex pipelines.
|
13
13
|
#
|
14
14
|
# @example
|
15
15
|
# class App
|
@@ -2,17 +2,15 @@
|
|
2
2
|
|
3
3
|
require "fileutils"
|
4
4
|
|
5
|
-
require "pakyow/support/logging"
|
6
|
-
|
7
5
|
module Pakyow
|
8
6
|
module Support
|
9
7
|
# Persists state for an object.
|
10
8
|
#
|
11
9
|
class Serializer
|
12
|
-
attr_reader :object, :name, :path
|
10
|
+
attr_reader :object, :name, :path, :logger
|
13
11
|
|
14
|
-
def initialize(object, name:, path:)
|
15
|
-
@object, @name, @path = object, name, path
|
12
|
+
def initialize(object, name:, path:, logger:)
|
13
|
+
@object, @name, @path, @logger = object, name, path, logger
|
16
14
|
end
|
17
15
|
|
18
16
|
def serialize
|
@@ -21,9 +19,7 @@ module Pakyow
|
|
21
19
|
file.write(Marshal.dump(@object.serialize))
|
22
20
|
end
|
23
21
|
rescue => error
|
24
|
-
|
25
|
-
logger.error "[Serializer] failed to serialize `#{@name}': #{error}"
|
26
|
-
end
|
22
|
+
@logger.error "[Serializer] failed to serialize `#{@name}': #{error}"
|
27
23
|
end
|
28
24
|
|
29
25
|
def deserialize
|
@@ -34,9 +30,7 @@ module Pakyow
|
|
34
30
|
end
|
35
31
|
rescue => error
|
36
32
|
FileUtils.rm(serialized_state_path)
|
37
|
-
|
38
|
-
logger.error "[Serializer] failed to deserialize `#{@name}': #{error}"
|
39
|
-
end
|
33
|
+
@logger.error "[Serializer] failed to deserialize `#{@name}': #{error}"
|
40
34
|
end
|
41
35
|
|
42
36
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pakyow-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -111,7 +111,6 @@ files:
|
|
111
111
|
- lib/pakyow/support/indifferentize.rb
|
112
112
|
- lib/pakyow/support/inflector.rb
|
113
113
|
- lib/pakyow/support/inspectable.rb
|
114
|
-
- lib/pakyow/support/logging.rb
|
115
114
|
- lib/pakyow/support/makeable.rb
|
116
115
|
- lib/pakyow/support/makeable/object_maker.rb
|
117
116
|
- lib/pakyow/support/makeable/object_name.rb
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "logger"
|
4
|
-
|
5
|
-
module Pakyow
|
6
|
-
module Support
|
7
|
-
module Logging
|
8
|
-
# Yields Pakyow.logger if defined, otherwise raises `error`.
|
9
|
-
#
|
10
|
-
def self.yield_or_raise(error)
|
11
|
-
if defined?(Pakyow.logger)
|
12
|
-
yield(Pakyow.logger)
|
13
|
-
else
|
14
|
-
raise error
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# Yields Pakyow.logger if defined, or a default logger.
|
19
|
-
#
|
20
|
-
def self.safe
|
21
|
-
logger = if defined?(Pakyow.logger) && Pakyow.logger
|
22
|
-
Pakyow.logger
|
23
|
-
else
|
24
|
-
::Logger.new($stdout)
|
25
|
-
end
|
26
|
-
|
27
|
-
yield logger
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|