direction 2.0.0 → 2.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47a9e819539f9cf4a771f373c301a8c87e54aaa187b958d44e862f531a55e760
4
- data.tar.gz: 1c7ae5a125f83031c30977f892ba52eeeeec14a7adba1f8d932db051b14b643e
3
+ metadata.gz: a1dd9467a78ea30e93fb39f7df8389994c33103517577e9553d619b7f3d2a2ef
4
+ data.tar.gz: 216f31d4923ec3a6af3d469c1b5ef439b970db6c6dfa289eb483c28b87f641f4
5
5
  SHA512:
6
- metadata.gz: 8ea409e148817c51a47e69af81b1cb29ff9fa3a4bca52e441ad81ad5f8390295cd9b76671abd7a4099785e55698f2d0e02219fe30684fe318112604c4035aa36
7
- data.tar.gz: a8ea1f8065e5a46e9307cfd1dc971a1cf4fd949bc76896c2f1ea81f9732240f7f106fb7d5389491ac8d4fc99699295447249192ca2ec00e21dbd354c749414f4
6
+ metadata.gz: f2820ad39c03008dddc5339f92ee19bf59ba11dff58183e6a7bb50ba7727013b0e356e72afaf3b66f990776cd7f5bd4c313ce1384f13f0f5f73e25eebe5afe3a
7
+ data.tar.gz: 5e555c9fab8b3d279abaa29d9997935ccbb0620d804923fec8384393522c2db062d9f2ceb2399867e2395c26c7b622e0db792c61a85769bb19626d2a0a667716
data/CHANGELOG.md CHANGED
@@ -5,8 +5,9 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
- ## [] -
8
+ ## [2.0.1] - 2026-06-24
9
9
 
10
- ###
10
+ ### Fixed
11
11
 
12
- - [2.0.0]
12
+ - command supports bang, predicate, setter, and operator method names (956cd57)
13
+ - require forwardable so extending Direction works without a prior require (956cd57)
@@ -1,3 +1,3 @@
1
1
  module Direction
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
data/lib/direction.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require "forwardable"
1
2
  require "direction/version"
2
3
  # Provide a feature like the Forwardable library,
3
4
  # but set the return value to self.
@@ -29,12 +30,14 @@ module Direction
29
30
  end
30
31
 
31
32
  # Create an individual command with an optional alias
33
+ #
34
+ # Defines the forwarding method directly rather than via Forwardable so
35
+ # that method names which aren't plain identifiers -- bang (reload!),
36
+ # predicate (ready?), setter (value=) or operator methods -- are supported.
32
37
  def def_command accessor, method_name, aliased_method_name = method_name
33
- result_name = "#{aliased_method_name}_result"
34
- def_delegator accessor, method_name, result_name
35
- private result_name
36
38
  define_method aliased_method_name do |*args, **kwargs, &block|
37
- send(result_name, *args, **kwargs, &block)
39
+ receiver = accessor.to_s.start_with?("@") ? instance_variable_get(accessor) : __send__(accessor)
40
+ receiver.__send__(method_name, *args, **kwargs, &block)
38
41
  self
39
42
  end
40
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: direction
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "'Jim Gay'"
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
- rubygems_version: 3.7.2
46
+ rubygems_version: 4.0.10
47
47
  specification_version: 4
48
48
  summary: Forward messages to collaborators in East-oriented style.
49
49
  test_files: []