hanami-utils 1.0.0.beta1 → 1.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/hanami/utils/blank.rb +24 -0
- data/lib/hanami/utils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dea1058f5a2e36476b0cce2df0003d62e5b1d59
|
4
|
+
data.tar.gz: 604c338783e3894f7f858b405591690ec29fbac0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3044e152c6c5ddafb61facaa9a684f6490cf84c607612ad9c17e3e342b71003a3c734dfb455629548f531cf4a738ac08941c053c1d0439f5ff391661385b08e
|
7
|
+
data.tar.gz: 4f8dc8490e07396d49dbba0655df548e6ce617a7c0414b834235ce99a53ccaec9bcc3461db79201c1b2615296eebb3103c8c0c2e33cf20224e0abef71d84ae9d
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Hanami::Utils
|
2
2
|
Ruby core extentions and class utilities for Hanami
|
3
3
|
|
4
|
+
## v1.0.0.beta2 - 2017-03-02
|
5
|
+
### Changed
|
6
|
+
- [Anton Davydov] Made `Utils::Blank` private API
|
7
|
+
|
4
8
|
## v1.0.0.beta1 - 2017-02-14
|
5
9
|
### Added
|
6
10
|
- [Luca Guidi] Official support for Ruby: MRI 2.4
|
data/lib/hanami/utils/blank.rb
CHANGED
@@ -2,6 +2,7 @@ module Hanami
|
|
2
2
|
module Utils
|
3
3
|
# Checks for blank
|
4
4
|
# @since 0.8.0
|
5
|
+
# @api private
|
5
6
|
class Blank
|
6
7
|
# Matcher for blank strings
|
7
8
|
#
|
@@ -26,6 +27,7 @@ module Hanami
|
|
26
27
|
# @return [TrueClass,FalseClass]
|
27
28
|
#
|
28
29
|
# @since 0.8.0
|
30
|
+
# @api private
|
29
31
|
def self.blank?(object) # rubocop:disable Metrics/MethodLength
|
30
32
|
case object
|
31
33
|
when String, ::String
|
@@ -40,6 +42,28 @@ module Hanami
|
|
40
42
|
object.respond_to?(:empty?) ? object.empty? : !self
|
41
43
|
end
|
42
44
|
end
|
45
|
+
|
46
|
+
# Checks object is filled
|
47
|
+
#
|
48
|
+
# @example Basic Usage
|
49
|
+
# require 'hanami/utils/blank'
|
50
|
+
#
|
51
|
+
# Hanami::Utils::Blank.filled?(true) # => true
|
52
|
+
# Hanami::Utils::Blank.filled?(1) # => true
|
53
|
+
# Hanami::Utils::Blank.filled?(Hanami::Utils::String.new('')) # => false
|
54
|
+
# Hanami::Utils::Blank.filled?(' ') # => false
|
55
|
+
# Hanami::Utils::Blank.filled?(nil) # => false
|
56
|
+
# Hanami::Utils::Blank.filled?(Hanami::Utils::Hash.new({})) # => false
|
57
|
+
#
|
58
|
+
# @param object the argument
|
59
|
+
#
|
60
|
+
# @return [TrueClass,FalseClass]
|
61
|
+
#
|
62
|
+
# @since 1.0.0.beta2
|
63
|
+
# @api private
|
64
|
+
def self.filled?(object)
|
65
|
+
!blank?(object)
|
66
|
+
end
|
43
67
|
end
|
44
68
|
end
|
45
69
|
end
|
data/lib/hanami/utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-02
|
13
|
+
date: 2017-03-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|