spaced 0.6.0 → 0.8.0

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
  SHA256:
3
- metadata.gz: de61b3e87ec85ff4891a034a0d75fd51c3f9cf2e2084ecd5ad6da538d2c05c5a
4
- data.tar.gz: e7a182e85a619b15576208934038428fa6f5faf46b0fa7ab0352753db0ba8cc0
3
+ metadata.gz: a5ef69eb8f535a9dc505eaeecae109a756337df1a64d602bc0d9ede0f06714eb
4
+ data.tar.gz: a8731824808507cadc9a1362a004870919ab5e51be233439fe3fe4d77aeb1a89
5
5
  SHA512:
6
- metadata.gz: c39cd159a4d8ab8ceba3e0166ff894ad9a64d1224109330df87a71efe1326f5ba1af7feaeb82d41306d0e4ee21ee43e3e9ffbbec2c0aad1b48191afb9060dac3
7
- data.tar.gz: '025450092956b818c9e5f703b47aa27652937a584d8ad9c6bf0a31bd507c811256ceca4b92d8ebecb73dd78eabcff45b5c4274a2da8a40c4c7228797fcce117c'
6
+ metadata.gz: cfdc46fedd7c789836c16849e9fc58372f765f1d5e78c60640ca3d8c0b24b2da2a3fc7080fc0ce0a060f3826d9e2e46688781c53ce7120836cb24595eab6436d
7
+ data.tar.gz: ffd8dcd6d1214381a0aecee9df96eeb65ffd099b216d19118ea0b1ef3e5576020f54995bdc317e75704a24871209cc7ed60cc154b7598d2d2ba4fcc366d0deed
data/Gemfile.lock CHANGED
@@ -1,36 +1,39 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spaced (0.6.0)
4
+ spaced (0.8.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.2)
10
- json (2.9.1)
11
- language_server-protocol (3.17.0.3)
10
+ json (2.10.1)
11
+ language_server-protocol (3.17.0.4)
12
+ lint_roller (1.1.0)
12
13
  parallel (1.26.3)
13
- parser (3.3.6.0)
14
+ parser (3.3.7.1)
14
15
  ast (~> 2.4.1)
15
16
  racc
16
17
  racc (1.8.1)
17
18
  rainbow (3.1.1)
18
19
  regexp_parser (2.10.0)
19
- rubocop (1.70.0)
20
+ rubocop (1.72.1)
20
21
  json (~> 2.3)
21
- language_server-protocol (>= 3.17.0)
22
+ language_server-protocol (~> 3.17.0.2)
23
+ lint_roller (~> 1.1.0)
22
24
  parallel (~> 1.10)
23
25
  parser (>= 3.3.0.2)
24
26
  rainbow (>= 2.2.2, < 4.0)
25
27
  regexp_parser (>= 2.9.3, < 3.0)
26
- rubocop-ast (>= 1.36.2, < 2.0)
28
+ rubocop-ast (>= 1.38.0, < 2.0)
27
29
  ruby-progressbar (~> 1.7)
28
30
  unicode-display_width (>= 2.4.0, < 4.0)
29
- rubocop-ast (1.37.0)
31
+ rubocop-ast (1.38.0)
30
32
  parser (>= 3.3.1.0)
31
- rubocop-minitest (0.36.0)
32
- rubocop (>= 1.61, < 2.0)
33
- rubocop-ast (>= 1.31.1, < 2.0)
33
+ rubocop-minitest (0.37.1)
34
+ lint_roller (~> 1.1)
35
+ rubocop (>= 1.72.1, < 2.0)
36
+ rubocop-ast (>= 1.38.0, < 2.0)
34
37
  ruby-progressbar (1.13.0)
35
38
  sus (0.32.0)
36
39
  unicode-display_width (3.1.4)
data/README.md CHANGED
@@ -38,7 +38,7 @@ In the example above, `namespace` creates and initializes a new class `Twitter`
38
38
 
39
39
  ## Magic bang and predicate methods
40
40
 
41
- If you define a `#_!` or `#call` method in your namespaced class, you can then conveniently call that with a bang method:
41
+ If you define a `#_!` method in your namespaced class, you can then conveniently call that with a bang method:
42
42
 
43
43
  ```ruby
44
44
  class User
@@ -64,7 +64,7 @@ namespace :tweet do
64
64
  end
65
65
  end
66
66
  user = User.new
67
- user.tweet? # Will call the `#predicate` method.
67
+ user.tweet? # Will call the `#_?` method.
68
68
  ```
69
69
 
70
70
  Both bang and predicate methods can be defined using identically named methods:
data/fixtures/user.rb CHANGED
@@ -10,15 +10,6 @@ class User
10
10
  end
11
11
 
12
12
  namespace :dad, Daddy
13
- namespace :brother do
14
- def call(append = nil)
15
- "Andy Moss#{append}"
16
- end
17
-
18
- def predicate
19
- true
20
- end
21
- end
22
13
 
23
14
  namespace :sister do
24
15
  def sister!(append = nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spaced
4
- VERSION = "0.6.0"
4
+ VERSION = "0.8.0"
5
5
  end
data/lib/spaced.rb CHANGED
@@ -38,7 +38,7 @@ module Spaced
38
38
  end
39
39
 
40
40
  # Define the bang and predicate methods.
41
- methods = klass.instance_methods(false)
41
+ methods = klass.public_instance_methods
42
42
 
43
43
  if methods.include?(:_!)
44
44
  module_eval <<-RUBY, __FILE__, __LINE__ + 1
@@ -48,10 +48,6 @@ module Spaced
48
48
  module_eval <<-RUBY, __FILE__, __LINE__ + 1
49
49
  def #{name}!(...); #{name}.#{name}!(...); end # def user!; user.user!; end
50
50
  RUBY
51
- elsif methods.include?(:call) # DEPRECATED
52
- module_eval <<-RUBY, __FILE__, __LINE__ + 1
53
- def #{name}!(...); #{name}.call(...); end # def user!(...); user.call(...); end
54
- RUBY
55
51
  else
56
52
  define_method :"#{name}!" do
57
53
  raise NoMethodError,
@@ -67,10 +63,6 @@ module Spaced
67
63
  module_eval <<-RUBY, __FILE__, __LINE__ + 1
68
64
  def #{name}?(...); #{name}.#{name}?(...); end # def user?; user.user?; end
69
65
  RUBY
70
- elsif methods.include?(:predicate) # DEPRECATED
71
- module_eval <<-RUBY, __FILE__, __LINE__ + 1
72
- def #{name}?(...); #{name}.predicate(...); end # def user?; user.predicate; end
73
- RUBY
74
66
  else
75
67
  define_method :"#{name}?" do
76
68
  raise NoMethodError,
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaced
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-15 00:00:00.000000000 Z
10
+ date: 2025-02-17 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  email:
13
13
  - joel@developwithstyle.com
@@ -49,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
51
  requirements: []
52
- rubygems_version: 3.6.2
52
+ rubygems_version: 3.6.3
53
53
  specification_version: 4
54
54
  summary: Super simple and convenient way to isolate and namespace a collection of
55
55
  related methods