command_mapper 0.1.1 → 0.1.2

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: 4db5d03aecac93251d259d3b776a33706bc328208a9fb58c4a96966d87128ed8
4
- data.tar.gz: bc67f06449dc8b0b7c5061c55a315112dcf3fab2bf548314e4f20a6b2dbdd67f
3
+ metadata.gz: 6b0bd1d63ca9619bc3d0c0bd3729e1d5a3e0de9d7291f1e92a24f0c4d7fc6e26
4
+ data.tar.gz: 3f5c08cc90eb514a75ab6333b2e76f7e9a6dd5f3ec33502e5b8c23e8d60c03ed
5
5
  SHA512:
6
- metadata.gz: 9e99f9216620e3847fc8e250d0c05d549f547396eef01a519d332cd3927cd86c71ed26e862fda84f26f28570e180f76eb1fb9117729a737bcf718de33f2d0886
7
- data.tar.gz: a3766529ada1866b7736e905d3ba65511eea1b2e9679b9edad99e57089285159a307beb726ee7b1f2f2c02e6eb6d34d569d86babb3f79dc3be54527e834fbacd
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 || raise(NotImplementedError,"#{self} did not call command(...)")
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
  #
@@ -1,4 +1,4 @@
1
1
  module CommandMapper
2
2
  # Version of command_mapper
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: command_mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern