callable 0.0.4 → 0.0.5

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: e768ec5b42620b5cddec4479ea0ce5018d32d462
4
- data.tar.gz: 430ea16944fb5b4684b25b747edae15906f8f5c7
3
+ metadata.gz: 5b9a1c55e8f4d5e655fd34c998ad76daaa3342b1
4
+ data.tar.gz: a6a65ff3463dec2a89868aeb1f4c11beae5db641
5
5
  SHA512:
6
- metadata.gz: b4184989f5a317828f747c8638276c3997a95ac95f61bb208015b088d4b4fa70fbba75ab5921a371c15c37fbe2f857adad93ef2bd63451ad2edbacbd619a0552
7
- data.tar.gz: 3ec6e7a740d65954e64bc9b8a40d1ad5c99586050c91356982a1e38e6acca4a919e18816a72476b6f66c228be1265d959d7e34b30a1a8b9e615161384c4e6aee
6
+ metadata.gz: 78d3d785093558746d22bdab79a5bcbc6629d532c322cd790bb1c6b9bad90842f2b634b1c223e52611ae6473b93081195af00808a6f277850ed99cf72b0de71b
7
+ data.tar.gz: 72d7aee36ffdf8964607117028d94f5c1bdd5f19972d0fa4d699a0e1c29e9726208db3ab8220943bbdb1081d3aff72a928fa620c546ca7bb5e820f8acb97075a
@@ -1,8 +1,8 @@
1
1
  require "callable/version"
2
2
 
3
3
  module Callable
4
- def Callable( callable_or_not, default: nil )
5
- return Callable(default) if callable_or_not.nil?
4
+ def Callable( callable_or_not, default: Undefined )
5
+ return Callable(default) if callable_or_not.nil? && default != Undefined
6
6
  if callable_or_not.respond_to?(:call)
7
7
  callable_or_not
8
8
  else
@@ -17,6 +17,9 @@ module Callable
17
17
  def callable?
18
18
  self.respond_to?(:call)
19
19
  end
20
+
21
+ class Undefined < BasicObject; end
22
+
20
23
  end
21
24
 
22
25
  ::Object.include(Callable)
@@ -1,3 +1,3 @@
1
1
  module Callable
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -81,5 +81,11 @@ scope Callable do
81
81
 
82
82
  @c.call == "DEFAULT VALUE"
83
83
  end
84
+
85
+ spec "the default default value is nil" do
86
+ @c = Callable(nil)
87
+
88
+ @c.call == nil
89
+ end
84
90
  end
85
91
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: callable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Iachetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-30 00:00:00.000000000 Z
11
+ date: 2015-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler