kangaru 0.2.2 → 0.2.4

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: 9007bb0fb5d483fe6fb13697b94ec895958b93c5db157e82e4e7178e04278137
4
- data.tar.gz: ff23e3595c129e04ae6391269570060929ecc73409d3e024eef14374c7d5957e
3
+ metadata.gz: d272072193ecc198445e6c2684a48a6386b378d1b4b95e274bee330b4e8ab1a1
4
+ data.tar.gz: ce1f9cfc0df31304f232b97da67ee56ff3fadb1c83a495349d2dee4695693faf
5
5
  SHA512:
6
- metadata.gz: c3eb823da88e761346f49eff461333b79fe63768eb5093be6b6842e911eb9a4feab588755c7bceed9fc16d74118cc25cadf715b7f7dea829b47441c48843b86a
7
- data.tar.gz: b1e203b218b378f571568e2730cd199ff8bc785929ec7eb1d8f42de3b34ce1f486fff4323607d95593bf7e2ae000db0b26a0eb0d6cd8d198464e122073b581b9
6
+ metadata.gz: 4487dc810856ee4c778ff257b77adda26ee453233fab85174997142e5215764d20e7112eb812f5232dc1821c4053ea95554cecccbec45d3d12ace87e5c042f9a
7
+ data.tar.gz: e14a8ee5a1dcb2b389d00b5e03c4cfed4d047a723fe70da001d40312d6054ede636847680d335863458209ba6623b21a35c016a5a303ea6a3f7969eb65110790
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kangaru (0.2.2)
4
+ kangaru (0.2.4)
5
5
  colorize (~> 1.1)
6
6
  erb (~> 4.0)
7
7
  sequel (~> 5.72)
@@ -27,6 +27,10 @@ module Kangaru
27
27
 
28
28
  def_delegators :request, :params
29
29
 
30
+ def target_id
31
+ request.id
32
+ end
33
+
30
34
  private
31
35
 
32
36
  def view_path(file)
@@ -62,7 +62,7 @@ module Kangaru
62
62
 
63
63
  config.include RequestHelper, type: :request
64
64
 
65
- config.around(type: :request) do |spec|
65
+ config.around(stub_output: true) do |spec|
66
66
  stub_output { spec.run }
67
67
  end
68
68
  end
@@ -2,6 +2,8 @@ module Kangaru
2
2
  class Request
3
3
  using Patches::Inflections
4
4
 
5
+ extend Forwardable
6
+
5
7
  include Configurable
6
8
 
7
9
  DEFAULT_CONTROLLER = "DefaultController".freeze
@@ -25,6 +27,8 @@ module Kangaru
25
27
  path_parser.action || DEFAULT_ACTION
26
28
  end
27
29
 
30
+ def_delegators :path_parser, :id
31
+
28
32
  private
29
33
 
30
34
  def path_parser
@@ -21,7 +21,7 @@ module Kangaru
21
21
  private
22
22
 
23
23
  def controller_class
24
- @controller_class ||= request.controller.constantise(root: namespace)
24
+ request.controller.constantise(root: namespace)
25
25
  end
26
26
 
27
27
  def validate_controller_defined!
@@ -1,3 +1,3 @@
1
1
  module Kangaru
2
- VERSION = "0.2.2".freeze
2
+ VERSION = "0.2.4".freeze
3
3
  end
@@ -13,6 +13,8 @@ module Kangaru
13
13
  def self.path: -> String
14
14
 
15
15
  def params: -> Hash[Symbol, untyped]
16
+
17
+ def target_id: -> Integer?
16
18
 
17
19
  private
18
20
 
@@ -1,5 +1,7 @@
1
1
  module Kangaru
2
2
  class Request
3
+ extend Forwardable
4
+
3
5
  include Configurable
4
6
 
5
7
  DEFAULT_CONTROLLER: String
@@ -15,6 +17,8 @@ module Kangaru
15
17
 
16
18
  def action: -> Symbol
17
19
 
20
+ def id: -> Integer?
21
+
18
22
  private
19
23
 
20
24
  attr_reader path_parser: PathParser
@@ -11,12 +11,6 @@ module Kangaru
11
11
 
12
12
  private
13
13
 
14
- @controller_class: untyped
15
-
16
- # Delegated to command
17
- def controller_name: -> String
18
- def action: -> Symbol
19
-
20
14
  def controller_class: -> untyped
21
15
 
22
16
  def validate_controller_defined!: -> void
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kangaru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Welham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-20 00:00:00.000000000 Z
11
+ date: 2023-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize