google_hash 0.8.4 → 0.8.5

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: d23f86698ca9d5943672bcedce1b34d927bb8c9e
4
- data.tar.gz: 7998d5064e4ec2ca240370c73d36f3414c5e5015
3
+ metadata.gz: c8edcf102d93a5c863f984e01c6359767fde17a5
4
+ data.tar.gz: 7b9c417d19e4b7e91f57c28b12a38f41d70827b7
5
5
  SHA512:
6
- metadata.gz: 286db97c34501bf64c1356a1ed34e5fe1a4db4a28e2a79eabdeef401f1352f33b3806ac53589697a04f2d2529943c55256232eefb9b5afed88d7410125b93129
7
- data.tar.gz: 79c9cedde68e56d87160c7178524895fcf48d2d57a97eab17bbeabfc9a6426a000937fdecc6b88ad23d9b159a64700333094e17ddd4d607782eef3e2c972e70a
6
+ metadata.gz: 0d601b30366d4daf143984e72ae890bc253ec1e04e7d7d2a5d155bc3f31e629967f2d88c81f455d494b5cf569620803511571bbdbb195975c45ae773cd43b500
7
+ data.tar.gz: 66a4a74fd1201911475592756a1c7b4a21e9ab72cfa6d535973b4c000700bbad56159b59120e23527dd16e8852e75350f4c20c4e2b59a79ad33f93998b21040c
@@ -1,3 +1,6 @@
1
+ 0.8.5
2
+ fix build for 2.2.x [I hope]
3
+
1
4
  0.8.4
2
5
  attempt to fix poor build/gem distro
3
6
 
data/Rakefile CHANGED
@@ -8,7 +8,9 @@ Jeweler::Tasks.new do |gemspec|
8
8
  gemspec.email = "rogerdpack@gmail.com"
9
9
  gemspec.homepage = "http://github.com/rdp/ruby_google_hash"
10
10
  gemspec.authors = ["rogerdpack"]
11
- gemspec.add_runtime_dependency 'sane', '~> 0' # real dependency as it's used for building the gem, in the extconf.rb file itself
11
+ gemspec.add_runtime_dependency 'sane', '~> 0' # real dependency as it's used for building the gem, in the extconf.rb file itself, but not actually required by the gem at runtime
12
12
  gemspec.add_development_dependency('hitimes', '~> 0')
13
+ gemspec.add_development_dependency('rspec', '~> 2.14.1')
14
+ gemspec.add_development_dependency('jeweler')
13
15
  end
14
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.4
1
+ 0.8.5
@@ -1,4 +1,5 @@
1
- rm *.cpp
2
- rm *.o
3
- rm *.so
4
- rm *.def
1
+ rm *.cpp
2
+ rm *.o
3
+ rm *.so
4
+ rm *.def
5
+ rm *.bundle
@@ -0,0 +1,4 @@
1
+ ./clean.bat
2
+ ruby extconf.rb -j8
3
+ make -j8
4
+ ./spec.bat
File without changes
@@ -105,7 +105,13 @@ struct eqrb
105
105
  };
106
106
 
107
107
  #ifndef RBIGNUM_DIGITS
108
- # define RBIGNUM_DIGITS(a) RBIGNUM(a)->digits
108
+
109
+ # ifdef RBIGNUM
110
+ /* 1.8 'ish */
111
+ # define RBIGNUM_DIGITS(a) RBIGNUM(a)->digits
112
+ # else
113
+ /* 2.2.0 has no way to do this? */
114
+ # endif
109
115
  #endif
110
116
 
111
117
  struct hashrb
@@ -129,14 +135,15 @@ struct hashrb
129
135
  case T_SYMBOL:
130
136
  // ltodo
131
137
  return hash_me;
132
- case T_BIGNUM:
133
- return LONG2FIX(((long*)(RBIGNUM_DIGITS(hash_me)))[0]); // its first digit...I'm thinkin'
134
- // not sure if this is faster or not...
135
- //case T_STRING:
138
+ // we don't actually do bignums yet, though rb_big2int might help here...
139
+ // case T_BIGNUM:
140
+ // return LONG2FIX(((long*)(RBIGNUM_DIGITS(hash_me)))[0]); // its first digit...I'm thinkin'
141
+ // not sure if this is faster or not...
142
+ //case T_STRING:
136
143
  //return H(StringValueCStr(hash_me)); // populate/lookup 0.26 -> 0.23 [core is 0.16 somehow]
137
144
  // perhaps they cache?
