hamster 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +12 -1
- data/README.rdoc +8 -3
- data/lib/hamster/hash.rb +34 -4
- data/lib/hamster/trie.rb +21 -8
- data/lib/hamster/version.rb +1 -1
- data/spec/hamster/hash/except_spec.rb +31 -0
- data/spec/hamster/hash/fetch_spec.rb +95 -0
- data/spec/hamster/hash/has_key_spec.rb +1 -1
- data/spec/hamster/hash/hash_spec.rb +15 -0
- data/spec/hamster/hash/size_spec.rb +34 -0
- data/spec/hamster/hash/slice_spec.rb +31 -0
- data/spec/hamster/hash/values_spec.rb +15 -2
- data/spec/hamster/list/coverage/index.html +2 -2
- data/spec/hamster/list/coverage/resultset.yml +175 -101
- metadata +46 -40
data/History.rdoc
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
=== 0.4.3 / 2012-10-01
|
2
|
+
|
3
|
+
* Track size on Tries for performance (fredericksgary)
|
4
|
+
* Hash#values should not return a set as there is no guarantee of uniqueness (and worse it means you potentially lose duplicate values). (fredericksgary)
|
5
|
+
* Add Hash#slice, Hash#except, Hash#fetch (misfo)
|
6
|
+
* Implemented a public Hash#new for subclassing (misfo)
|
7
|
+
* Some initial benchmarks (haedius)
|
8
|
+
* Documentation corrections (harukizaemon, szajbus, rwfowler)
|
9
|
+
|
1
10
|
=== 0.4.2 / 2011-04-07
|
2
11
|
|
3
12
|
* Added List#merge/merge_by to merge sorted lists into a single stream.
|
@@ -8,7 +17,9 @@
|
|
8
17
|
|
9
18
|
* Added initial implementation of Vector for efficient indexed access.
|
10
19
|
|
11
|
-
* Fix car/cdr so they work on Ruby 1.8.7 (
|
20
|
+
* Fix car/cdr so they work on Ruby 1.8.7 (tianyicui)
|
21
|
+
* Fix specs when running under 1.8.7 (tianyicui, kef)
|
22
|
+
* Fix bundler/rvm support (kef)
|
12
23
|
|
13
24
|
=== 0.3.10 / 2010-10-22
|
14
25
|
|
data/README.rdoc
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
GitHub: http://github.com/harukizaemon/hamster
|
4
4
|
RubyGems: https://rubygems.org/gems/hamster
|
5
5
|
email: haruki_zaemon@mac.com
|
6
|
-
IRC:
|
6
|
+
IRC: ##haruki_zaemon on freenode
|
7
7
|
|
8
8
|
== Introduction
|
9
9
|
|
10
|
-
Hamster started out as an implementation of Hash Array Mapped Tries (HAMT) for Ruby (see http://
|
10
|
+
Hamster started out as an implementation of Hash Array Mapped Tries (HAMT) for Ruby (see http://lampwww.epfl.ch/papers/idealhashtrees.pdf) and has since expanded to include implementations of other Persistent Data Structures (see http://en.wikipedia.org/wiki/Persistent_data_structure) including Set, List, Stack, Queue, and Vector.
|
11
11
|
|
12
12
|
Hamster collections are immutable. Whenever you modify a Hamster collection, the original is preserved and a modified copy is returned. This makes them inherently thread-safe and sharable. (For an interesting perspective on why immutability itself is inherently a good thing, you might like to take a look at Matthias Felleisen's Function Objects presentation: http://www.ccs.neu.edu/home/matthias/Presentations/ecoop2004.pdf)
|
13
13
|
|
@@ -29,6 +29,11 @@ Once installed, all that remains is to make the collection classes available in
|
|
29
29
|
|
30
30
|
require 'hamster'
|
31
31
|
|
32
|
+
Installation via bundler is even easier:
|
33
|
+
|
34
|
+
gem "hamster"
|
35
|
+
|
36
|
+
|
32
37
|
If you prefer, you can instead require individual classes as necessary:
|
33
38
|
|
34
39
|
require 'hamster/list'
|
@@ -220,7 +225,7 @@ versus
|
|
220
225
|
|
221
226
|
(1..10000).each { |i| hash[i] } # => 0.001s
|
222
227
|
|
223
|
-
What's even better -- or worse depending on your perspective -- is that after all that, the native Hash version still isn't thread-safe and still requires some synchronisation around it slowing it down even further
|
228
|
+
What's even better -- or worse depending on your perspective -- is that after all that, the native Hash version still isn't thread-safe and still requires some synchronisation around it slowing it down even further.
|
224
229
|
|
225
230
|
The Hamster version on the other hand was unchanged from the original whilst remaining inherently thread-safe, and 3 orders of magnitude faster.
|
226
231
|
|
data/lib/hamster/hash.rb
CHANGED
@@ -7,7 +7,7 @@ require 'hamster/trie'
|
|
7
7
|
module Hamster
|
8
8
|
|
9
9
|
def self.hash(pairs = {}, &block)
|
10
|
-
|
10
|
+
Hash.new(pairs, &block)
|
11
11
|
end
|
12
12
|
|
13
13
|
class Hash
|
@@ -16,6 +16,15 @@ module Hamster
|
|
16
16
|
|
17
17
|
include Immutable
|
18
18
|
|
19
|
+
class << self
|
20
|
+
def new(pairs = {}, &block)
|
21
|
+
@empty ||= super()
|
22
|
+
pairs.reduce(block_given? ? super(&block) : @empty) { |hash, pair| hash.put(pair.first, pair.last) }
|
23
|
+
end
|
24
|
+
|
25
|
+
attr_reader :empty
|
26
|
+
end
|
27
|
+
|
19
28
|
def initialize(&block)
|
20
29
|
@trie = EmptyTrie
|
21
30
|
@default = block
|
@@ -48,6 +57,19 @@ module Hamster
|
|
48
57
|
end
|
49
58
|
def_delegator :self, :get, :[]
|
50
59
|
|
60
|
+
def fetch(key, default = Undefined)
|
61
|
+
entry = @trie.get(key)
|
62
|
+
if entry
|
63
|
+
entry.value
|
64
|
+
elsif default != Undefined
|
65
|
+
default
|
66
|
+
elsif block_given?
|
67
|
+
yield
|
68
|
+
else
|
69
|
+
raise KeyError.new("key not found: #{key.inspect}")
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
51
73
|
def put(key, value = Undefined)
|
52
74
|
return put(key, yield(get(key))) if value.equal?(Undefined)
|
53
75
|
transform { @trie = @trie.put(key, value) }
|
@@ -82,7 +104,7 @@ module Hamster
|
|
82
104
|
def filter
|
83
105
|
return self unless block_given?
|
84
106
|
trie = @trie.filter { |entry| yield(entry.key, entry.value) }
|
85
|
-
return
|
107
|
+
return self.class.empty if trie.empty?
|
86
108
|
transform_unless(trie.equal?(@trie)) { @trie = trie }
|
87
109
|
end
|
88
110
|
def_delegator :self, :filter, :select
|
@@ -127,16 +149,24 @@ module Hamster
|
|
127
149
|
end
|
128
150
|
def_delegator :self, :merge, :+
|
129
151
|
|
152
|
+
def except(*keys)
|
153
|
+
keys.reduce(self) { |hash, key| hash.delete(key) }
|
154
|
+
end
|
155
|
+
|
156
|
+
def slice(*keys)
|
157
|
+
except(*self.keys - keys)
|
158
|
+
end
|
159
|
+
|
130
160
|
def keys
|
131
161
|
reduce(Hamster.set) { |keys, key, value| keys.add(key) }
|
132
162
|
end
|
133
163
|
|
134
164
|
def values
|
135
|
-
reduce(Hamster.
|
165
|
+
reduce(Hamster.list) { |values, key, value| values.cons(value) }
|
136
166
|
end
|
137
167
|
|
138
168
|
def clear
|
139
|
-
|
169
|
+
self.class.empty
|
140
170
|
end
|
141
171
|
|
142
172
|
def eql?(other)
|
data/lib/hamster/trie.rb
CHANGED
@@ -6,15 +6,16 @@ module Hamster
|
|
6
6
|
|
7
7
|
extend Forwardable
|
8
8
|
|
9
|
-
def initialize(significant_bits, entries = [], children = [])
|
9
|
+
def initialize(significant_bits, size = 0, entries = [], children = [])
|
10
10
|
@significant_bits = significant_bits
|
11
11
|
@entries = entries
|
12
12
|
@children = children
|
13
|
+
@size = size
|
13
14
|
end
|
14
15
|
|
15
16
|
# Returns the number of key-value pairs in the trie.
|
16
17
|
def size
|
17
|
-
|
18
|
+
@size
|
18
19
|
end
|
19
20
|
|
20
21
|
# Returns <tt>true</tt> if the trie contains no key-value pairs.
|
@@ -49,19 +50,27 @@ module Hamster
|
|
49
50
|
def put(key, value)
|
50
51
|
index = index_for(key)
|
51
52
|
entry = @entries[index]
|
52
|
-
|
53
|
+
|
54
|
+
if !entry
|
55
|
+
entries = @entries.dup
|
56
|
+
entries[index] = Entry.new(key, value)
|
57
|
+
self.class.new(@significant_bits, @size + 1, entries, @children)
|
58
|
+
elsif entry.key.eql?(key)
|
53
59
|
entries = @entries.dup
|
54
60
|
entries[index] = Entry.new(key, value)
|
55
|
-
self.class.new(@significant_bits, entries, @children)
|
61
|
+
self.class.new(@significant_bits, @size, entries, @children)
|
56
62
|
else
|
57
63
|
children = @children.dup
|
58
64
|
child = children[index]
|
65
|
+
child_size = child ? child.size : 0
|
59
66
|
children[index] = if child
|
60
67
|
child.put(key, value)
|
61
68
|
else
|
62
69
|
self.class.new(@significant_bits + 5).put!(key, value)
|
63
70
|
end
|
64
|
-
|
71
|
+
new_child_size = children[index].size
|
72
|
+
new_self_size = @size + (new_child_size - child_size)
|
73
|
+
self.class.new(@significant_bits, new_self_size, @entries, children)
|
65
74
|
end
|
66
75
|
end
|
67
76
|
|
@@ -104,7 +113,9 @@ module Hamster
|
|
104
113
|
|
105
114
|
# Returns <tt>self</tt> after overwriting the element associated with the specified key.
|
106
115
|
def put!(key, value)
|
107
|
-
|
116
|
+
index = index_for(key)
|
117
|
+
@size += 1 unless @entries[index]
|
118
|
+
@entries[index] = Entry.new(key, value)
|
108
119
|
self
|
109
120
|
end
|
110
121
|
|
@@ -123,7 +134,9 @@ module Hamster
|
|
123
134
|
if !copy.equal?(child)
|
124
135
|
children = @children.dup
|
125
136
|
children[index] = copy
|
126
|
-
|
137
|
+
copy_size = copy ? copy.size : 0
|
138
|
+
new_size = @size - (child.size - copy_size)
|
139
|
+
return self.class.new(@significant_bits, new_size, @entries, children)
|
127
140
|
end
|
128
141
|
end
|
129
142
|
end
|
@@ -144,7 +157,7 @@ module Hamster
|
|
144
157
|
else
|
145
158
|
entries[index] = nil
|
146
159
|
end
|
147
|
-
self.class.new(@significant_bits, entries, children || @children)
|
160
|
+
self.class.new(@significant_bits, @size - 1, entries, children || @children)
|
148
161
|
end
|
149
162
|
end
|
150
163
|
|
data/lib/hamster/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'hamster/hash'
|
4
|
+
|
5
|
+
describe Hamster::Hash do
|
6
|
+
|
7
|
+
describe "#except" do
|
8
|
+
|
9
|
+
before do
|
10
|
+
@hash = Hamster.hash("A" => "aye", "B" => "bee", "C" => "see", nil => "NIL")
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "with only keys that the Hash has" do
|
14
|
+
|
15
|
+
it "returns a Hash without those values" do
|
16
|
+
@hash.except("B", nil).should == Hamster.hash("A" => "aye", "C" => "see")
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "with keys that the Hash doesn't have" do
|
22
|
+
|
23
|
+
it "returns a Hash without the values that it had keys for" do
|
24
|
+
@hash.except("B", "A", 3).should == Hamster.hash("C" => "see", nil => "NIL")
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'hamster/hash'
|
4
|
+
|
5
|
+
describe Hamster::Hash do
|
6
|
+
|
7
|
+
describe "#fetch" do
|
8
|
+
|
9
|
+
describe "with no default provided" do
|
10
|
+
|
11
|
+
describe "when the key exists" do
|
12
|
+
|
13
|
+
before do
|
14
|
+
@hash = Hamster.hash("A" => "aye")
|
15
|
+
end
|
16
|
+
|
17
|
+
it "returns the value associated with the key" do
|
18
|
+
@hash.fetch("A").should == "aye"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "when the key does not exist" do
|
24
|
+
|
25
|
+
before do
|
26
|
+
@hash = Hamster.hash("A" => "aye")
|
27
|
+
end
|
28
|
+
|
29
|
+
it "raises a KeyError" do
|
30
|
+
lambda { @hash.fetch("B") }.should raise_error(KeyError)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
describe "with a default value" do
|
38
|
+
|
39
|
+
describe "when the key exists" do
|
40
|
+
|
41
|
+
before do
|
42
|
+
@hash = Hamster.hash("A" => "aye")
|
43
|
+
end
|
44
|
+
|
45
|
+
it "returns the value associated with the key" do
|
46
|
+
@hash.fetch("A", "default").should == "aye"
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
describe "when the key does not exist" do
|
52
|
+
|
53
|
+
before do
|
54
|
+
@hash = Hamster.hash("A" => "aye")
|
55
|
+
end
|
56
|
+
|
57
|
+
it "returns the default value" do
|
58
|
+
@hash.fetch("B", "default").should == "default"
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
describe "with a default block" do
|
66
|
+
|
67
|
+
describe "when the key exists" do
|
68
|
+
|
69
|
+
before do
|
70
|
+
@hash = Hamster.hash("A" => "aye")
|
71
|
+
end
|
72
|
+
|
73
|
+
it "returns the value associated with the key" do
|
74
|
+
@hash.fetch("A") { "default".upcase }.should == "aye"
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "when the key does not exist" do
|
80
|
+
|
81
|
+
before do
|
82
|
+
@hash = Hamster.hash("A" => "aye")
|
83
|
+
end
|
84
|
+
|
85
|
+
it "returns the default value" do
|
86
|
+
@hash.fetch("B") { "default".upcase }.should == "DEFAULT"
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
@@ -34,6 +34,21 @@ describe Hamster::Hash do
|
|
34
34
|
|
35
35
|
end
|
36
36
|
|
37
|
+
describe "from a subclass" do
|
38
|
+
before do
|
39
|
+
@subclass = Class.new(Hamster::Hash)
|
40
|
+
@instance = @subclass.new("some" => "values")
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should return an instance of the subclass" do
|
44
|
+
@instance.class.should be @subclass
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should return a frozen instance" do
|
48
|
+
@instance.frozen?.should be true
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
37
52
|
end
|
38
53
|
|
39
54
|
end
|
@@ -20,6 +20,40 @@ describe Hamster::Hash do
|
|
20
20
|
|
21
21
|
end
|
22
22
|
|
23
|
+
lots = (1..10842).to_a
|
24
|
+
srand 89533474
|
25
|
+
random_things = (lots + lots).sort_by{|x|rand}
|
26
|
+
|
27
|
+
it "should have the correct size after adding lots of things with colliding keys and such" do
|
28
|
+
h = Hamster.hash
|
29
|
+
random_things.each do |thing|
|
30
|
+
h = h.put(thing, thing * 2)
|
31
|
+
end
|
32
|
+
h.size.should == 10842
|
33
|
+
end
|
34
|
+
|
35
|
+
random_actions = (lots.map{|x|[:add, x]} + lots.map{|x|[:add, x]} + lots.map{|x|[:remove, x]}).
|
36
|
+
sort_by{|x|rand}
|
37
|
+
ending_size = random_actions.reduce({}) do |h, (act, ob)|
|
38
|
+
if act == :add
|
39
|
+
h[ob] = 1
|
40
|
+
else
|
41
|
+
h.delete(ob)
|
42
|
+
end
|
43
|
+
h
|
44
|
+
end.size
|
45
|
+
it "should have the correct size after lots of addings and removings" do
|
46
|
+
h = Hamster.hash
|
47
|
+
random_actions.each do |(act, ob)|
|
48
|
+
if act == :add
|
49
|
+
h = h.put(ob, ob * 3)
|
50
|
+
else
|
51
|
+
h = h.delete(ob)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
h.size.should == ending_size
|
55
|
+
end
|
56
|
+
|
23
57
|
end
|
24
58
|
|
25
59
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'hamster/hash'
|
4
|
+
|
5
|
+
describe Hamster::Hash do
|
6
|
+
|
7
|
+
describe "#slice" do
|
8
|
+
|
9
|
+
before do
|
10
|
+
@hash = Hamster.hash("A" => "aye", "B" => "bee", "C" => "see", nil => "NIL")
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "with only keys that the Hash has" do
|
14
|
+
|
15
|
+
it "returns a Hash with only those values" do
|
16
|
+
@hash.slice("B", nil).should == Hamster.hash("B" => "bee", nil => "NIL")
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "with keys that the Hash doesn't have" do
|
22
|
+
|
23
|
+
it "returns a Hash with only the values that have matching keys" do
|
24
|
+
@hash.slice("B", "A", 3).should == Hamster.hash("A" => "aye", "B" => "bee")
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -12,10 +12,23 @@ describe Hamster::Hash do
|
|
12
12
|
@result = hash.values
|
13
13
|
end
|
14
14
|
|
15
|
-
it "returns the keys as a
|
16
|
-
@result.should
|
15
|
+
it "returns the keys as a list" do
|
16
|
+
@result.should be_a Hamster::List
|
17
|
+
@result.to_a.sort.should == %w(aye bee see)
|
17
18
|
end
|
18
19
|
|
19
20
|
end
|
20
21
|
|
22
|
+
describe "#values with duplicates" do
|
23
|
+
before do
|
24
|
+
hash = Hamster.hash(:A => 15, :B => 19, :C => 15)
|
25
|
+
@result = hash.values
|
26
|
+
end
|
27
|
+
|
28
|
+
it "returns the keys as a list" do
|
29
|
+
@result.should be_a Hamster::List
|
30
|
+
@result.to_a.sort.should == [15,15,19]
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
21
34
|
end
|
@@ -21,7 +21,7 @@
|
|
21
21
|
<img src="./assets/0.4.4/loading.gif" alt="loading"/>
|
22
22
|
</div>
|
23
23
|
<div id="wrapper" style="display:none;">
|
24
|
-
<div class="timestamp">Generated <abbr class="timeago" title="2011-04-
|
24
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2011-04-11T06:35:16+10:00">2011-04-11T06:35:16+10:00</abbr></div>
|
25
25
|
<ul class="group_tabs"></ul>
|
26
26
|
|
27
27
|
<div id="content">
|
@@ -60,7 +60,7 @@
|
|
60
60
|
<div id="footer">
|
61
61
|
Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.4.2
|
62
62
|
and simplecov-html v0.4.4<br/>
|
63
|
-
using /tmp/textmate-command-
|
63
|
+
using /tmp/textmate-command-54823.rb , /tmp/textmate-command-54890.rb
|
64
64
|
</div>
|
65
65
|
|
66
66
|
<div class="source_files">
|
@@ -1,151 +1,225 @@
|
|
1
|
-
---
|
2
|
-
|
1
|
+
---
|
2
|
+
"/tmp/textmate-command-50488.rb ":
|
3
3
|
:original_result: {}
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
:created_at: 2011-04-07 07:19:26.366000 +10:00
|
6
|
+
"/tmp/textmate-command-50541.rb ":
|
6
7
|
:original_result: {}
|
7
|
-
|
8
|
-
|
8
|
+
|
9
|
+
:created_at: 2011-04-07 07:34:33.733000 +10:00
|
10
|
+
"/tmp/textmate-command-50803.rb ":
|
9
11
|
:original_result: {}
|
10
|
-
|
11
|
-
|
12
|
+
|
13
|
+
:created_at: 2011-04-07 07:33:43.780000 +10:00
|
14
|
+
"/tmp/textmate-command-52586.rb ":
|
12
15
|
:original_result: {}
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
:created_at: 2011-04-07 09:21:49.550000 +10:00
|
18
|
+
"/tmp/textmate-command-52618.rb ":
|
15
19
|
:original_result: {}
|
16
|
-
|
17
|
-
|
20
|
+
|
21
|
+
:created_at: 2011-04-07 09:09:25.856000 +10:00
|
22
|
+
"/tmp/textmate-command-52647.rb ":
|
18
23
|
:original_result: {}
|
19
|
-
|
20
|
-
|
24
|
+
|
25
|
+
:created_at: 2011-04-07 09:10:40.595000 +10:00
|
26
|
+
"/tmp/textmate-command-53439.rb ":
|
21
27
|
:original_result: {}
|
22
|
-
|
23
|
-
|
28
|
+
|
29
|
+
:created_at: 2011-04-07 09:24:47.457000 +10:00
|
30
|
+
"/tmp/textmate-command-53471.rb ":
|
24
31
|
:original_result: {}
|
25
|
-
|
26
|
-
|
32
|
+
|
33
|
+
:created_at: 2011-04-07 09:23:28.155000 +10:00
|
34
|
+
"/tmp/textmate-command-53542.rb ":
|
27
35
|
:original_result: {}
|
28
|
-
|
29
|
-
|
36
|
+
|
37
|
+
:created_at: 2011-04-07 09:25:41.648000 +10:00
|
38
|
+
"/tmp/textmate-command-53717.rb ":
|
30
39
|
:original_result: {}
|
31
|
-
|
32
|
-
|
40
|
+
|
41
|
+
:created_at: 2011-04-07 09:42:39.470000 +10:00
|
42
|
+
"/tmp/textmate-command-53749.rb ":
|
33
43
|
:original_result: {}
|
34
|
-
|
35
|
-
|
44
|
+
|
45
|
+
:created_at: 2011-04-07 09:37:45.005000 +10:00
|
46
|
+
"/tmp/textmate-command-53792.rb ":
|
36
47
|
:original_result: {}
|
37
|
-
|
38
|
-
|
48
|
+
|
49
|
+
:created_at: 2011-04-07 09:36:12.708000 +10:00
|
50
|
+
"/tmp/textmate-command-53808.rb ":
|
39
51
|
:original_result: {}
|
40
|
-
|
41
|
-
|
52
|
+
|
53
|
+
:created_at: 2011-04-07 09:40:27.899000 +10:00
|
54
|
+
"/tmp/textmate-command-53879.rb ":
|
42
55
|
:original_result: {}
|
43
|
-
|
44
|
-
|
56
|
+
|
57
|
+
:created_at: 2011-04-07 09:40:19.329000 +10:00
|
58
|
+
"/tmp/textmate-command-53922.rb ":
|
45
59
|
:original_result: {}
|
46
|
-
|
47
|
-
|
60
|
+
|
61
|
+
:created_at: 2011-04-07 09:40:25.642000 +10:00
|
62
|
+
"/tmp/textmate-command-53945.rb ":
|
48
63
|
:original_result: {}
|
49
|
-
|
50
|
-
|
64
|
+
|
65
|
+
:created_at: 2011-04-07 09:45:07.593000 +10:00
|
66
|
+
"/tmp/textmate-command-53973.rb ":
|
51
67
|
:original_result: {}
|
52
|
-
|
53
|
-
|
68
|
+
|
69
|
+
:created_at: 2011-04-07 09:31:04.745000 +10:00
|
70
|
+
"/tmp/textmate-command-54115.rb ":
|
54
71
|
:original_result: {}
|
55
|
-
|
56
|
-
|
72
|
+
|
73
|
+
:created_at: 2011-04-07 09:41:11.360000 +10:00
|
74
|
+
"/tmp/textmate-command-54165.rb ":
|
57
75
|
:original_result: {}
|
58
|
-
|
59
|
-
|
76
|
+
|
77
|
+
:created_at: 2011-04-07 09:34:39.531000 +10:00
|
78
|
+
"/tmp/textmate-command-54196.rb ":
|
60
79
|
:original_result: {}
|
61
|
-
|
62
|
-
|
80
|
+
|
81
|
+
:created_at: 2011-04-07 09:43:40.667000 +10:00
|
82
|
+
"/tmp/textmate-command-54230.rb ":
|
63
83
|
:original_result: {}
|
64
|
-
|
65
|
-
|
84
|
+
|
85
|
+
:created_at: 2011-04-07 09:37:05.387000 +10:00
|
86
|
+
"/tmp/textmate-command-54246.rb ":
|
66
87
|
:original_result: {}
|
67
|
-
|
68
|
-
|
88
|
+
|
89
|
+
:created_at: 2011-04-07 09:41:19.794000 +10:00
|
90
|
+
"/tmp/textmate-command-54347.rb ":
|
69
91
|
:original_result: {}
|
70
|
-
|
71
|
-
|
92
|
+
|
93
|
+
:created_at: 2011-04-07 09:52:28.383000 +10:00
|
94
|
+
"/tmp/textmate-command-54376.rb ":
|
72
95
|
:original_result: {}
|
73
|
-
|
74
|
-
|
96
|
+
|
97
|
+
:created_at: 2011-04-07 09:52:41.048000 +10:00
|
98
|
+
"/tmp/textmate-command-54411.rb ":
|
75
99
|
:original_result: {}
|
76
|
-
|
77
|
-
|
100
|
+
|
101
|
+
:created_at: 2011-04-07 09:44:15.547000 +10:00
|
102
|
+
"/tmp/textmate-command-54504.rb ":
|
78
103
|
:original_result: {}
|
79
|
-
|
80
|
-
|
104
|
+
|
105
|
+
:created_at: 2011-04-07 10:10:21.027000 +10:00
|
106
|
+
"/tmp/textmate-command-54532.rb ":
|
81
107
|
:original_result: {}
|
82
|
-
|
83
|
-
|
108
|
+
|
109
|
+
:created_at: 2011-04-07 10:13:21.371000 +10:00
|
110
|
+
"/tmp/textmate-command-54610.rb ":
|
84
111
|
:original_result: {}
|
85
|
-
|
86
|
-
|
112
|
+
|
113
|
+
:created_at: 2011-04-07 10:01:25.539000 +10:00
|
114
|
+
"/tmp/textmate-command-54705.rb ":
|
87
115
|
:original_result: {}
|
88
|
-
|
89
|
-
|
116
|
+
|
117
|
+
:created_at: 2011-04-07 10:01:34.077000 +10:00
|
118
|
+
"/tmp/textmate-command-54728.rb ":
|
90
119
|
:original_result: {}
|
91
|
-
|
92
|
-
|
120
|
+
|
121
|
+
:created_at: 2011-04-07 10:02:40.598000 +10:00
|
122
|
+
"/tmp/textmate-command-54759.rb ":
|
93
123
|
:original_result: {}
|
94
|
-
|
95
|
-
|
124
|
+
|
125
|
+
:created_at: 2011-04-07 10:04:49.009000 +10:00
|
126
|
+
"/tmp/textmate-command-54808.rb ":
|
96
127
|
:original_result: {}
|
97
|
-
|
98
|
-
|
128
|
+
|
129
|
+
:created_at: 2011-04-07 10:27:20.890000 +10:00
|
130
|
+
"/tmp/textmate-command-58245.rb ":
|
99
131
|
:original_result: {}
|
100
|
-
|
101
|
-
|
132
|
+
|
133
|
+
:created_at: 2011-04-07 13:00:24.367000 +10:00
|
134
|
+
"/tmp/textmate-command-58287.rb ":
|
102
135
|
:original_result: {}
|
103
|
-
|
104
|
-
|
136
|
+
|
137
|
+
:created_at: 2011-04-07 12:57:04.458000 +10:00
|
138
|
+
"/tmp/textmate-command-58321.rb ":
|
105
139
|
:original_result: {}
|
106
|
-
|
107
|
-
|
140
|
+
|
141
|
+
:created_at: 2011-04-07 12:58:56.161000 +10:00
|
142
|
+
"/tmp/textmate-command-58391.rb ":
|
108
143
|
:original_result: {}
|
109
|
-
|
110
|
-
|
144
|
+
|
145
|
+
:created_at: 2011-04-07 12:52:08.339000 +10:00
|
146
|
+
"/tmp/textmate-command-58525.rb ":
|
111
147
|
:original_result: {}
|
112
|
-
|
113
|
-
|
148
|
+
|
149
|
+
:created_at: 2011-04-07 12:55:25.003000 +10:00
|
150
|
+
"/tmp/textmate-command-58558.rb ":
|
114
151
|
:original_result: {}
|
115
|
-
|
116
|
-
|
152
|
+
|
153
|
+
:created_at: 2011-04-07 13:04:28.992000 +10:00
|
154
|
+
"/tmp/textmate-command-58602.rb ":
|
117
155
|
:original_result: {}
|
118
|
-
|
119
|
-
|
156
|
+
|
157
|
+
:created_at: 2011-04-07 13:08:34.168000 +10:00
|
158
|
+
"/tmp/textmate-command-58648.rb ":
|
120
159
|
:original_result: {}
|
121
|
-
|
122
|
-
|
160
|
+
|
161
|
+
:created_at: 2011-04-07 13:04:20.528000 +10:00
|
162
|
+
"/tmp/textmate-command-58693.rb ":
|
123
163
|
:original_result: {}
|
124
|
-
|
125
|
-
|
164
|
+
|
165
|
+
:created_at: 2011-04-07 12:58:20.478000 +10:00
|
166
|
+
"/tmp/textmate-command-58736.rb ":
|
126
167
|
:original_result: {}
|
127
|
-
|
128
|
-
|
168
|
+
|
169
|
+
:created_at: 2011-04-07 13:02:26.377000 +10:00
|
170
|
+
"/tmp/textmate-command-58765.rb ":
|
129
171
|
:original_result: {}
|
130
|
-
|
131
|
-
|
172
|
+
|
173
|
+
:created_at: 2011-04-07 12:55:17.849000 +10:00
|
174
|
+
"/tmp/textmate-command-58941.rb ":
|
132
175
|
:original_result: {}
|
133
|
-
|
134
|
-
|
176
|
+
|
177
|
+
:created_at: 2011-04-07 13:07:49.694000 +10:00
|
178
|
+
"/tmp/textmate-command-59015.rb ":
|
135
179
|
:original_result: {}
|
136
|
-
|
137
|
-
|
180
|
+
|
181
|
+
:created_at: 2011-04-07 13:06:31.501000 +10:00
|
182
|
+
"/tmp/textmate-command-59035.rb ":
|
138
183
|
:original_result: {}
|
139
|
-
|
140
|
-
|
184
|
+
|
185
|
+
:created_at: 2011-04-07 13:03:31.368000 +10:00
|
186
|
+
"/tmp/textmate-command-59071.rb ":
|
141
187
|
:original_result: {}
|
142
|
-
|
143
|
-
|
188
|
+
|
189
|
+
:created_at: 2011-04-07 13:08:58.560000 +10:00
|
190
|
+
"/tmp/textmate-command-59137.rb ":
|
144
191
|
:original_result: {}
|
145
|
-
|
146
|
-
|
192
|
+
|
193
|
+
:created_at: 2011-04-07 13:09:11.584000 +10:00
|
194
|
+
"/tmp/textmate-command-59162.rb ":
|
147
195
|
:original_result: {}
|
148
|
-
|
149
|
-
|
196
|
+
|
197
|
+
:created_at: 2011-04-07 13:08:48.527000 +10:00
|
198
|
+
"/tmp/textmate-command-59218.rb ":
|
150
199
|
:original_result: {}
|
151
|
-
|
200
|
+
|
201
|
+
:created_at: 2011-04-07 13:16:29.488000 +10:00
|
202
|
+
"/tmp/textmate-command-22299.rb ":
|
203
|
+
:original_result: {}
|
204
|
+
|
205
|
+
:created_at: 2011-04-08 23:44:29.387143 +10:00
|
206
|
+
"/tmp/textmate-command-22367.rb ":
|
207
|
+
:original_result: {}
|
208
|
+
|
209
|
+
:created_at: 2011-04-08 23:45:02.840619 +10:00
|
210
|
+
"/tmp/textmate-command-22438.rb ":
|
211
|
+
:original_result: {}
|
212
|
+
|
213
|
+
:created_at: 2011-04-08 23:45:30.650235 +10:00
|
214
|
+
"/tmp/textmate-command-22544.rb ":
|
215
|
+
:original_result: {}
|
216
|
+
|
217
|
+
:created_at: 2011-04-08 23:47:11.009880 +10:00
|
218
|
+
"/tmp/textmate-command-54823.rb ":
|
219
|
+
:original_result: {}
|
220
|
+
|
221
|
+
:created_at: 2011-04-11 06:34:55.765170 +10:00
|
222
|
+
"/tmp/textmate-command-54890.rb ":
|
223
|
+
:original_result: {}
|
224
|
+
|
225
|
+
:created_at: 2011-04-11 06:35:16.806386 +10:00
|
metadata
CHANGED
@@ -1,50 +1,57 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamster
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.3
|
4
5
|
prerelease:
|
5
|
-
version: 0.4.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Simon Harris
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-10-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: rspec
|
17
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
18
|
+
requirements:
|
21
19
|
- - ~>
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version:
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2'
|
24
22
|
type: :development
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: simplecov
|
28
23
|
prerelease: false
|
29
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: simplecov
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
30
33
|
none: false
|
31
|
-
requirements:
|
34
|
+
requirements:
|
32
35
|
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version:
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0.3'
|
35
38
|
type: :development
|
36
|
-
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0.3'
|
37
46
|
description: Efficient, Immutable, Thread-Safe Collection classes for Ruby
|
38
47
|
email: haruki_zaemon@mac.com
|
39
48
|
executables: []
|
40
|
-
|
41
49
|
extensions: []
|
42
|
-
|
43
|
-
extra_rdoc_files:
|
50
|
+
extra_rdoc_files:
|
44
51
|
- README.rdoc
|
45
52
|
- History.rdoc
|
46
53
|
- LICENSE
|
47
|
-
files:
|
54
|
+
files:
|
48
55
|
- lib/hamster/core_ext/enumerable.rb
|
49
56
|
- lib/hamster/core_ext/enumerator.rb
|
50
57
|
- lib/hamster/core_ext/io.rb
|
@@ -136,6 +143,8 @@ files:
|
|
136
143
|
- spec/hamster/hash/each_spec.rb
|
137
144
|
- spec/hamster/hash/empty_spec.rb
|
138
145
|
- spec/hamster/hash/eql_spec.rb
|
146
|
+
- spec/hamster/hash/except_spec.rb
|
147
|
+
- spec/hamster/hash/fetch_spec.rb
|
139
148
|
- spec/hamster/hash/filter_spec.rb
|
140
149
|
- spec/hamster/hash/find_spec.rb
|
141
150
|
- spec/hamster/hash/get_spec.rb
|
@@ -151,6 +160,7 @@ files:
|
|
151
160
|
- spec/hamster/hash/reduce_spec.rb
|
152
161
|
- spec/hamster/hash/remove_spec.rb
|
153
162
|
- spec/hamster/hash/size_spec.rb
|
163
|
+
- spec/hamster/hash/slice_spec.rb
|
154
164
|
- spec/hamster/hash/uniq_spec.rb
|
155
165
|
- spec/hamster/hash/values_spec.rb
|
156
166
|
- spec/hamster/immutable/copying_spec.rb
|
@@ -483,30 +493,26 @@ files:
|
|
483
493
|
- LICENSE
|
484
494
|
homepage: http://github.com/harukizaemon/hamster
|
485
495
|
licenses: []
|
486
|
-
|
487
496
|
post_install_message:
|
488
497
|
rdoc_options: []
|
489
|
-
|
490
|
-
require_paths:
|
498
|
+
require_paths:
|
491
499
|
- lib
|
492
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
500
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
493
501
|
none: false
|
494
|
-
requirements:
|
495
|
-
- -
|
496
|
-
- !ruby/object:Gem::Version
|
502
|
+
requirements:
|
503
|
+
- - ! '>='
|
504
|
+
- !ruby/object:Gem::Version
|
497
505
|
version: 1.8.7
|
498
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
506
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
499
507
|
none: false
|
500
|
-
requirements:
|
501
|
-
- -
|
502
|
-
- !ruby/object:Gem::Version
|
503
|
-
version:
|
508
|
+
requirements:
|
509
|
+
- - ! '>='
|
510
|
+
- !ruby/object:Gem::Version
|
511
|
+
version: '0'
|
504
512
|
requirements: []
|
505
|
-
|
506
513
|
rubyforge_project:
|
507
|
-
rubygems_version: 1.
|
514
|
+
rubygems_version: 1.8.23
|
508
515
|
signing_key:
|
509
516
|
specification_version: 3
|
510
517
|
summary: Efficient, Immutable, Thread-Safe Collection classes for Ruby
|
511
518
|
test_files: []
|
512
|
-
|