attr_extras 6.2.2 → 6.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/attr_extras/attr_implement.rb +1 -1
- data/lib/attr_extras/version.rb +1 -1
- data/spec/attr_extras/attr_implement_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8de2d9f5a942529a96ff782dae5d6cc8ed15136ca0a8b9a5bdab353a96b58ed1
|
4
|
+
data.tar.gz: 1b12b6151ac7c28bc78ab6637a7fe25c12842079dcea32075fba8a2176c6bd13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c953ecbac9eadca7fc324a37af2360de9d9d6740b3ed28f3fa2c76cb45a44479e7d0d05f77c2087451167759e42a87b7d414cab19ad5ac3c72f077d797fdffcf
|
7
|
+
data.tar.gz: 36723de91da1c0e754a5c20ee76238d23944f1cc15789fd5482ccccfa8798cf3cbd679d381c81932ae8427fe6e4e7ff05ebe00496cd36c32f2c0c8e1fa86dd30
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
# 6.2.3
|
4
|
+
|
5
|
+
- `attr_implement` error says "an 'ear()' method" instead of "a 'ear()' method", when the method starts with a likely vowel.
|
6
|
+
|
3
7
|
# 6.2.2
|
4
8
|
|
5
9
|
- Fix warnings with Ruby 2.7. Thanks to [Juanito Fatas](https://github.com/barsoom/attr_extras/pull/31)!
|
@@ -19,7 +19,7 @@ class AttrExtras::AttrImplement
|
|
19
19
|
raise ArgumentError, "wrong number of arguments (#{provided_arity} for #{expected_arity})"
|
20
20
|
end
|
21
21
|
|
22
|
-
raise AttrExtras::MethodNotImplementedError, "Implement a '#{name}(#{arg_names.join(", ")})' method"
|
22
|
+
raise AttrExtras::MethodNotImplementedError, "Implement a#{"n" if name[0].match?(/\A[aeiou]/i)} '#{name}(#{arg_names.join(", ")})' method"
|
23
23
|
else
|
24
24
|
super(name, *args)
|
25
25
|
end
|
data/lib/attr_extras/version.rb
CHANGED
@@ -65,6 +65,16 @@ describe Object, ".attr_implement" do
|
|
65
65
|
|
66
66
|
_(lambda { klass.new.some_other_method }).must_raise NoMethodError
|
67
67
|
end
|
68
|
+
|
69
|
+
it "says 'an' if followed by a vowel" do
|
70
|
+
klass = Class.new do
|
71
|
+
attr_implement :ear
|
72
|
+
end
|
73
|
+
|
74
|
+
example = klass.new
|
75
|
+
exception = _(lambda { example.ear }).must_raise AttrExtras::MethodNotImplementedError
|
76
|
+
_(exception.message).must_equal "Implement an 'ear()' method"
|
77
|
+
end
|
68
78
|
end
|
69
79
|
|
70
80
|
describe Object, ".cattr_implement" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attr_extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.
|
4
|
+
version: 6.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrik Nyh
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2020-01-
|
15
|
+
date: 2020-01-25 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: minitest
|