not_nil 0.0.3 → 1.0.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 +6 -14
- data/lib/not_nil.rb +7 -3
- data/spec/not_nil_spec.rb +17 -12
- metadata +26 -13
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MGFiMTU1MjhhMWFhOTBlNTA2ZGJlN2UzZWUwZTE5MDAyODQ3Y2VjNDA0Nzgw
|
10
|
-
MDY0ZTM3N2UwMGE4NDZmNTkwYzQwNjNhZjYyZTkwZjI4MjQ2MTIyYjA0ZTdh
|
11
|
-
OGJmMTk5Y2E1YjdjMWI1YzhmZTAxNWM0ODFjN2FhNTM1ZjQ2NGI=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MTQzMTlmZDAzOGMwMGVkNzk2NWM0NDkxOTE1ZmUxMTc5OTliMWUxODAwN2Ix
|
14
|
-
MDI5MTkxMjRjMGY1ZWUxMzNlMzQxZjhiMjEyNDhiZDBiMTVkMWE0YWU5NTQ0
|
15
|
-
YjQ2ODkwNzE4NGUyNjYyN2M3OTY2MDZlZTkwM2VkNmExMGZkZWE=
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b2821b03a41c6f4f13dc7d661257af2b4716104ab213fe0d212920eb60333ac7
|
4
|
+
data.tar.gz: 3391758b0d4dc8165b60a0fb3bc7a9faf30869b95d4104c4e52438d7e2456aba
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9f6109cc275ea424d73b10f42f11a799fa45e6bddee7e7e228c51bcd096214f1b76f322bf0249bd7c71f0f3e9602d22a8c257553c03a0e69d0746834904a8aa8
|
7
|
+
data.tar.gz: 1f124f299235fee2b3753544a8e6a4ac9e5dd985a3f5c7f1fdeda8cdd63a91dbacac95758006aea9f9d5e9e20470373311d05285fbbeaaafe7114465319c83a3
|
data/lib/not_nil.rb
CHANGED
data/spec/not_nil_spec.rb
CHANGED
@@ -1,29 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Object do
|
4
|
-
before(:each)
|
6
|
+
before(:each) do
|
5
7
|
@a_nil_object = nil
|
6
8
|
@an_empty_object = Object.new
|
7
|
-
String.send(:define_method, :not_nil?){'I AM NOT NIL'}
|
8
|
-
@empty_string =
|
9
|
-
|
9
|
+
String.send(:define_method, :not_nil?) { 'I AM NOT NIL' }
|
10
|
+
@empty_string = ''
|
11
|
+
end
|
12
|
+
|
10
13
|
context 'nil instance method' do
|
11
|
-
describe
|
12
|
-
it
|
13
|
-
expect(@a_nil_object.methods.include?
|
14
|
+
describe 'nil class additions' do
|
15
|
+
it 'responds to nil and not_nil' do
|
16
|
+
expect(@a_nil_object.methods.include?(:not_nil?)).to eq true
|
14
17
|
expect(@a_nil_object.nil?).to eq true
|
15
18
|
expect(@a_nil_object.not_nil?).to eq false
|
16
19
|
end
|
17
20
|
end
|
18
|
-
|
19
|
-
|
21
|
+
|
22
|
+
describe 'object class additions' do
|
23
|
+
it 'responds to nil and not_nil' do
|
20
24
|
expect(@an_empty_object.nil?).to eq false
|
21
25
|
expect(@an_empty_object.not_nil?).to eq true
|
22
26
|
end
|
23
27
|
end
|
24
|
-
|
25
|
-
|
26
|
-
|
28
|
+
|
29
|
+
describe 'string' do
|
30
|
+
it 'responds correctly to a redefined not_nil' do
|
31
|
+
expect(@empty_string.not_nil?).to eq 'I AM NOT NIL'
|
27
32
|
end
|
28
33
|
end
|
29
34
|
end
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: not_nil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Platt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: rspec
|
14
|
+
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.9.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.9.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.82'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.82'
|
27
41
|
description: not_nil adds not_nil? to object. This allows you to use not_nil on everything
|
28
42
|
that inherits from Object.
|
29
43
|
email: mplatt@tammantech.com
|
@@ -33,7 +47,7 @@ extra_rdoc_files: []
|
|
33
47
|
files:
|
34
48
|
- lib/not_nil.rb
|
35
49
|
- spec/not_nil_spec.rb
|
36
|
-
homepage: http://
|
50
|
+
homepage: http://mrkplt.com
|
37
51
|
licenses:
|
38
52
|
- MIT
|
39
53
|
metadata: {}
|
@@ -43,17 +57,16 @@ require_paths:
|
|
43
57
|
- lib
|
44
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
45
59
|
requirements:
|
46
|
-
- -
|
60
|
+
- - ">="
|
47
61
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
62
|
+
version: '2.5'
|
49
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
64
|
requirements:
|
51
|
-
- -
|
65
|
+
- - ">="
|
52
66
|
- !ruby/object:Gem::Version
|
53
67
|
version: '0'
|
54
68
|
requirements: []
|
55
|
-
|
56
|
-
rubygems_version: 2.0.7
|
69
|
+
rubygems_version: 3.1.2
|
57
70
|
signing_key:
|
58
71
|
specification_version: 4
|
59
72
|
summary: not_nil adds not_nil? to object.
|