easy_flow 0.4.2 → 0.4.3
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/app/controllers/easy_flow/application_controller.rb +7 -0
- data/lib/easy_flow/host_routes.rb +14 -0
- data/lib/easy_flow/version.rb +1 -1
- data/lib/easy_flow.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09da0c518d71ed06c4d63399b2038696d15c770ee0706926bad55f81a3a58a34'
|
|
4
|
+
data.tar.gz: 68642f79f5418b7db09b3a7274948f8480f7519ca4224546b23bdb94e6e7db0d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ae172d8e8851e18042c80217e2163f1e4b3cf829f556c2936ee41f353340b05eea8225d0fc3cd412186adb9c662f36380cbca51b1ef259455ea44e1ea5467f6
|
|
7
|
+
data.tar.gz: 5069ecd19aafa80210158466d6819233b1485bc6820f4d1f259ebcdb0c067b1fafa94ab72be84210d32acbc0c510d7e8c115cb303c0e304f17d87cbeb3587233
|
|
@@ -12,9 +12,16 @@ module EasyFlow
|
|
|
12
12
|
|
|
13
13
|
helper_method :flow_start_path, :flow_routes
|
|
14
14
|
|
|
15
|
+
class_attribute :host_route_prefix, instance_accessor: false
|
|
16
|
+
|
|
17
|
+
def self.routed_by(prefix)
|
|
18
|
+
self.host_route_prefix = prefix
|
|
19
|
+
end
|
|
20
|
+
|
|
15
21
|
private
|
|
16
22
|
|
|
17
23
|
def flow_routes
|
|
24
|
+
return HostRoutes.new(main_app, self.class.host_route_prefix) if self.class.host_route_prefix
|
|
18
25
|
return easy_flow unless request.routes.equal?(EasyFlow::Engine.routes)
|
|
19
26
|
|
|
20
27
|
@flow_routes ||= ActionDispatch::Routing::RoutesProxy.new(_routes, self, _routes.url_helpers)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module EasyFlow
|
|
2
|
+
class HostRoutes
|
|
3
|
+
NAMES = %i[flow_path flow_runs_path flow_step_path run_path].freeze
|
|
4
|
+
|
|
5
|
+
def initialize(routes, prefix)
|
|
6
|
+
@routes = routes
|
|
7
|
+
@prefix = prefix
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
NAMES.each do |name|
|
|
11
|
+
define_method(name) { |*args, **options| @routes.public_send(:"#{@prefix}_#{name}", *args, **options) }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
data/lib/easy_flow/version.rb
CHANGED
data/lib/easy_flow.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: easy_flow
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- tylercschneider
|
|
@@ -137,6 +137,7 @@ files:
|
|
|
137
137
|
- lib/easy_flow.rb
|
|
138
138
|
- lib/easy_flow/engine.rb
|
|
139
139
|
- lib/easy_flow/host.rb
|
|
140
|
+
- lib/easy_flow/host_routes.rb
|
|
140
141
|
- lib/easy_flow/unset_host.rb
|
|
141
142
|
- lib/easy_flow/version.rb
|
|
142
143
|
homepage: https://github.com/DYB-Development/easy_flow
|