expand 1.0.5 → 1.0.6
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +12 -0
- data/lib/expand/version.rb +1 -1
- data/lib/expand.rb +2 -2
- 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: 2f6ea4357fdc4411d7c50e3254b7dafc2fa805a5dabdcee9797c371e1a0c3061
|
4
|
+
data.tar.gz: cda6a8448977b174723223ad38dd9af7709d2ff6d20f2fb5d6ec5a90dbd8203a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d2d514212cd0907017e548a3726e2f8a2bab2fbaee0f60c537762ed1592fca4b70167bc39b34b00abd6674d100e9040ab39253aa4aec21a87137318a6f18466
|
7
|
+
data.tar.gz: 8b99003304539699643196d8108ec7023fe544a6a271442fe832d0547f9972cfc8e0e67d5a76cbf6f1a4d5e8df4e8b10401c2e18eb0ad3fa513f9902b7599829
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -63,6 +63,18 @@ namespace SomeGem::Thing do
|
|
63
63
|
end
|
64
64
|
```
|
65
65
|
|
66
|
+
## Gotchas
|
67
|
+
|
68
|
+
Unfortunately, due to the scoping of the blocks passed to the main `namespace` or `expand` methods, you are unable to directly reference classes nested in your namespace.
|
69
|
+
|
70
|
+
You can, however, pass an argument to the block to use as a reference:
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
namespace SomeGem::Thing do |klass|
|
74
|
+
puts klass #=> yields "SomeGem::Thing"
|
75
|
+
end
|
76
|
+
```
|
77
|
+
|
66
78
|
## Installation
|
67
79
|
|
68
80
|
Add this line to your application's Gemfile:
|
data/lib/expand/version.rb
CHANGED
data/lib/expand.rb
CHANGED
@@ -7,7 +7,7 @@ module Expand
|
|
7
7
|
#
|
8
8
|
class Manager
|
9
9
|
# @see Expand#namespace
|
10
|
-
def initialize(namespace
|
10
|
+
def initialize(namespace)
|
11
11
|
@managed = namespace
|
12
12
|
end
|
13
13
|
|
@@ -49,7 +49,7 @@ module Expand
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def apply(&block)
|
52
|
-
|
52
|
+
instance_exec(@managed, &block)
|
53
53
|
@managed
|
54
54
|
end
|
55
55
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: expand
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Gay
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Create classes and modules under an existing namespace
|
14
14
|
email:
|