method_man 2.1.4 → 2.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81b47336f9cc1310f47c3c8b1bcdac7710594f81
4
- data.tar.gz: 36486a9aee423f69cb5e405a046c2ab5f31dd34e
3
+ metadata.gz: 831d183e2f5c7237beceebb557306fb9d80cc6b2
4
+ data.tar.gz: 35a28df7284c164aac634ca88d8174ff641562ab
5
5
  SHA512:
6
- metadata.gz: 0ebe52a266f21791980166006d113ea8e2fafadf26780075fed51f48996e82b8cc207d0d7e2e0b7449a4ec11b9e28138b84a101f7f930e367b6120a71a8ddddd
7
- data.tar.gz: b7470917710d58ac6002e5868ea97a824c841b248dae462afaf0b40a9acc1b7335b58121464c363dd5d1be5ede93fd7c156e1c30db3b87dcb13f41ceff8185cb
6
+ metadata.gz: d2265d8be6ed53fa75b8ec8ff49a6c6dc20d7345f33ad70aa348630fce86830c27dae1748c86efa37b4de466ca448a5f245bcc71c586735f0943ecf4ff1ffa7c
7
+ data.tar.gz: 0ca477c07b14d61ea8f201d04735792a359c6ef0870acd777ddddfec901454767db08b0c522a35b3fb705d5796a164ba108cbfdb48d80f049ff8e0038bee8087
@@ -1,5 +1,8 @@
1
1
  # Change log
2
2
 
3
+ ## 2.1.5
4
+ Fix bug where a MethodObject missing attr would raise a nil MethodObject @attributes error instead of method_missing.
5
+
3
6
  ## 2.1.4
4
7
  Fix bug with delegating to assignment methods like `foo=`.
5
8
 
@@ -19,6 +19,10 @@ class MethodObject
19
19
  attr_reader(:attributes)
20
20
 
21
21
  private(:new)
22
+
23
+ def inherited(child_class)
24
+ child_class.instance_variable_set(:@attributes, [])
25
+ end
22
26
  end
23
27
 
24
28
  def initialize(_); end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class MethodObject
4
- VERSION = '2.1.4'
4
+ VERSION = '2.1.5'
5
5
  end
@@ -16,6 +16,20 @@ RSpec.describe(MethodObject) do
16
16
  end
17
17
  end
18
18
 
19
+ describe 'calling a missing method' do
20
+ subject do
21
+ Class.new(described_class) do
22
+ def call
23
+ undefined_method
24
+ end
25
+ end
26
+ end
27
+
28
+ it 'raises method missing exception' do
29
+ expect { subject.call }.to raise_error(NameError, /undefined_method/)
30
+ end
31
+ end
32
+
19
33
  specify { expect(subject.call).to be(true) }
20
34
  end
21
35
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: method_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clay Shentrup
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2018-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 2.6.11
98
+ rubygems_version: 2.6.13
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Provides a MethodObject class which implements KentBeck's "method object"