138
145
  //return H(RSTRING_PTR(hash_me)); // 0.23 -> -.22
139
- }
146
+ }
140
147
 
141
148
  VALUE hval = rb_funcall(hash_me, id_hash, 0);
142
149
 
@@ -144,8 +151,8 @@ struct hashrb
144
151
  switch (TYPE(hval)) {
145
152
  case T_FIXNUM:
146
153
  return hval;
147
- case T_BIGNUM:
148
- return LONG2FIX(((long*)(RBIGNUM_DIGITS(hval)))[0]);
154
+ //??case T_BIGNUM:
155
+ //?? return LONG2FIX(((long*)(RBIGNUM_DIGITS(hval)))[0]);
149
156
  default:
150
157
  hval = rb_to_int(hval);
151
158
  goto retry;
@@ -179,7 +186,7 @@ static void mark_hash_map_values(RCallback *incoming) {
179
186
  }
180
187
 
181
188
  static void free_hash_callback(RCallback* cb) {
182
- delete cb->hash_map; // I had this line commented out one? huh?
189
+ delete cb->hash_map; // I had this line commented out once? huh?
183
190
  }
184
191
 
185
192
  static VALUE
@@ -2,14 +2,17 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: google_hash 0.8.5 ruby lib
6
+ # stub: ext/extconf.rb
5
7
 
6
8
  Gem::Specification.new do |s|
7
9
  s.name = "google_hash"
8
- s.version = "0.8.2"
10
+ s.version = "0.8.5"
9
11
 
10
12
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
13
+ s.require_paths = ["lib"]
11
14
  s.authors = ["rogerdpack"]
12
- s.date = "2014-05-26"
15
+ s.date = "2015-01-21"
13
16
  s.description = "Ruby wrappers to the google hash library"
14
17
  s.email = "rogerdpack@gmail.com"
15
18
  s.extensions = ["ext/extconf.rb"]
@@ -25,9 +28,9 @@ Gem::Specification.new do |s|
25
28
  "TODO",
26
29
  "VERSION",
27
30
  "ext/clean.bat",
28
- "ext/clean.sh",
29
31
  "ext/extconf.rb",
30
32
  "ext/go.bat",
33
+ "ext/go.sh",
31
34
  "ext/sparsehash-2.0.2/AUTHORS",
32
35
  "ext/sparsehash-2.0.2/COPYING",
33
36
  "ext/sparsehash-2.0.2/ChangeLog",
@@ -137,23 +140,28 @@ Gem::Specification.new do |s|
137
140
  "to_build_locally_run_ext_go_bat"
138
141
  ]
139
142
  s.homepage = "http://github.com/rdp/ruby_google_hash"
140
- s.require_paths = ["lib"]
141
- s.rubygems_version = "1.8.23"
143
+ s.rubygems_version = "2.4.5"
142
144
  s.summary = "Ruby wrappers to the google hash library"
143
145
 
144
146
  if s.respond_to? :specification_version then
145
- s.specification_version = 3
147
+ s.specification_version = 4
146
148
 
147
149
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
148
- s.add_runtime_dependency(%q<sane>, [">= 0"])
149
- s.add_development_dependency(%q<hitimes>, [">= 0"])
150
+ s.add_runtime_dependency(%q<sane>, ["~> 0"])
151
+ s.add_development_dependency(%q<hitimes>, ["~> 0"])
152
+ s.add_development_dependency(%q<rspec>, ["~> 2.14.1"])
153
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
150
154
  else
151
- s.add_dependency(%q<sane>, [">= 0"])
152
- s.add_dependency(%q<hitimes>, [">= 0"])
155
+ s.add_dependency(%q<sane>, ["~> 0"])
156
+ s.add_dependency(%q<hitimes>, ["~> 0"])
157
+ s.add_dependency(%q<rspec>, ["~> 2.14.1"])
158
+ s.add_dependency(%q<jeweler>, [">= 0"])
153
159
  end
154
160
  else
155
- s.add_dependency(%q<sane>, [">= 0"])
156
- s.add_dependency(%q<hitimes>, [">= 0"])
161
+ s.add_dependency(%q<sane>, ["~> 0"])
162
+ s.add_dependency(%q<hitimes>, ["~> 0"])
163
+ s.add_dependency(%q<rspec>, ["~> 2.14.1"])
164
+ s.add_dependency(%q<jeweler>, [">= 0"])
157
165
  end
158
166
  end
159
167
 
@@ -215,8 +215,7 @@ describe "google_hash" do
215
215
  end
216
216
  end
217
217
 
