Skip to content

Commit 3a58fc5

Browse files
committed
Get most of the tests passing.
1 parent 62dc85f commit 3a58fc5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+27
-1247
lines changed

MANIFEST

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ lib/core/facets/hash/count.rb
187187
lib/core/facets/hash/data.rb
188188
lib/core/facets/hash/dearray_values.rb
189189
lib/core/facets/hash/deep_merge.rb
190-
lib/core/facets/hash/deep_rekey.rb
191190
lib/core/facets/hash/delete.rb
192191
lib/core/facets/hash/delete_at.rb
193192
lib/core/facets/hash/delete_unless.rb
@@ -213,7 +212,6 @@ lib/core/facets/hash/op_push.rb
213212
lib/core/facets/hash/op_sub.rb
214213
lib/core/facets/hash/recurse.rb
215214
lib/core/facets/hash/recursively.rb
216-
lib/core/facets/hash/rekey.rb
217215
lib/core/facets/hash/replace_each.rb
218216
lib/core/facets/hash/revalue.rb
219217
lib/core/facets/hash/reverse_merge.rb
@@ -978,7 +976,6 @@ test/core/hash/test_op_push.rb
978976
test/core/hash/test_op_sub.rb
979977
test/core/hash/test_recurse.rb
980978
test/core/hash/test_recursively.rb
981-
test/core/hash/test_rekey.rb
982979
test/core/hash/test_replace_each.rb
983980
test/core/hash/test_revalue.rb
984981
test/core/hash/test_reverse_merge.rb

demo/standard/02_cloneable.rdoc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ Try #dup.
2222
b = a.dup
2323
b.bar_id.refute == a.bar_id
2424

25-
a.taint
26-
b = a.dup
27-
b.assert.tainted?
28-
2925
a.freeze
3026
b = a.dup
3127
b.refute.frozen?
@@ -36,10 +32,6 @@ Note try #clone.
3632
b = a.clone
3733
b.bar_id.refute == a.bar_id
3834

39-
a.taint
40-
b = a.dup
41-
b.assert.tainted?
42-
4335
a.freeze
4436
b = a.clone
4537
b.assert.frozen?

lib/core/facets.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
require 'facets/denumerable.rb'
99
require 'facets/dir.rb'
1010
require 'facets/enumerable.rb'
11-
require 'facets/enumerator.rb'
1211
require 'facets/exception.rb'
1312
require 'facets/file.rb'
1413
require 'facets/filetest.rb'

lib/core/facets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ paths:
6767
- lib/standard
6868
name: facets
6969
title: Ruby Facets
70-
version: 3.1.0
70+
version: 4.0.0
7171
summary: The orginal well curated collection of extension methods for Ruby.
7272
slogan: ALL YOUR BASE ARE BELONG TO RUBY!
7373
description: Facets is the premier collection of extension methods for the Ruby programming

lib/core/facets/binding/caller.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@ def caller( skip=0 )
88
eval("caller(#{skip})")
99
end
1010

11+
# Returns the call stack, same format as Kernel#caller_locations()
12+
#
13+
def caller_locations( skip=0 )
14+
eval("caller_locations(#{skip})")
15+
end
16+
1117
# Return the line number on which the binding was created.
1218
#
1319
def __LINE__
14-
Kernel.eval("__LINE__", self)
20+
self.source_location[1]
1521
end
1622

1723
# Returns file name in which the binding was created.
1824
#
1925
def __FILE__
20-
Kernel.eval("__FILE__", self)
26+
self.source_location[0]
2127
end
2228

2329
# Return the directory of the file in which the binding was created.

lib/core/facets/denumerable.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
require 'facets/enumerator'
2-
#require 'facets/enumerable/take'
3-
41
# Classes which include Denumerable will get versions of map,
52
# select, and so on, which return a Denumerator, so that they
63
# work horizontally without creating intermediate arrays.

lib/core/facets/enumerable/each_by.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'facets/enumerator'
2-
31
module Enumerable
42

53
# Iterate through slices. If slice +steps+ is not

lib/core/facets/enumerable/filter.rb

Lines changed: 0 additions & 33 deletions
This file was deleted.

lib/core/facets/enumerable/hashify.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#require 'facets/enumerator'
21
require 'facets/hash/dearray_values'
32
require 'facets/enumerable/value_by'
43

lib/core/facets/enumerator.rb

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,2 @@
1-
if RUBY_VERSION < '1.9'
2-
3-
require 'enumerator'
4-
5-
# for Ruby 1.8 -> 1.9 transition
6-
Enumerator = Enumerable::Enumerator unless defined?(::Enumerator)
7-
8-
class Enumerator
9-
10-
private
11-
12-
alias :old_initialize :initialize
13-
14-
# Provides the ruby-1.9 block form of Enumerator, where you can write:
15-
#
16-
# obj = Enumerator.new do |yielder|
17-
# # ...
18-
# yielder.yield(data) # or: yielder << data
19-
# # ...
20-
# end
21-
#
22-
# When obj.each is called, the block is run once. It should call
23-
# yielder.yield with each item it wishes to generate.
24-
#
25-
# Example:
26-
#
27-
# fib = Enumerator.new { |y|
28-
# a = b = 1
29-
# loop {
30-
# y << a
31-
# a, b = b, a + b
32-
# }
33-
# }
34-
#
35-
# fib.take(10) #=> [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
36-
#
37-
def initialize(*args, &block)
38-
if block
39-
@body = block
40-
old_initialize(self, :_start)
41-
else
42-
old_initialize(*args)
43-
end
44-
end
45-
46-
def _start(*args,&receiver) #:nodoc:
47-
@body.call(Yielder.new(&receiver), *args)
48-
end
49-
50-
# Wrapper to allow yielder.yield(output) or yielder << output
51-
# in the same way as ruby-1.9
52-
#
53-
# TODO: Why can't Yielder take a block instead of a proc argument?
54-
55-
class Yielder #:nodoc:
56-
def initialize(&proc)
57-
@proc = proc
58-
end
59-
def yield(*args)
60-
@proc[*args]
61-
end
62-
alias :<< :yield
63-
end
64-
65-
end
66-
67-
end
68-
69-
path = __FILE__.chomp('.rb')
70-
base = File.basename(path)
71-
Dir[File.join(path, '*.rb')].each do |lib|
72-
#require lib # why is this so much slower?
73-
require "facets/#{base}/#{File.basename(lib)}"
74-
end
75-
1+
require_relative 'enumerator/fx'
2+
require_relative 'enumerator/lazy/squeeze'

0 commit comments

Comments
 (0)