evt-virtual 2.0.1.0 → 2.0.1.1

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: 6604fbbc5a3575af514afd40a1d264b0100a0029f46280ea9aa3752b73c07846
4
- data.tar.gz: eafa8a2a5f51a38c43813e23f854f4fd7502c321335a6c33b5b9ce9f81babaa0
3
+ metadata.gz: 77009d87640947d151dfd5c65e459ed3667500e559a83778fc920f4bdafe8839
4
+ data.tar.gz: 305cc7ef41d8a11cb8c6514a758f9f7ec0709bc17ed18684fe41c9cbe8e35bf4
5
5
  SHA512:
6
- metadata.gz: 30612374cc27801d1df7db1993c72d03342de3ca5b5d88ef00fee6d767a285432f2931fc9a510528a7c23a1b634f6ff8aeef13ef8f8d72264c5b54eedf4201a3
7
- data.tar.gz: 75d13092d7c771c9d33dd0213f1bb11e71a3acc2e602e043c0c547cc67642581b18ba289a446b5c25ff6d8bf6f85b972f7946cb0969688b87dc1b11195e06b2c
6
+ metadata.gz: 7897f71409ddb3d7f060b7724fec7b9fdc385dec5a46df1b5967828996d509e192a64f98666825bbd8ee48fe519cde37e95a221911253f34c736540b28a22e17
7
+ data.tar.gz: d3a750b8af5472a55accc1f0095a46c1ee596f65aa5554ee9f55dcf2dec16d3f5142b299eeecec4e747db8c9e88fb0fc2eebe34d3b5256168087700ee9928ac2
data/lib/virtual/macro.rb CHANGED
@@ -10,5 +10,10 @@ module Virtual
10
10
  end
11
11
  alias :pure_virtual :pure_macro
12
12
  alias :abstract :pure_macro
13
+
14
+ def protocol_macro(method_name)
15
+ Virtual::ProtocolMethod.define self, method_name
16
+ end
17
+ alias :protocol :protocol_macro
13
18
  end
14
19
  end
@@ -0,0 +1,19 @@
1
+ module Virtual
2
+ module ProtocolMethod
3
+ class Error < RuntimeError
4
+ def initialize(message)
5
+ super("Pure virtual (abstract) protocol method #{message} must be implemented")
6
+ end
7
+ end
8
+
9
+ def self.define(target_class, method_name)
10
+ already_defined = target_class.instance_methods(true).include?(method_name)
11
+
12
+ if not already_defined
13
+ target_class.send :define_method, method_name do |*args|
14
+ raise Error, "\"#{method_name}\" of #{self.class.name}"
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -8,7 +8,7 @@ module Virtual
8
8
 
9
9
  def self.define(target_class, method_name)
10
10
  target_class.send :define_method, method_name do |*args|
11
- raise Error, "\"#{method_name}\" of #{target_class.name}"
11
+ raise Error, "\"#{method_name}\" of #{self.class.name}"
12
12
  end
13
13
  end
14
14
  end
data/lib/virtual.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'virtual/method'
2
2
  require 'virtual/pure_method'
3
+ require 'virtual/protocol_method'
3
4
  require 'virtual/macro'
4
5
  require 'virtual/activate'
5
6
  require 'virtual/virtual'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-virtual
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1.0
4
+ version: 2.0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-10 00:00:00.000000000 Z
11
+ date: 2023-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test_bench
@@ -41,13 +41,14 @@ files:
41
41
  - lib/virtual/controls/virtual_method.rb
42
42
  - lib/virtual/macro.rb
43
43
  - lib/virtual/method.rb
44
+ - lib/virtual/protocol_method.rb
44
45
  - lib/virtual/pure_method.rb
45
46
  - lib/virtual/virtual.rb
46
47
  homepage: https://github.com/eventide-project/virtual
47
48
  licenses:
48
49
  - MIT
49
50
  metadata: {}
50
- post_install_message:
51
+ post_install_message:
51
52
  rdoc_options: []
52
53
  require_paths:
53
54
  - lib
@@ -62,8 +63,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
63
  - !ruby/object:Gem::Version
63
64
  version: '0'
64
65
  requirements: []
65
- rubygems_version: 3.0.1
66
- signing_key:
66
+ rubygems_version: 3.3.3
67
+ signing_key:
67
68
  specification_version: 4
68
69
  summary: Virtual method declaration
69
70
  test_files: []