lazy_list 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +54 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +35 -0
- data/Rakefile +46 -0
- data/VERSION +1 -0
- data/lib/lazy_list.rb +17 -0
- data/lib/lazy_list/base.rb +39 -0
- data/lib/lazy_list/stream.rb +47 -0
- data/spec/lazy_list/base_spec.rb +35 -0
- data/spec/lazy_list/stream_spec.rb +70 -0
- data/spec/lazy_list_spec.rb +95 -0
- data/spec/spec_helper.rb +5 -0
- data/test/helper.rb +18 -0
- data/test/test_lazy_list.rb +7 -0
- metadata +150 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 05be4fd5637906c337d276bc9d212f0d4f0d5279
|
4
|
+
data.tar.gz: ba4f605c55a9abc7fbdca841fa21523c7da630d4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cff29d947649e827d2ecb19350a0ac2358addccf16b8b399a027688f94a33a9a7a1f7ef7db3e45027e3ba828aa244f9ee3a5a8b12274632119e18169e47c19c9
|
7
|
+
data.tar.gz: 8168ae2f4acfd9857db53263f49edf67eee423461ba4fb4d28dd3b1143a31bd536f8a4410da9577c1466f9612112ef13924c06f12c49fc0bbacd50e0c0ae51a5
|
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
ruby "2.0.0"
|
3
|
+
# Add dependencies required to use your gem here.
|
4
|
+
# Example:
|
5
|
+
# gem "activesupport", ">= 2.3.5"
|
6
|
+
|
7
|
+
# Add dependencies to develop your gem here.
|
8
|
+
# Include everything needed to run rake, tests, features, etc.
|
9
|
+
group :development do
|
10
|
+
gem "shoulda", ">= 0"
|
11
|
+
gem "rdoc", "~> 3.12"
|
12
|
+
gem "bundler"
|
13
|
+
gem "jeweler", "~> 1.8.4"
|
14
|
+
gem "rspec"
|
15
|
+
gem "simplecov"
|
16
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (3.2.12)
|
5
|
+
i18n (~> 0.6)
|
6
|
+
multi_json (~> 1.0)
|
7
|
+
bourne (1.1.2)
|
8
|
+
mocha (= 0.10.5)
|
9
|
+
diff-lcs (1.2.1)
|
10
|
+
git (1.2.5)
|
11
|
+
i18n (0.6.4)
|
12
|
+
jeweler (1.8.4)
|
13
|
+
bundler (~> 1.3.0.pre)
|
14
|
+
git (>= 1.2.5)
|
15
|
+
rake
|
16
|
+
rdoc
|
17
|
+
json (1.7.7)
|
18
|
+
metaclass (0.0.1)
|
19
|
+
mocha (0.10.5)
|
20
|
+
metaclass (~> 0.0.1)
|
21
|
+
multi_json (1.6.1)
|
22
|
+
rake (10.0.3)
|
23
|
+
rdoc (3.12.2)
|
24
|
+
json (~> 1.4)
|
25
|
+
rspec (2.13.0)
|
26
|
+
rspec-core (~> 2.13.0)
|
27
|
+
rspec-expectations (~> 2.13.0)
|
28
|
+
rspec-mocks (~> 2.13.0)
|
29
|
+
rspec-core (2.13.0)
|
30
|
+
rspec-expectations (2.13.0)
|
31
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
32
|
+
rspec-mocks (2.13.0)
|
33
|
+
shoulda (3.3.2)
|
34
|
+
shoulda-context (~> 1.0.1)
|
35
|
+
shoulda-matchers (~> 1.4.1)
|
36
|
+
shoulda-context (1.0.2)
|
37
|
+
shoulda-matchers (1.4.2)
|
38
|
+
activesupport (>= 3.0.0)
|
39
|
+
bourne (~> 1.1.2)
|
40
|
+
simplecov (0.7.1)
|
41
|
+
multi_json (~> 1.0)
|
42
|
+
simplecov-html (~> 0.7.1)
|
43
|
+
simplecov-html (0.7.1)
|
44
|
+
|
45
|
+
PLATFORMS
|
46
|
+
ruby
|
47
|
+
|
48
|
+
DEPENDENCIES
|
49
|
+
bundler
|
50
|
+
jeweler (~> 1.8.4)
|
51
|
+
rdoc (~> 3.12)
|
52
|
+
rspec
|
53
|
+
shoulda
|
54
|
+
simplecov
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 Thomas Chen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
Lazy List for Ruby
|
2
|
+
=
|
3
|
+
SICP-friendly version of the notorious lazy list for Ruby2.0.0.
|
4
|
+
|
5
|
+
One of the most badass things about Ruby2.0 is the Enumerator::Lazy,
|
6
|
+
but using that guy on a regular boring Array is kind of a waste as it
|
7
|
+
doesn't make it lazy enough. Thus lazy_list for ruby.
|
8
|
+
|
9
|
+
Examples
|
10
|
+
=
|
11
|
+
1. Generic FizzBuzz (where divisble by 3 -> fizz, divisble by 5 -> buzz, divisible by 15 -> fizzbuzz) example
|
12
|
+
```ruby
|
13
|
+
from_1 = LazyList::Stream.cycle(1).recur { |v| v + 1 } # [1, 2, 3, 4, 5...]
|
14
|
+
fizzes = from_1.lazy.map { |v| (v%3).zero? "fizz" : nil }
|
15
|
+
buzzes = from_1.lazy.map { |v| (v%5).zero? "buzz" : nil }
|
16
|
+
solution = fizzes.zip(buzzes).zip(from_1).map { |v| [v.last, "#{v[0]}#{v[1]}"] }.take(100).to_a
|
17
|
+
```
|
18
|
+
|
19
|
+
2. More examples coming up!
|
20
|
+
|
21
|
+
Contributing to lazy_list
|
22
|
+
=
|
23
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
24
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
25
|
+
* Fork the project.
|
26
|
+
* Start a feature/bugfix branch.
|
27
|
+
* Commit and push until you are happy with your contribution.
|
28
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
29
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
30
|
+
|
31
|
+
Copyright
|
32
|
+
=
|
33
|
+
Copyright (c) 2013 Thomas Chen. See LICENSE.txt for
|
34
|
+
further details.
|
35
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "lazy_list"
|
18
|
+
gem.homepage = "http://github.com/foxnewsnetwork/lazy_list"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Ruby2.0 implementaiton of lazy lists as they were meant to be straight out of Structures and Interpretations of Computer Programs.}
|
21
|
+
gem.description = %Q{Ruby is not Haskell. It is NOT a functional language and it isn't meant to be lazy, and forcing it to be anything other than Ruby is stupid and inefficient... but that didn't stop me from building an ultra-lazy Ruby2.0 version of the lazy list}
|
22
|
+
gem.email = "foxnewsnetwork@gmail.com"
|
23
|
+
gem.authors = ["Thomas Chen"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
Rake::TestTask.new(:test) do |test|
|
30
|
+
test.libs << 'lib' << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
task :default => :test
|
37
|
+
|
38
|
+
require 'rdoc/task'
|
39
|
+
Rake::RDocTask.new do |rdoc|
|
40
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
41
|
+
|
42
|
+
rdoc.rdoc_dir = 'rdoc'
|
43
|
+
rdoc.title = "lazy_list #{version}"
|
44
|
+
rdoc.rdoc_files.include('README*')
|
45
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
46
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
data/lib/lazy_list.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module LazyList
|
2
|
+
autoload :Base, File.join(File.dirname(__FILE__), "lazy_list", "base")
|
3
|
+
autoload :Stream, File.join(File.dirname(__FILE__), "lazy_list", "stream")
|
4
|
+
class << self
|
5
|
+
def cons(a=nil,b=nil)
|
6
|
+
lambda { |c| c.call(a,b) }
|
7
|
+
end
|
8
|
+
|
9
|
+
def cdr(list)
|
10
|
+
lambda { list.call( lambda { |a,b| b } ) }
|
11
|
+
end
|
12
|
+
|
13
|
+
def car(list)
|
14
|
+
lambda { list.call( lambda { |a,b| a } ) }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module LazyList
|
2
|
+
class Base
|
3
|
+
include Enumerable
|
4
|
+
|
5
|
+
def initialize(list=nil)
|
6
|
+
@list = list
|
7
|
+
@list ||= LazyList.cons
|
8
|
+
end
|
9
|
+
|
10
|
+
def empty?
|
11
|
+
@has_contents ||= false
|
12
|
+
end
|
13
|
+
|
14
|
+
def inspect
|
15
|
+
"[" + (map { |element| element.inspect }.join(", ")) + "]"
|
16
|
+
end
|
17
|
+
|
18
|
+
def prepend(a)
|
19
|
+
@has_contents = true
|
20
|
+
@list = LazyList.cons a, @list
|
21
|
+
self
|
22
|
+
end
|
23
|
+
|
24
|
+
def first
|
25
|
+
LazyList.car(@list).call
|
26
|
+
end
|
27
|
+
|
28
|
+
def rest
|
29
|
+
self.class.new LazyList.cdr(@list).call
|
30
|
+
end
|
31
|
+
|
32
|
+
def each(&block)
|
33
|
+
return if first.nil?
|
34
|
+
yield first
|
35
|
+
rest.each(&block)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module LazyList
|
2
|
+
class Stream < Base
|
3
|
+
|
4
|
+
class << self
|
5
|
+
def cycle(a)
|
6
|
+
new.prepend(a).recur { |a| a }
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def prepend(a)
|
11
|
+
@has_contents = true
|
12
|
+
f = lambda { a }
|
13
|
+
@list = LazyList.cons f, @list
|
14
|
+
self
|
15
|
+
end
|
16
|
+
|
17
|
+
def inspect
|
18
|
+
"[" + take(5).map(&:inspect).join(", ") + "...]"
|
19
|
+
end
|
20
|
+
|
21
|
+
def first
|
22
|
+
LazyList.car(@list).call.call
|
23
|
+
end
|
24
|
+
|
25
|
+
def rest
|
26
|
+
self.class.new LazyList.cdr(@list).call.call
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
def recur(&block)
|
32
|
+
@count = Float::INFINITY
|
33
|
+
@list = _recur( first, &block )
|
34
|
+
self
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def _recur(element, &block)
|
40
|
+
f = lambda { element }
|
41
|
+
l = lambda do
|
42
|
+
_recur( yield(element), &block)
|
43
|
+
end
|
44
|
+
LazyList.cons f,l
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe LazyList::Base do
|
4
|
+
let(:list) { LazyList::Base.new }
|
5
|
+
|
6
|
+
describe "#prepend" do
|
7
|
+
before :each do
|
8
|
+
list.prepend(1).prepend(2).prepend(3)
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#inspect" do
|
12
|
+
it "should return to me a reasonable string" do
|
13
|
+
list.inspect.should eq "[3, 2, 1]"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "#rest" do
|
18
|
+
it "should return to me another list that is different from the first list only by the head" do
|
19
|
+
list.rest.should be_a LazyList::Base
|
20
|
+
list.rest.should_not be_empty
|
21
|
+
end
|
22
|
+
it "should always return a LazyList::Base even if empty" do
|
23
|
+
list.rest.rest.rest.should be_a LazyList::Base
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should get me a list of stuff" do
|
28
|
+
list.first.should eq 3
|
29
|
+
list.rest.first.should eq 2
|
30
|
+
list.rest.rest.first.should eq 1
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe LazyList::Stream do
|
4
|
+
let(:api) { LazyList::Stream }
|
5
|
+
context "infinite streams" do
|
6
|
+
describe "::cycle" do
|
7
|
+
let(:stream) { api.cycle 1 }
|
8
|
+
|
9
|
+
describe "#recur" do
|
10
|
+
let(:infinite) { stream.recur { |v| v + 1 }.lazy }
|
11
|
+
|
12
|
+
context "enumerable" do
|
13
|
+
|
14
|
+
describe "#take" do
|
15
|
+
let(:ten) { infinite.take(10).to_a }
|
16
|
+
it "should be a finite array of 10 things" do
|
17
|
+
stream.take(10).should eq [1,1,1,1,1,1,1,1,1,1]
|
18
|
+
ten.should eq [1,2,3,4,5,6,7,8,9,10]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "#reject" do
|
23
|
+
let(:odds) { infinite.reject { |v| (v%2).zero? }.take(100).to_a }
|
24
|
+
it "should only have the odd numbers" do
|
25
|
+
odds.count.should eq 100
|
26
|
+
odds.each { |o| (0%2).should eq 0 }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "#map" do
|
31
|
+
let(:scaled) { infinite.map { |v| v * 2 }.take(5).to_a }
|
32
|
+
|
33
|
+
it "should give me a scaled version of the input array" do
|
34
|
+
scaled.should eq [2,4,6,8,10]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "#to_s" do
|
39
|
+
let(:string) { stream.inspect }
|
40
|
+
|
41
|
+
it "should give me a reasonable string" do
|
42
|
+
string.should eq "[1, 1, 1, 1, 1...]"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
describe "#prepend" do
|
49
|
+
let(:stream) { api.new.prepend(2) }
|
50
|
+
|
51
|
+
describe "#recur" do
|
52
|
+
let(:infinite) { stream.recur { |value| value * 2 } }
|
53
|
+
|
54
|
+
describe "#first" do
|
55
|
+
let(:two) { infinite.first }
|
56
|
+
let(:four) { infinite.rest.first }
|
57
|
+
let(:eight) { infinite.rest.rest.first }
|
58
|
+
let(:sixteen) { infinite.rest.rest.rest.first }
|
59
|
+
it "should get me the correct values" do
|
60
|
+
two.should eq 2
|
61
|
+
four.should eq 4
|
62
|
+
eight.should eq 8
|
63
|
+
sixteen.should eq 16
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe LazyList do
|
4
|
+
let(:api) { LazyList }
|
5
|
+
context "null usage" do
|
6
|
+
let(:list) { api.cons }
|
7
|
+
|
8
|
+
describe "::car" do
|
9
|
+
let(:nothing) { api.car( list).call }
|
10
|
+
|
11
|
+
it "give me nothing" do
|
12
|
+
nothing.should be_nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
describe "::cdr" do
|
16
|
+
let(:nothing) { api.cdr( list ).call }
|
17
|
+
|
18
|
+
it "should also be nothing" do
|
19
|
+
nothing.should be_nil
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context "singleton usage" do
|
25
|
+
let(:list) { api.cons 1 }
|
26
|
+
|
27
|
+
describe "::car" do
|
28
|
+
let(:one) { api.car( list).call }
|
29
|
+
|
30
|
+
it "should give the first and only value in the singleton list" do
|
31
|
+
one.should eq 1
|
32
|
+
end
|
33
|
+
end
|
34
|
+
describe "::cdr" do
|
35
|
+
let(:nothing) { api.cdr( list).call }
|
36
|
+
|
37
|
+
it "should give me nothing" do
|
38
|
+
nothing.should be_nil
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "::cons" do
|
44
|
+
let(:list) { api.cons 1, 2 }
|
45
|
+
|
46
|
+
it "should actually be a lambda" do
|
47
|
+
list.should be_a Proc
|
48
|
+
end
|
49
|
+
|
50
|
+
describe "::car" do
|
51
|
+
let(:one) { api.car(list).call }
|
52
|
+
it "should return the first element of the list" do
|
53
|
+
one.should eq 1
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe "::cdr" do
|
58
|
+
let(:two) { api.cdr( list).call }
|
59
|
+
|
60
|
+
it "should return the remaining elements of the list" do
|
61
|
+
two.should eq 2
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context "chaining" do
|
66
|
+
let(:list2) { api.cons 0, list }
|
67
|
+
|
68
|
+
it "should still be a proc" do
|
69
|
+
list2.should be_a Proc
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "::car" do
|
73
|
+
let(:zero) { api.car( list2).call }
|
74
|
+
it "should get the first element of the new list" do
|
75
|
+
zero.should eq 0
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "::cdr" do
|
80
|
+
let(:one) { api.cdr( list2).call }
|
81
|
+
it "should fetch the rest of the list" do
|
82
|
+
one.should eq list
|
83
|
+
api.car(one).call.should eq 1
|
84
|
+
end
|
85
|
+
describe "::cdr" do
|
86
|
+
let(:two) { api.cdr( one).call }
|
87
|
+
it "should fetch out the final element in the lazy list" do
|
88
|
+
two.should eq 2
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
data/spec/spec_helper.rb
ADDED
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'lazy_list'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lazy_list
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Thomas Chen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-03-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: shoulda
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rdoc
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.12'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: jeweler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.8.4
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.8.4
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: Ruby is not Haskell. It is NOT a functional language and it isn't meant
|
98
|
+
to be lazy, and forcing it to be anything other than Ruby is stupid and inefficient...
|
99
|
+
but that didn't stop me from building an ultra-lazy Ruby2.0 version of the lazy
|
100
|
+
list
|
101
|
+
email: foxnewsnetwork@gmail.com
|
102
|
+
executables: []
|
103
|
+
extensions: []
|
104
|
+
extra_rdoc_files:
|
105
|
+
- LICENSE.txt
|
106
|
+
- README.markdown
|
107
|
+
files:
|
108
|
+
- .document
|
109
|
+
- .rspec
|
110
|
+
- Gemfile
|
111
|
+
- Gemfile.lock
|
112
|
+
- LICENSE.txt
|
113
|
+
- README.markdown
|
114
|
+
- Rakefile
|
115
|
+
- VERSION
|
116
|
+
- lib/lazy_list.rb
|
117
|
+
- lib/lazy_list/base.rb
|
118
|
+
- lib/lazy_list/stream.rb
|
119
|
+
- spec/lazy_list/base_spec.rb
|
120
|
+
- spec/lazy_list/stream_spec.rb
|
121
|
+
- spec/lazy_list_spec.rb
|
122
|
+
- spec/spec_helper.rb
|
123
|
+
- test/helper.rb
|
124
|
+
- test/test_lazy_list.rb
|
125
|
+
homepage: http://github.com/foxnewsnetwork/lazy_list
|
126
|
+
licenses:
|
127
|
+
- MIT
|
128
|
+
metadata: {}
|
129
|
+
post_install_message:
|
130
|
+
rdoc_options: []
|
131
|
+
require_paths:
|
132
|
+
- lib
|
133
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - '>='
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
requirements: []
|
144
|
+
rubyforge_project:
|
145
|
+
rubygems_version: 2.0.0.rc.2
|
146
|
+
signing_key:
|
147
|
+
specification_version: 4
|
148
|
+
summary: Ruby2.0 implementaiton of lazy lists as they were meant to be straight out
|
149
|
+
of Structures and Interpretations of Computer Programs.
|
150
|
+
test_files: []
|