navigable 1.0.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +20 -7
- data/lib/navigable/command.rb +3 -1
- data/lib/navigable/dispatcher.rb +8 -4
- data/lib/navigable/{basic_resolver.rb → null_resolver.rb} +1 -1
- data/lib/navigable/observer.rb +1 -1
- data/lib/navigable/resolver.rb +14 -1
- data/lib/navigable/version.rb +1 -1
- data/navigable.gemspec +5 -5
- metadata +13 -21
- data/assets/clipper.png +0 -0
- data/assets/compass.png +0 -0
- data/assets/header.png +0 -0
- data/assets/lighthouse.png +0 -0
- data/assets/map.png +0 -0
- data/assets/navigable.png +0 -0
- data/assets/telescope.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a004a4e2480872ee2a0130049ad9ef937a051ce833e531ac7630e959619d810
|
4
|
+
data.tar.gz: e8da43504809998f63d4814e6e811210bed57e08da0fbeb129ed0cf6771d152b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d59a86ed9f40d4d1def574099592f46b4434f78deb0aa1b6e89d41fd6cc13d8c89db2393885bff1449113741c9e566cecd6d30848962c2afd6da6f23dbf29abf
|
7
|
+
data.tar.gz: c159acdb8be562e419540b01cccf1efb9df1b8dfa37f9fd85b7e6ac7a455fb54dd080c29d062b96460fb8f393688d15061ac10466b68dd83f0e025309a34aec3
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -11,8 +11,17 @@ Navigable is a family of gems that together provide all the tools you need to bu
|
|
11
11
|
<td width="130"><img alt="Clipper Ship" src="https://raw.githubusercontent.com/first-try-software/navigable/main/assets/clipper.png"></td>
|
12
12
|
<td>
|
13
13
|
|
14
|
-
**Navigable**<br>
|
15
|
-
A stand-alone tool for isolating business logic from external interfaces and cross-cutting concerns. Navigable composes self-configured command and observer objects to allow you to extend your business logic without modifying it. Navigable is compatible with any Ruby-based application development framework, including Rails and
|
14
|
+
**[Navigable][navigable]**<br>
|
15
|
+
A stand-alone tool for isolating business logic from external interfaces and cross-cutting concerns. Navigable composes self-configured command and observer objects to allow you to extend your business logic without modifying it. Navigable is compatible with any Ruby-based application development framework, including Rails, Hanami, and Sinatra.
|
16
|
+
|
17
|
+
</td>
|
18
|
+
</tr>
|
19
|
+
<tr height="140">
|
20
|
+
<td width="130"><img alt="Compass" src="https://raw.githubusercontent.com/first-try-software/navigable/main/assets/sextant.png"></td>
|
21
|
+
<td>
|
22
|
+
|
23
|
+
**[Navigable Router][router]** *(coming soon)*<br>
|
24
|
+
A simple, highly-performant, Rack-based router.
|
16
25
|
|
17
26
|
</td>
|
18
27
|
</tr>
|
@@ -20,8 +29,8 @@ A stand-alone tool for isolating business logic from external interfaces and cro
|
|
20
29
|
<td width="130"><img alt="Compass" src="https://raw.githubusercontent.com/first-try-software/navigable/main/assets/compass.png"></td>
|
21
30
|
<td>
|
22
31
|
|
23
|
-
**Navigable Server** *(coming soon)*<br>
|
24
|
-
A Rack-based
|
32
|
+
**[Navigable Server][server]** *(coming soon)*<br>
|
33
|
+
A Rack-based server for building Ruby and Navigable web applications.
|
25
34
|
|
26
35
|
</td>
|
27
36
|
</tr>
|
@@ -49,8 +58,6 @@ An extension of Navigable Server for building GraphQL APIs.
|
|
49
58
|
|
50
59
|
<img style="width: 600px; display: block; margin: 0 auto;" alt="Lighthouse" src="https://raw.githubusercontent.com/first-try-software/navigable/main/assets/lighthouse.png">
|
51
60
|
|
52
|
-
<br>
|
53
|
-
|
54
61
|
# The Navigable Charter
|
55
62
|
|
56
63
|
We hold these truths to be self-evident, that not all objects are created equal, that poorly structured code leads to poorly tested code, and that poorly tested code leads to rigid software and fearful engineers.
|
@@ -164,11 +171,13 @@ Here are a few things to look for in the code above:
|
|
164
171
|
|
165
172
|
* Use the `observes_all_commands` statement (as shown in the `Monitor` class) for cross-cutting concerns. It tells Navigable to send messages to the observer no matter which command was executed.
|
166
173
|
|
174
|
+
For a deeper look at the core concepts introduced by Navigable, please have a look at our [wiki][wiki].
|
175
|
+
|
167
176
|
## Feedback
|
168
177
|
|
169
178
|
We are really excited about Navigable! We think it solves the problem of seperating business logic from the web interface, persistence layer, and even cross-cutting concerns in an elegant and simple way.
|
170
179
|
|
171
|
-
We
|
180
|
+
We're thrilled you're checking out Navigable! If you have any questions or comments, please feel free to reach out to [navigable@firsttry.software][mail].
|
172
181
|
|
173
182
|
## Installation
|
174
183
|
|
@@ -210,3 +219,7 @@ Everyone interacting in the Navigable project's codebases, issue trackers, chat
|
|
210
219
|
[ocp]: https://en.wikipedia.org/wiki/Open–closed_principle
|
211
220
|
[ddd]: https://en.wikipedia.org/wiki/Domain-driven_design
|
212
221
|
[mail]: mailto:navigable@firsttry.software
|
222
|
+
[wiki]: https://github.com/first-try-software/navigable/wiki
|
223
|
+
[navigable]: https://github.com/first-try-software/navigable
|
224
|
+
[router]: https://github.com/first-try-software/navigable-router
|
225
|
+
[server]: https://github.com/first-try-software/navigable-server
|
data/lib/navigable/command.rb
CHANGED
@@ -4,6 +4,8 @@ require 'navigable/observable'
|
|
4
4
|
|
5
5
|
module Navigable
|
6
6
|
module Command
|
7
|
+
class NotFoundError < StandardError; end
|
8
|
+
|
7
9
|
TYPE = :__command__
|
8
10
|
EXECUTE_NOT_IMPLEMENTED_MESSAGE = 'Class must implement `execute` method.'
|
9
11
|
|
@@ -20,7 +22,7 @@ module Navigable
|
|
20
22
|
base.class_eval do
|
21
23
|
attr_reader :params, :observers
|
22
24
|
|
23
|
-
def
|
25
|
+
def inject(params: {}, observers: [])
|
24
26
|
@params = params
|
25
27
|
@observers = observers
|
26
28
|
end
|
data/lib/navigable/dispatcher.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen-string-literal: true
|
2
2
|
|
3
|
-
require 'navigable/
|
3
|
+
require 'navigable/null_resolver'
|
4
4
|
require 'navigable/observer'
|
5
5
|
require 'navigable/command'
|
6
6
|
|
7
7
|
module Navigable
|
8
8
|
class Dispatcher
|
9
|
-
def self.dispatch(key, params: {}, resolver:
|
9
|
+
def self.dispatch(key, params: {}, resolver: NullResolver.new)
|
10
10
|
self.new(key, params: params, resolver: resolver).dispatch
|
11
11
|
end
|
12
12
|
|
@@ -25,11 +25,15 @@ module Navigable
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def observers
|
28
|
-
Manufacturable.build_all(Observer::TYPE, key
|
28
|
+
Manufacturable.build_all(Observer::TYPE, key) { |observer| observer.inject(params: params) }.push(resolver)
|
29
29
|
end
|
30
30
|
|
31
31
|
def command
|
32
|
-
|
32
|
+
build_command.tap { |command| raise Navigable::Command::NotFoundError unless command }
|
33
|
+
end
|
34
|
+
|
35
|
+
def build_command
|
36
|
+
Manufacturable.build_one(Command::TYPE, key) { |command| command.inject(params: params, observers: observers) }
|
33
37
|
end
|
34
38
|
end
|
35
39
|
end
|
data/lib/navigable/observer.rb
CHANGED
data/lib/navigable/resolver.rb
CHANGED
@@ -4,10 +4,23 @@ require 'navigable/observer_interface'
|
|
4
4
|
|
5
5
|
module Navigable
|
6
6
|
module Resolver
|
7
|
-
|
7
|
+
TYPE = :__resolver__
|
8
|
+
RESOLVE_NOT_IMPLEMENTED_MESSAGE = 'Resolver classes must implement a `resolve` method.'
|
8
9
|
|
9
10
|
def self.extended(base)
|
11
|
+
base.extend(Manufacturable::Item)
|
10
12
|
base.include(ObserverInterface)
|
13
|
+
|
14
|
+
base.instance_eval do
|
15
|
+
def default_resolver
|
16
|
+
default_manufacturable(TYPE)
|
17
|
+
end
|
18
|
+
|
19
|
+
def resolves(key)
|
20
|
+
corresponds_to(key, TYPE)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
11
24
|
base.class_eval do
|
12
25
|
def resolve
|
13
26
|
raise NotImplementedError.new(RESOLVE_NOT_IMPLEMENTED_MESSAGE)
|
data/lib/navigable/version.rb
CHANGED
data/navigable.gemspec
CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.authors = ["Alan Ridlehoover", "Fito von Zastrow"]
|
8
8
|
spec.email = ["navigable@firsttry.software"]
|
9
9
|
|
10
|
-
spec.summary = %q{Ahoy!
|
11
|
-
spec.description = %q{
|
10
|
+
spec.summary = %q{Ahoy! Welcome aboard Navigable!}
|
11
|
+
spec.description = %q{A stand-alone tool for isolating business logic from external interfaces and cross-cutting concerns. Navigable composes self-configured command and observer objects to allow you to extend your business logic without modifying it. Navigable is compatible with any Ruby-based application development framework, including Rails, Hanami, and Sinatra.}
|
12
12
|
spec.homepage = "https://firsttry.software"
|
13
13
|
spec.license = "MIT"
|
14
14
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
@@ -18,17 +18,17 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.metadata["bug_tracker_uri"] = "https://github.com/first-try-software/navigable/issues"
|
19
19
|
|
20
20
|
spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
|
21
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|assets)/}) }
|
22
22
|
end
|
23
23
|
spec.bindir = "exe"
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
|
-
spec.add_dependency "manufacturable", "~> 1.
|
27
|
+
spec.add_dependency "manufacturable", "~> 1.5"
|
28
28
|
|
29
29
|
spec.add_development_dependency "bundler", "~> 2.0"
|
30
30
|
spec.add_development_dependency "rake", "~> 12.0"
|
31
31
|
spec.add_development_dependency "rspec", "~> 3.0"
|
32
32
|
spec.add_development_dependency "rspec_junit_formatter", "~>0.4"
|
33
|
-
spec.add_development_dependency "simplecov", "~>0.
|
33
|
+
spec.add_development_dependency "simplecov", "~>0.17.0"
|
34
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: navigable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Ridlehoover
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-09-
|
12
|
+
date: 2020-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: manufacturable
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '1.
|
20
|
+
version: '1.5'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '1.
|
27
|
+
version: '1.5'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: bundler
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,20 +87,19 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
90
|
+
version: 0.17.0
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
98
|
-
description:
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
structured, well tested, maleable code that is truly navigable.
|
97
|
+
version: 0.17.0
|
98
|
+
description: A stand-alone tool for isolating business logic from external interfaces
|
99
|
+
and cross-cutting concerns. Navigable composes self-configured command and observer
|
100
|
+
objects to allow you to extend your business logic without modifying it. Navigable
|
101
|
+
is compatible with any Ruby-based application development framework, including Rails,
|
102
|
+
Hanami, and Sinatra.
|
104
103
|
email:
|
105
104
|
- navigable@firsttry.software
|
106
105
|
executables: []
|
@@ -116,19 +115,12 @@ files:
|
|
116
115
|
- LICENSE.txt
|
117
116
|
- README.md
|
118
117
|
- Rakefile
|
119
|
-
- assets/clipper.png
|
120
|
-
- assets/compass.png
|
121
|
-
- assets/header.png
|
122
|
-
- assets/lighthouse.png
|
123
|
-
- assets/map.png
|
124
|
-
- assets/navigable.png
|
125
|
-
- assets/telescope.png
|
126
118
|
- bin/console
|
127
119
|
- bin/setup
|
128
120
|
- lib/navigable.rb
|
129
|
-
- lib/navigable/basic_resolver.rb
|
130
121
|
- lib/navigable/command.rb
|
131
122
|
- lib/navigable/dispatcher.rb
|
123
|
+
- lib/navigable/null_resolver.rb
|
132
124
|
- lib/navigable/observable.rb
|
133
125
|
- lib/navigable/observer.rb
|
134
126
|
- lib/navigable/observer_interface.rb
|
@@ -160,5 +152,5 @@ requirements: []
|
|
160
152
|
rubygems_version: 3.1.2
|
161
153
|
signing_key:
|
162
154
|
specification_version: 4
|
163
|
-
summary: Ahoy!
|
155
|
+
summary: Ahoy! Welcome aboard Navigable!
|
164
156
|
test_files: []
|
data/assets/clipper.png
DELETED
Binary file
|
data/assets/compass.png
DELETED
Binary file
|
data/assets/header.png
DELETED
Binary file
|
data/assets/lighthouse.png
DELETED
Binary file
|
data/assets/map.png
DELETED
Binary file
|
data/assets/navigable.png
DELETED
Binary file
|
data/assets/telescope.png
DELETED
Binary file
|