existence 0.0.5 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 121904c40e74f13f0d2e068b6374027483f8d936
4
- data.tar.gz: 31283df9d5be5998be8fa279fa367840201b09b7
3
+ metadata.gz: d1107e2eca2fba48b829c8b1cebb3b2dcfc2b9a0
4
+ data.tar.gz: 3ef905c3bc29d250fba0b4f08e04cd1aeb7360c7
5
5
  SHA512:
6
- metadata.gz: 938c6e1ad1b708f2c631d83f2040d1429b2a1056a04247ca11fc442e888c2b46f11de5d94723759fb005e1e22fda51ef0ef73b7ed08cfc0af821fa2ef54f3ef7
7
- data.tar.gz: 27deeef8ea9586a9fae2ab5de627a0cf1b546e0ce9415b2581bcaee984a447bf1a32e468bf5448f13a5f3f5a635d9cb4e2093278e637e42dd8b160f86c08fed4
6
+ metadata.gz: 879512a8dbfbac02b0070bbbf05fe91825f5d6f2316abe2264cf923ad05c9921c8cf85aa74b6f78e0da07c25499c5fe93e15599b781ba8e3758e2911e53b884b
7
+ data.tar.gz: bb757f4352e6eb184d12936856d9a607f807decc6874553bef8561914303a79742877009dc77e8f647275c3291b620d2e813303b13b65da8720f985a2f25e68e
@@ -0,0 +1,6 @@
1
+ require 'existence/array'
2
+ require 'existence/false_class'
3
+ require 'existence/hash'
4
+ require 'existence/nil_class'
5
+ require 'existence/string'
6
+ require 'existence/true_class'
@@ -0,0 +1,7 @@
1
+ class Array
2
+ def present?
3
+ !empty?
4
+ end
5
+
6
+ alias_method :blank?, :empty?
7
+ end
@@ -0,0 +1,9 @@
1
+ class FalseClass
2
+ def present?
3
+ false
4
+ end
5
+
6
+ def blank?
7
+ true
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ class Hash
2
+ def present?
3
+ !empty?
4
+ end
5
+
6
+ alias_method :blank?, :empty?
7
+ end
@@ -0,0 +1,9 @@
1
+ class NilClass
2
+ def present?
3
+ false
4
+ end
5
+
6
+ def blank?
7
+ true
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class String
2
+ def present?
3
+ !blank?
4
+ end
5
+
6
+ def blank?
7
+ self.strip.empty?
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class TrueClass
2
+ def present?
3
+ true
4
+ end
5
+
6
+ def blank?
7
+ false
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module Existence
2
+ VERSION = '0.0.6'
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: existence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Wetzel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-01 00:00:00.000000000 Z
11
+ date: 2017-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -43,7 +43,15 @@ email:
43
43
  executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
46
- files: []
46
+ files:
47
+ - lib/existence.rb
48
+ - lib/existence/array.rb
49
+ - lib/existence/false_class.rb
50
+ - lib/existence/hash.rb
51
+ - lib/existence/nil_class.rb
52
+ - lib/existence/string.rb
53
+ - lib/existence/true_class.rb
54
+ - lib/existence/version.rb
47
55
  homepage:
48
56
  licenses:
49
57
  - MIT
@@ -64,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
72
  version: '0'
65
73
  requirements: []
66
74
  rubyforge_project:
67
- rubygems_version: 2.6.8
75
+ rubygems_version: 2.6.11
68
76
  signing_key:
69
77
  specification_version: 4
70
78
  summary: Exposes present? and blank? to common Ruby classes.