lazy_stream 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lazy_stream.rb +4 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa9d0377f7f4989c9dc30bc5c815a26a3aceec0a
|
4
|
+
data.tar.gz: a9442c1c658d99b5b79a90a8dad437481898cb45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c16adf4696ca3bba83c9b6c42923eeb387e3ea0b63426d0a3fc88486fdda41be57d6029edff0b32d355aea81af295b21733f7514ba6fd92b3989ff2f8cec84e3
|
7
|
+
data.tar.gz: cafc007afb204107a4954b991b44e861e5172fe975b6c0bc95c8a1e4c93944d42144f707c679c1cdbbdae9a6993c3b7ab10b8afe12e138650ee9398f73ae8791
|
data/lib/lazy_stream.rb
CHANGED
@@ -16,16 +16,18 @@ class LazyStream
|
|
16
16
|
first.nil?
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
19
|
+
def [](n)
|
20
20
|
if empty?
|
21
21
|
nil
|
22
22
|
elsif n == 0
|
23
23
|
first
|
24
24
|
else
|
25
|
-
rest
|
25
|
+
rest[n - 1]
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
alias_method :at, :[]
|
30
|
+
|
29
31
|
def drop(n)
|
30
32
|
empty? || n < 1 ? self : rest.drop(n - 1)
|
31
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazy_stream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mingmin Xie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby infinite lazy stream
|
14
14
|
email: melvinxie@gmail.com
|
@@ -18,7 +18,8 @@ extra_rdoc_files: []
|
|
18
18
|
files:
|
19
19
|
- lib/lazy_stream.rb
|
20
20
|
homepage: https://github.com/melvinxie/lazy_stream
|
21
|
-
licenses:
|
21
|
+
licenses:
|
22
|
+
- MIT
|
22
23
|
metadata: {}
|
23
24
|
post_install_message:
|
24
25
|
rdoc_options: []
|