interface 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/certs/djberg96_pub.pem +22 -17
- data/interface.gemspec +11 -2
- data/lib/interface.rb +12 -13
- data/test/test_interface.rb +2 -1
- metadata +41 -31
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 18281c8114d3b757199e7543898a927f573404884441c247621fa9c62a1b885c
|
4
|
+
data.tar.gz: ae6875d98a263ea3a9f4c307f387a4a08e2b0653598b8b0fd998c1edcc3830c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb334ed632f47adabade8d4f7ed2735d08d36e60f8429cc1b5a84b021577fb6a639df7bb553f79a9892c62d7f21f1d53df244a974464f091dae78115cbf0020e
|
7
|
+
data.tar.gz: 65256c8d37452d793ad72ce10583d96dea8a32f1a9484ab53bf049e9f99e0c376352e1996989655a195352c63cd2e33ee72791cffa3e161f3bab4fd0fadb3605
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/certs/djberg96_pub.pem
CHANGED
@@ -1,21 +1,26 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
2
|
+
MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
|
3
3
|
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
4
|
-
|
4
|
+
MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
|
5
5
|
ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVn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l03aazxxKTsVVpZD8QZxvK91OQ
|
19
|
+
h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
|
20
|
+
6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
|
21
|
+
ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
|
22
|
+
1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
|
23
|
+
DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
|
24
|
+
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
25
|
+
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
21
26
|
-----END CERTIFICATE-----
|
data/interface.gemspec
CHANGED
@@ -2,9 +2,9 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'interface'
|
5
|
-
spec.version = '1.0.
|
5
|
+
spec.version = '1.0.5'
|
6
6
|
spec.author = 'Daniel J. Berger'
|
7
|
-
spec.license = 'Artistic
|
7
|
+
spec.license = 'Artistic-2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
9
9
|
spec.homepage = 'http://github.com/djberg96/interface'
|
10
10
|
spec.summary = 'Java style interfaces for Ruby'
|
@@ -17,6 +17,15 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.add_development_dependency('test-unit')
|
18
18
|
spec.add_development_dependency('rake')
|
19
19
|
|
20
|
+
spec.metadata = {
|
21
|
+
'homepage_uri' => 'https://github.com/djberg96/interface',
|
22
|
+
'bug_tracker_uri' => 'https://github.com/djberg96/interface/issues',
|
23
|
+
'changelog_uri' => 'https://github.com/djberg96/interface/blob/master/CHANGES',
|
24
|
+
'documentation_uri' => 'https://github.com/djberg96/interface/wiki',
|
25
|
+
'source_code_uri' => 'https://github.com/djberg96/interface',
|
26
|
+
'wiki_uri' => 'https://github.com/djberg96/interface/wiki'
|
27
|
+
}
|
28
|
+
|
20
29
|
spec.description = <<-EOF
|
21
30
|
The interface library implements Java style interfaces for Ruby.
|
22
31
|
It lets you define a set a methods that must be defined in the
|
data/lib/interface.rb
CHANGED
@@ -5,15 +5,15 @@
|
|
5
5
|
#
|
6
6
|
module Interface
|
7
7
|
# The version of the interface library.
|
8
|
-
Interface::VERSION = '1.0.
|
9
|
-
|
8
|
+
Interface::VERSION = '1.0.5'.freeze
|
9
|
+
|
10
10
|
# Raised if a class or instance does not meet the interface requirements.
|
11
11
|
class MethodMissing < RuntimeError; end
|
12
12
|
|
13
13
|
alias :extends :extend
|
14
14
|
|
15
15
|
private
|
16
|
-
|
16
|
+
|
17
17
|
def extend_object(obj)
|
18
18
|
return append_features(obj) if Interface === obj
|
19
19
|
append_features(class << obj; self end)
|
@@ -34,7 +34,6 @@ module Interface
|
|
34
34
|
# Iterate over the methods, minus the unrequired methods, and raise
|
35
35
|
# an error if the method has not been defined.
|
36
36
|
(ids - @unreq).uniq.each do |id|
|
37
|
-
id = id.to_s if RUBY_VERSION.to_f < 1.9
|
38
37
|
unless mod.instance_methods(true).include?(id)
|
39
38
|
raise Interface::MethodMissing, id
|
40
39
|
end
|
@@ -44,10 +43,10 @@ module Interface
|
|
44
43
|
end
|
45
44
|
|
46
45
|
public
|
47
|
-
|
46
|
+
|
48
47
|
# Accepts an array of method names that define the interface. When this
|
49
48
|
# module is included/implemented, those method names must have already been
|
50
|
-
# defined.
|
49
|
+
# defined.
|
51
50
|
#
|
52
51
|
def required_methods(*ids)
|
53
52
|
@ids = ids
|
@@ -67,7 +66,7 @@ class Object
|
|
67
66
|
# The interface method creates an interface module which typically sets
|
68
67
|
# a list of methods that must be defined in the including class or module.
|
69
68
|
# If the methods are not defined, an Interface::MethodMissing error is raised.
|
70
|
-
#
|
69
|
+
#
|
71
70
|
# A interface can extend an existing interface as well. These are called
|
72
71
|
# sub-interfaces, and they can included the rules for their parent interface
|
73
72
|
# by simply extending it.
|
@@ -76,7 +75,7 @@ class Object
|
|
76
75
|
#
|
77
76
|
# # Require 'alpha' and 'beta' methods
|
78
77
|
# AlphaInterface = interface{
|
79
|
-
# required_methods :alpha, :beta
|
78
|
+
# required_methods :alpha, :beta
|
80
79
|
# }
|
81
80
|
#
|
82
81
|
# # A sub-interface that requires 'beta' and 'gamma' only
|
@@ -95,13 +94,13 @@ class Object
|
|
95
94
|
# end
|
96
95
|
#
|
97
96
|
def interface(&block)
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
97
|
+
Module.new do |mod|
|
98
|
+
mod.extend(Interface)
|
99
|
+
mod.instance_eval(&block)
|
100
|
+
end
|
102
101
|
end
|
103
102
|
end
|
104
|
-
|
103
|
+
|
105
104
|
class Module
|
106
105
|
alias :implements :include
|
107
106
|
end
|
data/test/test_interface.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -10,27 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
|
14
14
|
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
15
|
-
|
15
|
+
MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGp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
|
+
/3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
|
30
|
+
h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
|
31
|
+
6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
|
32
|
+
ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
|
33
|
+
1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
|
34
|
+
DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
|
35
|
+
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
|
+
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
32
37
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
38
|
+
date:
|
34
39
|
dependencies:
|
35
40
|
- !ruby/object:Gem::Dependency
|
36
41
|
name: test-unit
|
@@ -72,26 +77,32 @@ extra_rdoc_files:
|
|
72
77
|
- CHANGES
|
73
78
|
- MANIFEST
|
74
79
|
files:
|
80
|
+
- test
|
81
|
+
- test/test_interface.rb
|
82
|
+
- interface.gemspec
|
83
|
+
- CHANGES
|
84
|
+
- MANIFEST
|
85
|
+
- README
|
86
|
+
- Rakefile
|
75
87
|
- certs
|
76
88
|
- certs/djberg96_pub.pem
|
77
|
-
- CHANGES
|
78
89
|
- examples
|
79
90
|
- examples/example_instance.rb
|
80
91
|
- examples/example_interface.rb
|
81
|
-
- examples/example_sub.rb
|
82
92
|
- examples/example_unrequire.rb
|
83
|
-
-
|
93
|
+
- examples/example_sub.rb
|
84
94
|
- lib
|
85
95
|
- lib/interface.rb
|
86
|
-
- MANIFEST
|
87
|
-
- Rakefile
|
88
|
-
- README
|
89
|
-
- test
|
90
|
-
- test/test_interface.rb
|
91
96
|
homepage: http://github.com/djberg96/interface
|
92
97
|
licenses:
|
93
|
-
- Artistic
|
94
|
-
metadata:
|
98
|
+
- Artistic-2.0
|
99
|
+
metadata:
|
100
|
+
homepage_uri: https://github.com/djberg96/interface
|
101
|
+
bug_tracker_uri: https://github.com/djberg96/interface/issues
|
102
|
+
changelog_uri: https://github.com/djberg96/interface/blob/master/CHANGES
|
103
|
+
documentation_uri: https://github.com/djberg96/interface/wiki
|
104
|
+
source_code_uri: https://github.com/djberg96/interface
|
105
|
+
wiki_uri: https://github.com/djberg96/interface/wiki
|
95
106
|
post_install_message:
|
96
107
|
rdoc_options: []
|
97
108
|
require_paths:
|
@@ -107,8 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
118
|
- !ruby/object:Gem::Version
|
108
119
|
version: '0'
|
109
120
|
requirements: []
|
110
|
-
|
111
|
-
rubygems_version: 2.5.1
|
121
|
+
rubygems_version: 3.0.6
|
112
122
|
signing_key:
|
113
123
|
specification_version: 4
|
114
124
|
summary: Java style interfaces for Ruby
|
metadata.gz.sig
CHANGED
Binary file
|