null_question 1.0.0 → 1.0.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 +5 -5
- data/CHANGELOG.md +5 -2
- data/Gemfile +1 -0
- data/MIT-LICENSE.txt +1 -1
- data/README.md +6 -9
- data/Rakefile +15 -1
- data/lib/null_question.rb +3 -1
- data/null_question.gemspec +2 -2
- metadata +5 -8
- data/.travis.yml +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f26d849633ab8800eab198386d51148e2a728e4db48cef8a3d27163412c93b36
|
4
|
+
data.tar.gz: 5f5191a16adfa0b4b73c2762247407bc69cf02f79754d372b09e0c75f6dd3a49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05fa6b7ffc874eccfad42bea6c28f0d6ccffe5891ae1880597f1a7c61974c2ed6463c9461f06e6698df6fcf24c8bb489da89cb1de9d50cb904ceb9e18fdb6470
|
7
|
+
data.tar.gz: d2c4f10b750d793256557caede463267b8d8fdebfcd7de578a24b6594319a28a73152baacb333b97ee3158389cd7d85e0ab509c02b17e189aaf116afd72a5780
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,25 +1,23 @@
|
|
1
|
-
# Object#null? [![[version]](https://badge.fury.io/rb/null_question.svg)](
|
1
|
+
# Object#null? [![[version]](https://badge.fury.io/rb/null_question.svg)](https://badge.fury.io/rb/null_question) [![[ci]](https://github.com/janlelis/null_question/workflows/Test/badge.svg)](https://github.com/janlelis/null_question/actions?query=workflow%3ATest)
|
2
2
|
|
3
|
-
Adds NilClass#null? #=> true and Object#null? #=> false
|
4
|
-
|
5
|
-
Useful for implementing custom null objects that also return true for `#null?`
|
3
|
+
Adds `NilClass#null? #=> true` and `Object#null? #=> false`
|
6
4
|
|
5
|
+
Useful for implementing custom null objects that will also return true for `#null?`
|
7
6
|
|
8
7
|
## Setup
|
9
8
|
|
10
|
-
Add to your
|
9
|
+
Add to your **Gemfile**:
|
11
10
|
|
12
11
|
```ruby
|
13
12
|
gem 'null_question'
|
14
13
|
```
|
15
14
|
|
16
|
-
|
17
15
|
## Usage
|
18
16
|
|
19
17
|
```ruby
|
20
18
|
class NullObject
|
21
19
|
def null?
|
22
|
-
|
20
|
+
true
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
@@ -28,7 +26,6 @@ NullObject.new.null? #=> true
|
|
28
26
|
Object.new.null? #=> false
|
29
27
|
```
|
30
28
|
|
31
|
-
|
32
29
|
## J-_-L
|
33
30
|
|
34
|
-
Copyright (C) 2015 Jan Lelis <
|
31
|
+
Copyright (C) 2015 Jan Lelis <https://janlelis.com>. Released under the MIT license.
|
data/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# # #
|
2
2
|
# Get gemspec info
|
3
3
|
|
4
|
-
gemspec_file = Dir['*.gemspec'].first
|
4
|
+
gemspec_file = Dir['*.gemspec'].first
|
5
5
|
gemspec = eval File.read(gemspec_file), binding, gemspec_file
|
6
6
|
info = "#{gemspec.name} | #{gemspec.version} | " \
|
7
7
|
"#{gemspec.runtime_dependencies.size} dependencies | " \
|
@@ -28,3 +28,17 @@ desc "#{gemspec.name} | IRB"
|
|
28
28
|
task :irb do
|
29
29
|
sh "irb -I ./lib -r #{gemspec.name.gsub '-','/'}"
|
30
30
|
end
|
31
|
+
|
32
|
+
|
33
|
+
# # #
|
34
|
+
# Run specs
|
35
|
+
|
36
|
+
desc "#{gemspec.name} | Spec"
|
37
|
+
task :spec do
|
38
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
|
39
|
+
sh "for %f in (spec/\*.rb) do ruby spec/%f"
|
40
|
+
else
|
41
|
+
sh "for file in spec/*.rb; do ruby $file; done"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
task default: :spec
|
data/lib/null_question.rb
CHANGED
data/null_question.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.summary = "Object#null?"
|
9
9
|
gem.description = "Adds NilClass#null? #=> true and Object#null? #=> false"
|
10
10
|
gem.authors = ["Jan Lelis"]
|
11
|
-
gem.email = ["
|
11
|
+
gem.email = ["hi@ruby.consulting"]
|
12
12
|
gem.homepage = "https://github.com/janlelis/null_question"
|
13
13
|
gem.license = "MIT"
|
14
14
|
|
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.required_ruby_version = "
|
20
|
+
gem.required_ruby_version = ">= 2.0"
|
21
21
|
end
|
metadata
CHANGED
@@ -1,24 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: null_question
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Adds NilClass#null? #=> true and Object#null? #=> false'
|
14
14
|
email:
|
15
|
-
-
|
15
|
+
- hi@ruby.consulting
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- ".gitignore"
|
21
|
-
- ".travis.yml"
|
22
21
|
- CHANGELOG.md
|
23
22
|
- Gemfile
|
24
23
|
- MIT-LICENSE.txt
|
@@ -37,7 +36,7 @@ require_paths:
|
|
37
36
|
- lib
|
38
37
|
required_ruby_version: !ruby/object:Gem::Requirement
|
39
38
|
requirements:
|
40
|
-
- - "
|
39
|
+
- - ">="
|
41
40
|
- !ruby/object:Gem::Version
|
42
41
|
version: '2.0'
|
43
42
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -46,11 +45,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: '0'
|
48
47
|
requirements: []
|
49
|
-
|
50
|
-
rubygems_version: 2.4.6
|
48
|
+
rubygems_version: 3.2.4
|
51
49
|
signing_key:
|
52
50
|
specification_version: 4
|
53
51
|
summary: Object#null?
|
54
52
|
test_files:
|
55
53
|
- spec/null_question_spec.rb
|
56
|
-
has_rdoc:
|
data/.travis.yml
DELETED