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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ea1ca32894baa365b51feaeddc616f6fa55cc82
4
- data.tar.gz: abb789173257a8b131d66a0aa6d1d2e161e1f549
3
+ metadata.gz: 0dea1058f5a2e36476b0cce2df0003d62e5b1d59
4
+ data.tar.gz: 604c338783e3894f7f858b405591690ec29fbac0
5
5
  SHA512:
6
- metadata.gz: 212099661a2b3be79ca7c2218d5fda126331db1fe6b2625164dac6e2dbf0f1d9bd4f869e31d7c1fc227f96a926815408954abf160a8df852ebbb490ed70fb101
7
- data.tar.gz: c21fbd4cfafd99203ae7b796a91d130ba72d382a18a0f57146c7d86fa375b30944f55060d701020b51c4c6af11dd50155ea40bb26397bfabe2ea42bc3c2cc2f0
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
@@ -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
@@ -3,6 +3,6 @@ module Hanami
3
3
  # Defines the version
4
4
  #
5
5
  # @since 0.1.0
6
- VERSION = '1.0.0.beta1'.freeze
6
+ VERSION = '1.0.0.beta2'.freeze
7
7
  end
8
8
  end
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.beta1
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-14 00:00:00.000000000 Z
13
+ date: 2017-03-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler