prolog-dry_types 0.1.0 → 0.2.0

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: fc1450e64dab48197eba2604e4c6797785743e12
4
- data.tar.gz: 9922693a24d5af77a8cf7d3d4a132fe67c15102d
3
+ metadata.gz: 32a26be2140bf1cd30cc480eef7d09b5f6590cd3
4
+ data.tar.gz: 4de91889e5f4a1f7e7e5df20229c9891df22c95c
5
5
  SHA512:
6
- metadata.gz: a0b1c9be3f34988a54eb372db3e37732e5a643faea690f8e3a22a80552af9dbb4bdd9a3b291644d4d14159e5e326299f2a693f30e700e03de5ba880be56de6f9
7
- data.tar.gz: 3d20c79b501a8c1c475425c64137ba10ef61c6974b941e4070dadf086b852d57a84f7c6e67463cda9c37f34949dd5d3b57097dbd3752d8a3591537db4334a972
6
+ metadata.gz: 2dbea9cbcd95e51f3dbced05eb38e781e7302fc52f31bd9a2db9257302d0fbaf718e06df4ebd9edfb7f99018e99c0846d62fe3aa65b5edd1e6be787f95982476
7
+ data.tar.gz: 56114555b98e78634e0b604cb69d19f5a7d6b8404e02ccf8e06c09e370d8bc55ddb34f8b0903dd8ad4ee61ecee604b6b1bf650dfd815dfc2facbf0aa18523a7c
@@ -13,9 +13,9 @@ module Types
13
13
  # reflection, this makes little sense as a general-purpose behaviour, as it is
14
14
  # highly likely to surprise casual users.
15
15
  IntegerRange = Range.constructor do |value|
16
- if value.is_a?(::Range)
17
- value
18
- else
16
+ if value.respond_to?(:minmax) # Enumerable; eg, Range or Array
17
+ value.min..value.max
18
+ else # it *better* be an Integer
19
19
  0..value.to_i
20
20
  end
21
21
  end
@@ -3,6 +3,6 @@
3
3
  module Prolog
4
4
  # Container for RubyGems-required constant definitions.
5
5
  module DryTypes
6
- VERSION = '0.1.0'
6
+ VERSION = '0.2.0'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prolog-dry_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dickey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-04 00:00:00.000000000 Z
11
+ date: 2016-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-types