command_mapper 0.1.1 → 0.1.2
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 +6 -0
- data/lib/command_mapper/command.rb +5 -1
- data/lib/command_mapper/version.rb +1 -1
- data/spec/commnad_spec.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b0bd1d63ca9619bc3d0c0bd3729e1d5a3e0de9d7291f1e92a24f0c4d7fc6e26
|
4
|
+
data.tar.gz: 3f5c08cc90eb514a75ab6333b2e76f7e9a6dd5f3ec33502e5b8c23e8d60c03ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b42311e2b1453ce2c2295ad1cf3e893a205239287dff21566240a721ac45fd9dc16332c34eb8e9beca88053655d88f0d265e8c4a767a58f803f38e318d263e98
|
7
|
+
data.tar.gz: 7981d9e48540297c7282cef7800015933d1fa5820ac0378bc71faa36adec6a4f321160beb8a10d5e7b9a5b860235a6d8407001f9bfc6935ac31d03802bf1f7d1
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
### 0.1.2 / 2021-11-29
|
2
|
+
|
3
|
+
* Fixed a bug where {CommandMapper::Command.command_name} was not checking the
|
4
|
+
superclass for the {CommandMapper::Command.command_name command_name}, if no
|
5
|
+
`command "..."` was defined in the subclass.
|
6
|
+
|
1
7
|
### 0.1.1 / 2021-11-29
|
2
8
|
|
3
9
|
* Fixed a bug where {CommandMapper::Types::Num}, {CommandMapper::Types::Hex},
|
@@ -181,7 +181,11 @@ module CommandMapper
|
|
181
181
|
# @api semipublic
|
182
182
|
#
|
183
183
|
def self.command_name
|
184
|
-
@command_name ||
|
184
|
+
@command_name || if superclass < Command
|
185
|
+
superclass.command_name
|
186
|
+
else
|
187
|
+
raise(NotImplementedError,"#{self} did not call command(...)")
|
188
|
+
end
|
185
189
|
end
|
186
190
|
|
187
191
|
#
|
data/spec/commnad_spec.rb
CHANGED
@@ -7,6 +7,9 @@ describe CommandMapper::Command do
|
|
7
7
|
command 'foo'
|
8
8
|
end
|
9
9
|
|
10
|
+
class InheritedCommandName < WithCommandName
|
11
|
+
end
|
12
|
+
|
10
13
|
class NoCommandName < CommandMapper::Command
|
11
14
|
end
|
12
15
|
end
|
@@ -51,6 +54,14 @@ describe CommandMapper::Command do
|
|
51
54
|
expect(subject.command_name).to eq('foo')
|
52
55
|
end
|
53
56
|
end
|
57
|
+
|
58
|
+
context "when the command class inherits from another command class" do
|
59
|
+
let(:command_class) { TestCommand::InheritedCommandName }
|
60
|
+
|
61
|
+
it "must check the superclass" do
|
62
|
+
expect(subject.command_name).to eq("foo")
|
63
|
+
end
|
64
|
+
end
|
54
65
|
end
|
55
66
|
|
56
67
|
module TestCommand
|