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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7c9585ff116624818d3e214ab04680b4bf889a4e
4
- data.tar.gz: c276dc7377fa328bb50839d87b51caf25244cd5d
2
+ SHA256:
3
+ metadata.gz: 18281c8114d3b757199e7543898a927f573404884441c247621fa9c62a1b885c
4
+ data.tar.gz: ae6875d98a263ea3a9f4c307f387a4a08e2b0653598b8b0fd998c1edcc3830c5
5
5
  SHA512:
6
- metadata.gz: 4471b766737bb65e49f1b983868c27007800fdbadcb477f49cbaa2b47d844252afdd8825c25660f8b5ff8f8efb8a024c468fcb1fcc954e781da00c6de8e8a788
7
- data.tar.gz: 160bff131b6fd68970688960b6e77c8af431a219adaf43e6432194fa207d0fae1a4a9624ded57252d38c8b50dd5720c29c115af866c91b39d4a64e435f8759e6
6
+ metadata.gz: fb334ed632f47adabade8d4f7ed2735d08d36e60f8429cc1b5a84b021577fb6a639df7bb553f79a9892c62d7f21f1d53df244a974464f091dae78115cbf0020e
7
+ data.tar.gz: 65256c8d37452d793ad72ce10583d96dea8a32f1a9484ab53bf049e9f99e0c376352e1996989655a195352c63cd2e33ee72791cffa3e161f3bab4fd0fadb3605
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,21 +1,26 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
2
+ MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
3
3
  cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
- MB4XDTE1MDkwMjIwNDkxOFoXDTE2MDkwMTIwNDkxOFowPzERMA8GA1UEAwwIZGpi
4
+ MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN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FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
22
+ 1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
23
+ DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
24
+ ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
25
+ WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
21
26
  -----END CERTIFICATE-----
@@ -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.4'
5
+ spec.version = '1.0.5'
6
6
  spec.author = 'Daniel J. Berger'
7
- spec.license = 'Artistic 2.0'
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
@@ -5,15 +5,15 @@
5
5
  #
6
6
  module Interface
7
7
  # The version of the interface library.
8
- Interface::VERSION = '1.0.4'
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
- mod = Module.new
99
- mod.extend(Interface)
100
- mod.instance_eval(&block)
101
- mod
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
@@ -40,7 +40,8 @@ class TC_Interface < Test::Unit::TestCase
40
40
  end
41
41
 
42
42
  def test_version
43
- assert_equal('1.0.4', Interface::VERSION)
43
+ assert_equal('1.0.5', Interface::VERSION)
44
+ assert_true(Interface::VERSION.frozen?)
44
45
  end
45
46
 
46
47
  def test_interface_requirements_not_met
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
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
- MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
13
+ MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
14
14
  cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
15
- MB4XDTE1MDkwMjIwNDkxOFoXDTE2MDkwMTIwNDkxOFowPzERMA8GA1UEAwwIZGpi
15
+ MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
16
16
  ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
17
- bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyTkvXqRp6hLs9eoJOS
18
- Hmi8kRYbq9Vkf15/hMxJpotYMgJVHHWrmDcC5Dye2PbnXjTkKf266Zw0PtT9h+lI
19
- S3ts9HO+vaCFSMwFFZmnWJSpQ3CNw2RcHxjWkk9yF7imEM8Kz9ojhiDXzBetdV6M
20
- gr0lV/alUr7TNVBDngbXEfTWscyXh1qd7xZ4EcOdsDktCe5G45N/o3662tPQvJsi
21
- FOF0CM/KuBsa/HL1/eoEmF4B3EKI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YxZSNtIiyd9etI0X3
23
+ ctu0uhrFyrMZXCedutvXNjUolD5r9KGBFSWH1R9u2I3n3SAyFF2yzv/7idQHLJJq
24
+ 74BMnx0FIq6fCpu5slAipvxZ3ZkZpEXZFr3cIBtO1gFvQWW7E/Y3ijliWJS1GQFq
25
+ 058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
26
+ HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
27
+ AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
28
+ YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
29
+ /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: 2016-01-08 00:00:00.000000000 Z
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
- - interface.gemspec
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 2.0
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
- rubyforge_project:
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