susan_collins 0.1.0 → 0.2.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 +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +21 -1
- data/LICENSE.txt +20 -17
- data/README.md +59 -11
- data/lib/susan_collins.rb +25 -1
- data/lib/susan_collins/deep_concern.rb +19 -0
- data/lib/susan_collins/version.rb +1 -1
- data/lib/susan_collins/very_concerning.rb +4 -0
- data/susan_collins.gemspec +4 -2
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f1068dea712c9ee63179a116548ed6c824d6d741dbdf52844798398b02e30de
|
4
|
+
data.tar.gz: f5691387dff394d02a52641be9319cc2e0a079b7ad30441ec554b186174f1815
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db948e1396a09f677adb6f4de292319d699b6c718a7a915ca45ae464ba825365ce06cc22408a13b877a69bea25cc77f3af40aa66340d6ba06c793b76750f9eea
|
7
|
+
data.tar.gz: 5d2ace5683959eebe542e71a276abfe48c85c99eca064718969b0ac4183f3506df1e9784f8d7d1d0d55b11078ca2cf0cd39e244f14c040927fc11569255f9c54
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,12 +1,28 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
susan_collins (0.
|
4
|
+
susan_collins (0.2.0)
|
5
|
+
activesupport
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
10
|
+
activesupport (6.1.0)
|
11
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
+
i18n (>= 1.6, < 2)
|
13
|
+
minitest (>= 5.1)
|
14
|
+
tzinfo (~> 2.0)
|
15
|
+
zeitwerk (~> 2.3)
|
16
|
+
coderay (1.1.3)
|
17
|
+
concurrent-ruby (1.1.7)
|
9
18
|
diff-lcs (1.4.4)
|
19
|
+
i18n (1.8.5)
|
20
|
+
concurrent-ruby (~> 1.0)
|
21
|
+
method_source (1.0.0)
|
22
|
+
minitest (5.14.2)
|
23
|
+
pry (0.13.1)
|
24
|
+
coderay (~> 1.1)
|
25
|
+
method_source (~> 1.0)
|
10
26
|
rake (12.3.3)
|
11
27
|
rspec (3.10.0)
|
12
28
|
rspec-core (~> 3.10.0)
|
@@ -21,11 +37,15 @@ GEM
|
|
21
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
22
38
|
rspec-support (~> 3.10.0)
|
23
39
|
rspec-support (3.10.0)
|
40
|
+
tzinfo (2.0.4)
|
41
|
+
concurrent-ruby (~> 1.0)
|
42
|
+
zeitwerk (2.4.2)
|
24
43
|
|
25
44
|
PLATFORMS
|
26
45
|
ruby
|
27
46
|
|
28
47
|
DEPENDENCIES
|
48
|
+
pry (~> 0.13.1)
|
29
49
|
rake (~> 12.0)
|
30
50
|
rspec (~> 3.0)
|
31
51
|
susan_collins!
|
data/LICENSE.txt
CHANGED
@@ -1,21 +1,24 @@
|
|
1
|
-
|
1
|
+
This is free and unencumbered software released into the public domain.
|
2
2
|
|
3
|
-
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
4
|
+
distribute this software, either in source code form or as a compiled
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
6
|
+
means.
|
4
7
|
|
5
|
-
|
6
|
-
of this software
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
9
|
+
of this software dedicate any and all copyright interest in the
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
11
|
+
of the public at large and to the detriment of our heirs and
|
12
|
+
successors. We intend this dedication to be an overt act of
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
14
|
+
software under copyright law.
|
11
15
|
|
12
|
-
|
13
|
-
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
14
23
|
|
15
|
-
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
24
|
+
For more information, please refer to <https://unlicense.org>
|
data/README.md
CHANGED
@@ -1,8 +1,64 @@
|
|
1
|
-
#
|
1
|
+
# susan_collins
|
2
|
+
Use `Concern` everywhere
|
2
3
|
|
3
|
-
|
4
|
+
Sets the global `Concern` to [`ActiveSupport::Concern`][ASC] so you don't have to type those pesky extra characters.
|
4
5
|
|
5
|
-
|
6
|
+
[ASC]: https://api.rubyonrails.org/classes/ActiveSupport/Concern.html
|
7
|
+
|
8
|
+
## Usage
|
9
|
+
In either your Gemfile or code, require the main module:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
# Gemfile
|
13
|
+
gem "susan_collins"
|
14
|
+
|
15
|
+
# or
|
16
|
+
require "susan_collins"
|
17
|
+
```
|
18
|
+
|
19
|
+
You can now:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
module DeepConcern
|
23
|
+
extend Concern
|
24
|
+
|
25
|
+
class_methods do
|
26
|
+
# ...
|
27
|
+
end
|
28
|
+
|
29
|
+
included do
|
30
|
+
# ...
|
31
|
+
end
|
32
|
+
|
33
|
+
# ...
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
With the regular require, you get [`concerning`][MC] too:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
class TremendouslyLargeClass
|
41
|
+
# ...
|
42
|
+
include DeepConcern
|
43
|
+
|
44
|
+
concerning :SeriousConcerns do
|
45
|
+
# ...
|
46
|
+
end
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
50
|
+
[MC]: https://api.rubyonrails.org/classes/Module/Concerning.html
|
51
|
+
|
52
|
+
### Just Concern
|
53
|
+
If you don't want `Module#concerning`:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
# Gemfile
|
57
|
+
gem "susan_collins", require: "susan_collins/deep_concern"
|
58
|
+
|
59
|
+
# or
|
60
|
+
require "susan_collins/deep_concern"
|
61
|
+
```
|
6
62
|
|
7
63
|
## Installation
|
8
64
|
|
@@ -20,10 +76,6 @@ Or install it yourself as:
|
|
20
76
|
|
21
77
|
$ gem install susan_collins
|
22
78
|
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
79
|
## Development
|
28
80
|
|
29
81
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -35,10 +87,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
35
87
|
Bug reports and pull requests are welcome on GitHub at https://github.com/joallard/susan_collins. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/joallard/susan_collins/blob/master/CODE_OF_CONDUCT.md).
|
36
88
|
|
37
89
|
|
38
|
-
## License
|
39
|
-
|
40
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
41
|
-
|
42
90
|
## Code of Conduct
|
43
91
|
|
44
92
|
Everyone interacting in the SusanCollins project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/joallard/susan_collins/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/susan_collins.rb
CHANGED
@@ -1,6 +1,30 @@
|
|
1
|
+
require "susan_collins/deep_concern"
|
1
2
|
require "susan_collins/version"
|
2
3
|
|
3
4
|
module SusanCollins
|
5
|
+
extend self
|
6
|
+
|
7
|
+
def self.is_concerned!
|
8
|
+
is_deeply_concerned!; is_very_concerned!
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.is_concerned?
|
12
|
+
is_deeply_concerned? && is_very_concerned?
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.is_very_concerned!
|
16
|
+
require "susan_collins/very_concerning"
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.is_very_concerned?
|
20
|
+
Module.method_defined?(:concerning)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.concerned?; is_concerned?; end
|
24
|
+
def self.very_concerned?; is_very_concerned?; end
|
25
|
+
def self.deeply_concerned?; is_deeply_concerned?; end
|
26
|
+
|
4
27
|
class Error < StandardError; end
|
5
|
-
# Your code goes here...
|
6
28
|
end
|
29
|
+
|
30
|
+
SusanCollins.is_concerned!
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "active_support/concern"
|
2
|
+
|
3
|
+
module SusanCollins
|
4
|
+
module DeepConcern
|
5
|
+
extend ActiveSupport::Concern # sad!
|
6
|
+
|
7
|
+
class_methods do
|
8
|
+
def is_deeply_concerned!
|
9
|
+
Object.const_set(:Concern, ::ActiveSupport::Concern)
|
10
|
+
end
|
11
|
+
|
12
|
+
def is_deeply_concerned?
|
13
|
+
defined?(::Concern) && ::Concern == ::ActiveSupport::Concern
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
include DeepConcern
|
19
|
+
end
|
data/susan_collins.gemspec
CHANGED
@@ -3,8 +3,8 @@ require_relative 'lib/susan_collins/version'
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "susan_collins"
|
5
5
|
spec.version = SusanCollins::VERSION
|
6
|
-
spec.authors = ["Jonathan Allard"]
|
7
|
-
spec.email = ["jonathan@allard.io"]
|
6
|
+
spec.authors = ["Jonathan Allard", "Anonymous contributors"]
|
7
|
+
spec.email = ["jonathan@allard.io", "nobody@github.com"]
|
8
8
|
|
9
9
|
spec.summary = %q{Use Concern everywhere!}
|
10
10
|
|
@@ -31,4 +31,6 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.bindir = "exe"
|
32
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
33
|
spec.require_paths = ["lib"]
|
34
|
+
|
35
|
+
spec.add_dependency "activesupport"
|
34
36
|
end
|
metadata
CHANGED
@@ -1,19 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: susan_collins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Allard
|
8
|
+
- Anonymous contributors
|
8
9
|
autorequire:
|
9
10
|
bindir: exe
|
10
11
|
cert_chain: []
|
11
12
|
date: 2020-12-19 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activesupport
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
13
28
|
description: "\n Sets ::Concern to ActiveSupport::Concern so you can use them\n
|
14
29
|
\ everywhere without needing to type those pesky characters.\n "
|
15
30
|
email:
|
16
31
|
- jonathan@allard.io
|
32
|
+
- nobody@github.com
|
17
33
|
executables: []
|
18
34
|
extensions: []
|
19
35
|
extra_rdoc_files: []
|
@@ -30,7 +46,9 @@ files:
|
|
30
46
|
- bin/console
|
31
47
|
- bin/setup
|
32
48
|
- lib/susan_collins.rb
|
49
|
+
- lib/susan_collins/deep_concern.rb
|
33
50
|
- lib/susan_collins/version.rb
|
51
|
+
- lib/susan_collins/very_concerning.rb
|
34
52
|
- susan_collins.gemspec
|
35
53
|
homepage: https://github.com/joallard/susan_collins
|
36
54
|
licenses:
|