pakyow-support 1.0.0.rc5 → 1.0.0
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 +3 -23
- data/lib/pakyow/support/definable.rb +3 -3
- data/lib/pakyow/support/makeable.rb +2 -0
- data/lib/pakyow/support/pipeline.rb +8 -8
- data/lib/pakyow/support/pipeline/object.rb +6 -5
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acd5a14c0f5717ee81f6ca76663ebacf566864b462367ec93de6900216aeea15
|
4
|
+
data.tar.gz: 01c4cc7c7521c7e0273417bc8096eac678e42a48e805ca81350490b13e62c14d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fdfa3bdc3ca7800bf313953f30b662711ae880727b19cd0efbd8a7ee8520fbe81ab1430c3a1e51a730c39b27be6164170a1ad67725af1c10656346003c2a485
|
7
|
+
data.tar.gz: d60828a4ea1a03ae02795a98186a4c7d96c0be48c991165c55bb620133a66ca922596c164f4a12dbddd4dd91e6f918b25b0bc1193f27f95e4b79cac88e6ae76f
|
data/CHANGELOG.md
CHANGED
@@ -1,25 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# UNRELEASED
|
2
2
|
|
3
|
-
|
3
|
+
# 1.0
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
* Moves everything into the Pakyow namespace
|
8
|
-
* Adds `FalseClass` and `TrueClass` as uncloneable types
|
9
|
-
|
10
|
-
# 0.10.1 / 2015-10-19
|
11
|
-
|
12
|
-
* Fixes require path in gemspec
|
13
|
-
|
14
|
-
# 0.10.0 / 2015-10-19
|
15
|
-
|
16
|
-
* Adds helper method for capitalizing a string
|
17
|
-
* Ported all tests to rspec
|
18
|
-
|
19
|
-
# 0.9.1 / 2014-12-06
|
20
|
-
|
21
|
-
* No changes -- bumped version to be consistent
|
22
|
-
|
23
|
-
# 0.9.0 / 2014-11-09
|
24
|
-
|
25
|
-
* Initial gem release
|
5
|
+
* Hello, Web
|
@@ -98,16 +98,16 @@ module Pakyow
|
|
98
98
|
# end
|
99
99
|
# end
|
100
100
|
#
|
101
|
-
# class
|
101
|
+
# class Application
|
102
102
|
# include Pakyow::Support::Definable
|
103
103
|
#
|
104
104
|
# stateful :person, Person
|
105
105
|
# end
|
106
106
|
#
|
107
|
-
# john =
|
107
|
+
# john = Application.person 'John', Date.new(1988, 8, 13) do
|
108
108
|
# end
|
109
109
|
#
|
110
|
-
#
|
110
|
+
# Application.person 'Sofie', Date.new(2015, 9, 6) do
|
111
111
|
# befriend(john)
|
112
112
|
# end
|
113
113
|
#
|
@@ -17,8 +17,10 @@ module Pakyow
|
|
17
17
|
end
|
18
18
|
|
19
19
|
attr_reader :__object_name
|
20
|
+
attr_accessor :__source_location
|
20
21
|
|
21
22
|
def make(object_name, within: nil, set_const: true, **kwargs, &block)
|
23
|
+
@__source_location = block&.source_location
|
22
24
|
object_name = build_object_name(object_name, within: within)
|
23
25
|
object = find_or_define_object(object_name, kwargs, set_const)
|
24
26
|
|
@@ -5,14 +5,14 @@ require "pakyow/support/class_state"
|
|
5
5
|
module Pakyow
|
6
6
|
module Support
|
7
7
|
# Provides pipeline behavior. Pipeline objects can define actions to be called in order on an
|
8
|
-
# instance of the pipelined object. Each action can act on the
|
8
|
+
# instance of the pipelined object. Each action can act on the object passed to it. Any action
|
9
9
|
# can halt the pipeline, causing the result to be immediately returned without calling other
|
10
|
-
# actions.
|
10
|
+
# actions. Objects passed through the pipeline should include {Pipeline::Object}.
|
11
11
|
#
|
12
|
-
# See {Pakyow::
|
12
|
+
# See {Pakyow::Application} and {Pakyow::Routing::Controller} for more examples.
|
13
13
|
#
|
14
14
|
# @example
|
15
|
-
# class
|
15
|
+
# class Application
|
16
16
|
# include Pakyow::Support::Pipeline
|
17
17
|
#
|
18
18
|
# action :foo
|
@@ -41,12 +41,12 @@ module Pakyow
|
|
41
41
|
# end
|
42
42
|
# end
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# Application.new.call(Result.new).results
|
45
45
|
# => ["foo", "bar"]
|
46
46
|
#
|
47
47
|
# = Modules
|
48
48
|
#
|
49
|
-
# Pipeline
|
49
|
+
# Pipeline actions can be defined in a module and included in a pipelined object.
|
50
50
|
#
|
51
51
|
# @example
|
52
52
|
# module VerifyRequest
|
@@ -59,7 +59,7 @@ module Pakyow
|
|
59
59
|
# end
|
60
60
|
# end
|
61
61
|
#
|
62
|
-
# class
|
62
|
+
# class Application
|
63
63
|
# include Pakyow::Support::Pipeline
|
64
64
|
#
|
65
65
|
# use_pipeline VerifyRequest
|
@@ -262,7 +262,7 @@ module Pakyow
|
|
262
262
|
|
263
263
|
def call(object, stack = @stack.dup)
|
264
264
|
catch :halt do
|
265
|
-
until stack.empty? ||
|
265
|
+
until stack.empty? || object.halted?
|
266
266
|
action = stack.shift
|
267
267
|
if action.arity == 0
|
268
268
|
action.call do
|
@@ -12,26 +12,27 @@ module Pakyow
|
|
12
12
|
|
13
13
|
def pipelined
|
14
14
|
tap do
|
15
|
-
@
|
15
|
+
@__pipelined = true
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
def pipelined?
|
20
|
-
@
|
20
|
+
@__pipelined == true
|
21
21
|
end
|
22
22
|
|
23
23
|
def halt
|
24
|
-
@
|
24
|
+
@__halted = true
|
25
25
|
throw :halt, true
|
26
26
|
end
|
27
27
|
|
28
28
|
def halted?
|
29
|
-
@
|
29
|
+
@__halted == true
|
30
30
|
end
|
31
31
|
|
32
32
|
module Initializer
|
33
33
|
def initialize(*args)
|
34
|
-
@
|
34
|
+
@__halted = false
|
35
|
+
@__pipelined = false
|
35
36
|
super
|
36
37
|
end
|
37
38
|
end
|
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
|
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-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.9'
|
83
83
|
description: Supporting code for Pakyow
|
84
|
-
email: bryan@
|
84
|
+
email: bryan@bryanp.org
|
85
85
|
executables: []
|
86
86
|
extensions: []
|
87
87
|
extra_rdoc_files: []
|
@@ -123,7 +123,7 @@ files:
|
|
123
123
|
- lib/pakyow/support/serializer.rb
|
124
124
|
- lib/pakyow/support/silenceable.rb
|
125
125
|
- lib/pakyow/support/string_builder.rb
|
126
|
-
homepage: https://pakyow.
|
126
|
+
homepage: https://pakyow.com
|
127
127
|
licenses:
|
128
128
|
- LGPL-3.0
|
129
129
|
metadata: {}
|
@@ -138,9 +138,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: 2.5.0
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
|
-
- - "
|
141
|
+
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
143
|
+
version: '0'
|
144
144
|
requirements: []
|
145
145
|
rubygems_version: 3.0.3
|
146
146
|
signing_key:
|