spaced 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +14 -11
- data/README.md +2 -2
- data/fixtures/user.rb +0 -9
- data/lib/spaced/version.rb +1 -1
- data/lib/spaced.rb +0 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17355ae1e24bb61da083670a4aad50adb43741ea7377e7e24962a62682e08b60
|
4
|
+
data.tar.gz: 76b84092099827aa147e9721cae029bd65bdebbdc5237e75c338e70b4a0d3378
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f96f78165b425b1643878a39929bfbd7d8baf8a5217539068c3a45231b6e3b3cd979720eed19ef7f4e9a7a46fd7c77872471d6ed9999fb174f3ae41cfe0df3c6
|
7
|
+
data.tar.gz: cdf6a7824daf41d205fdc8c41c6ce7f040ce7194eda90885421e0c6a7859a5f97ea379cc9b2aa21a35f87b00cdf3b73067375fd6931eb7c84da3485531236e57
|
data/Gemfile.lock
CHANGED
@@ -1,36 +1,39 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
spaced (0.
|
4
|
+
spaced (0.7.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.2)
|
10
|
-
json (2.
|
11
|
-
language_server-protocol (3.17.0.
|
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.
|
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.
|
20
|
+
rubocop (1.72.1)
|
20
21
|
json (~> 2.3)
|
21
|
-
language_server-protocol (
|
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.
|
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.
|
31
|
+
rubocop-ast (1.38.0)
|
30
32
|
parser (>= 3.3.1.0)
|
31
|
-
rubocop-minitest (0.
|
32
|
-
|
33
|
-
rubocop
|
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 `#_!`
|
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 `#
|
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
data/lib/spaced/version.rb
CHANGED
data/lib/spaced.rb
CHANGED
@@ -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.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Moss
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
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.
|
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
|