218
- it "should do bignum to doubles et al" do
219
- a = GoogleHashDenseDoubleToDouble.new
218
+ def test_big_numbers a
220
219
  a[10000000000000000000] = 1
221
220
  a[10000000000000000000].should == 1
222
221
  a[1] = 10000000000000000000
@@ -225,13 +224,18 @@ describe "google_hash" do
225
224
  a[4].should == 3
226
225
  a[10000000000000000000] = 10000000000000000000
227
226
  a[10000000000000000000].should == 10000000000000000000
227
+ end
228
+
229
+ it "should do bignum to doubles et al" do
230
+ test_big_numbers( GoogleHashDenseDoubleToDouble.new)
228
231
  end
229
232
 
230
- it "should allow for storing true bignums" do
231
- pending
232
- 'TODO: same as above plus the following:'
233
- a = GoogleHashDenseBignumToRuby.new
234
- a[10000000000000000000] = 'abc'
233
+ it "should allow for storing true BigNum" do
234
+ pending 'caring about bignums at all and even having the classes in there'
235
+ test_big_numbers(GoogleHashDenseBigNumToRuby.new)
236
+ # and test the to ruby aspect
237
+ a[10000000000000000000] = 'abc'
238
+ a[10000000000000000000].should == 'abc'
235
239
  end
236
240
 
237
241
  it "should have an Enumerator return for values, keys [?] instead of an array?"
metadata CHANGED
@@ -1,43 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - rogerdpack
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-06 00:00:00.000000000 Z
11
+ date: 2015-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sane
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
15
22
  version_requirements: !ruby/object:Gem::Requirement
16
23
  requirements:
17
- - - ~>
24
+ - - "~>"
18
25
  - !ruby/object:Gem::Version
19
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: hitimes
20
29
  requirement: !ruby/object:Gem::Requirement
21
30
  requirements:
22
- - - ~>
31
+ - - "~>"
23
32
  - !ruby/object:Gem::Version
24
33
  version: '0'
34
+ type: :development
25
35
  prerelease: false
26
- type: :runtime
27
- - !ruby/object:Gem::Dependency
28
- name: hitimes
29
36
  version_requirements: !ruby/object:Gem::Requirement
30
37
  requirements:
31
- - - ~>
38
+ - - "~>"
32
39
  - !ruby/object:Gem::Version
33
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
34
43
  requirement: !ruby/object:Gem::Requirement
35
44
  requirements:
36
- - - ~>
45
+ - - "~>"
37
46
  - !ruby/object:Gem::Version
38
- version: '0'
47
+ version: 2.14.1
48
+ type: :development
39
49
  prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 2.14.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: jeweler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
40
62
  type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
41
69
  description: Ruby wrappers to the google hash library
42
70
  email: rogerdpack@gmail.com
43
71
  executables: []
@@ -54,9 +82,9 @@ files:
54
82
  - TODO
55
83
  - VERSION
56
84
  - ext/clean.bat
57
- - ext/clean.sh
58
85
  - ext/extconf.rb
59
86
  - ext/go.bat
87
+ - ext/go.sh
60
88
  - ext/sparsehash-2.0.2/AUTHORS
61
89
  - ext/sparsehash-2.0.2/COPYING
62
90
  - ext/sparsehash-2.0.2/ChangeLog
@@ -167,24 +195,24 @@ files:
167
195
  homepage: http://github.com/rdp/ruby_google_hash
168
196
  licenses: []
169
197
  metadata: {}
170
- post_install_message:
198
+ post_install_message:
171
199
  rdoc_options: []
172
200
  require_paths:
173
201
  - lib
174
202
  required_ruby_version: !ruby/object:Gem::Requirement
175
203
  requirements:
176
- - - '>='
204
+ - - ">="
177
205
  - !ruby/object:Gem::Version
178
206
  version: '0'
179
207
  required_rubygems_version: !ruby/object:Gem::Requirement
180
208
  requirements:
181
- - - '>='
209
+ - - ">="
182
210
  - !ruby/object:Gem::Version
183
211
  version: '0'
184
212
  requirements: []
185
- rubyforge_project:
186
- rubygems_version: 2.2.2
187
- signing_key:
213
+ rubyforge_project:
214
+ rubygems_version: 2.4.5
215
+ signing_key:
188
216
  specification_version: 4
189
217
  summary: Ruby wrappers to the google hash library
190
218
  test_files: []
@@ -1,4 +0,0 @@
1
- rm *.cpp
2
- rm *.o
3
- rm *.so
4
- rm *.def