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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e27f369dd7727be720fe63c6a7db149bc1e5bcd3693574b6bbbfdf1c7eefe064
4
- data.tar.gz: f2fbb6354c8ac8f721b3d30bdf7525ef7f86082d5a8bd79093ee22321438a3fe
3
+ metadata.gz: 8de2d9f5a942529a96ff782dae5d6cc8ed15136ca0a8b9a5bdab353a96b58ed1
4
+ data.tar.gz: 1b12b6151ac7c28bc78ab6637a7fe25c12842079dcea32075fba8a2176c6bd13
5
5
  SHA512:
6
- metadata.gz: 15a68ad4827938ea50abb75c036656bc39ca542eefbfca243a07d6ec3452d64e6732a99369dc0accc66c7dfb458176a1608b024e1c0206b56eb99e5ab842d06e
7
- data.tar.gz: 6e62cca9b82e3fbb6360b6453dcd738165cb5a9d69e530a341dfa2d1c36a8b716f733b1449727753c9faebdc3fea503520a25571356767a8b4492c98744a8235
6
+ metadata.gz: c953ecbac9eadca7fc324a37af2360de9d9d6740b3ed28f3fa2c76cb45a44479e7d0d05f77c2087451167759e42a87b7d414cab19ad5ac3c72f077d797fdffcf
7
+ data.tar.gz: 36723de91da1c0e754a5c20ee76238d23944f1cc15789fd5482ccccfa8798cf3cbd679d381c81932ae8427fe6e4e7ff05ebe00496cd36c32f2c0c8e1fa86dd30
@@ -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
@@ -1,3 +1,3 @@
1
1
  module AttrExtras
2
- VERSION = "6.2.2"
2
+ VERSION = "6.2.3"
3
3
  end
@@ -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.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-07 00:00:00.000000000 Z
15
+ date: 2020-01-25 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: minitest