abstractivator 0.16.0 → 0.17.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8929bafe047d7ee344331b015c9408ba151b27b5
|
4
|
+
data.tar.gz: cbaa2ac79d3581202fc89adeecdfd5a488df91b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e938f5a2e3cbb2ae6e672accdde64dd4fd3b35f87923babbc49163dc4c1dc54b569ef696eea944d08db74643aedff81d6811583f8cf282715228a6e30ab2ca0
|
7
|
+
data.tar.gz: ccde9bcc6996de8d961056a6db883c4801e875a2e3ea069b379636f92c299055d2f95d0daced4d6f4214f54c7a587e2d788249f69dd560d05b58ebaaf815a0bd
|
@@ -1,4 +1,5 @@
|
|
1
1
|
class Enumerator
|
2
|
+
# Enumerate values produced from an initial state. The enumerator terminates when the next state is nil.
|
2
3
|
# @param state [Object] The initial state
|
3
4
|
# @yieldparam state [Object] the current state
|
4
5
|
# @yieldreturn [Array] a 2-element array containing the next value and the next state
|
@@ -245,6 +245,20 @@ describe 'Array#to_proc' do
|
|
245
245
|
end
|
246
246
|
end
|
247
247
|
|
248
|
+
describe 'Symbol#to_safe_proc' do
|
249
|
+
it 'returns a "safe operator" proc' do
|
250
|
+
upcase = :upcase.to_safe_proc
|
251
|
+
expect(upcase.call('a')).to eql 'A'
|
252
|
+
expect(upcase.call(nil)).to eql nil
|
253
|
+
end
|
254
|
+
it 'handles booleans properly' do
|
255
|
+
to_s = :to_s.to_safe_proc
|
256
|
+
expect(to_s.call(nil)).to eql nil
|
257
|
+
expect(to_s.call(false)).to eql 'false'
|
258
|
+
expect(to_s.call(true)).to eql 'true'
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
248
262
|
describe 'Object#callable?' do
|
249
263
|
it 'determines whether or not the object has a public :call method' do
|
250
264
|
expect(1.callable?).to be_falsey
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abstractivator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Winton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|