attr_bool 0.3.0 → 0.3.1

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: 427185e002ab3a1eea72403d4b91428dca1d981049fc9b79abd2b445add682b7
4
- data.tar.gz: 71328c73417dcdff6c82600d46bc15347c9aa5ca65ea73f4310d4d6b55518a9b
3
+ metadata.gz: c8c2838e4127813ba45ee36511d2ab27acbf336a7023dcfa88035b71164d9b01
4
+ data.tar.gz: 2d0af46054521a4fa83ae3d0aea20fd84bdb6da19b9a151087a81af34d2706f5
5
5
  SHA512:
6
- metadata.gz: 4bfaabe00faf88460c364ff76a978eb8adbfc2cd40d481bdb05cab9d8eb565c2634a796042af6bc08d5e3b4b16744140c4d9f8dfce3da14780cf8e0ed43eb857
7
- data.tar.gz: eb3fadb07b363bba497d12b05d112c762d1b44c66c99c6bd5b0decb0374044f2cd92055116c18f2508111c6f0ffa243a526bf6c64695992c36563e26aa3bf462
6
+ metadata.gz: 60d3d316e83c791256b8125742ef6e741452cf7a5de29b6162417629b1377f5358704b7fc7dfc1985fed20450e31d00a2797bddb81216110794691989080d2a6
7
+ data.tar.gz: 2ece3c6ecd679140f9f67c5087e653e960e74aa9651f3c98368cfb66a36a096ff2513c863f988e2f87d55e211c277f9682c591b95188909e4e4f858034b76423
data/README.md CHANGED
@@ -40,15 +40,14 @@ Features:
40
40
  - Can use multiple symbols and/or strings.
41
41
  - Can force bool values.
42
42
  - Can define custom logic with a block/proc.
43
- - Returns an array of the new method names, just like the core `attr` methods, to allow DSL chaining.
43
+ - Can do DSL chaining, just like the core `attr` methods that return an array of the new method names.
44
44
  - Can use refinements (`using AttrBool::Ref`) instead of `extend`.
45
- - This allows you to refine the top module only of your project, instead of having to extend every class.
46
45
  - Fails fast if an instance variable name is invalid (if you don't use a block/proc).
47
46
 
48
47
  Anti-features:
49
48
  - No default values.
50
49
  - Initialize your instance variables in `def initialize` like normal.
51
- - Using default values has performance issues and other drawbacks, so better to just match the core `attr` methods.
50
+ - Using default values has performance/memory issues and other drawbacks, so better to just match the core `attr` methods.
52
51
  - Uses inner `AttrBool::Ext` & `AttrBool::Ref` instead of `AttrBool`.
53
52
  - Some gems use the `extend AttrBool` (top module) pattern, but this includes `VERSION` in all of your classes/modules.
54
53
  - Doesn't monkey-patch the core class/module by default.
@@ -158,20 +157,23 @@ class TheTodd
158
157
  end
159
158
  ```
160
159
 
161
- If you don't want to have to add `extend AttrBool::Ext` to every class/module, you can simply refine the top module in your gem/library/app:
160
+ If you don't want to have to add `extend AttrBool::Ext` to every inner class/module (within the same file), then you can simply refine the outer module or the file:
162
161
 
163
162
  ```ruby
164
163
  require 'attr_bool'
165
164
 
165
+ #using AttrBool::Ref # Can refine the entire file instead (doesn't affect other files).
166
+
166
167
  module TheToddMod
167
168
  using AttrBool::Ref
168
- end
169
169
 
170
- # --- Some other file.
171
- module TheToddMod
172
170
  class TheTodd
173
171
  attr_bool :banana_hammock
174
172
  end
173
+
174
+ class TheToddBod
175
+ attr_bool :bounce_pecs
176
+ end
175
177
  end
176
178
  ```
177
179
 
data/attr_bool.gemspec CHANGED
@@ -14,8 +14,8 @@ Gem::Specification.new do |spec|
14
14
  spec.description = <<~DESC
15
15
  #{spec.summary}
16
16
 
17
- Pick one:
18
- (1) in your top module, add `using AttrBool::Ref`,
17
+ To get started, pick one:
18
+ (1) in your class/module, add `using AttrBool::Ref`,
19
19
  or (2) in your class/module, add `extend AttrBool::Ext`,
20
20
  or (3) in your app/script (not library), include `require 'attr_bool/core_ext'`.
21
21
 
@@ -9,5 +9,5 @@
9
9
  #++
10
10
 
11
11
  module AttrBool
12
- VERSION = '0.3.0'
12
+ VERSION = '0.3.1'
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attr_bool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bradley Whited
@@ -12,8 +12,8 @@ dependencies: []
12
12
  description: |
13
13
  Finally attr_accessor? & attr_reader? with question marks for booleans/predicates!?
14
14
 
15
- Pick one:
16
- (1) in your top module, add `using AttrBool::Ref`,
15
+ To get started, pick one:
16
+ (1) in your class/module, add `using AttrBool::Ref`,
17
17
  or (2) in your class/module, add `extend AttrBool::Ext`,
18
18
  or (3) in your app/script (not library), include `require 'attr_bool/core_ext'`.
19
19
 
@@ -62,7 +62,7 @@ rdoc_options:
62
62
  - "--markup"
63
63
  - markdown
64
64
  - "--title"
65
- - AttrBool v0.3.0
65
+ - AttrBool v0.3.1
66
66
  - "--main"
67
67
  - README.md
68
68
  require_paths: