hashery 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/.ruby +57 -92
  2. data/.yardopts +8 -0
  3. data/COPYING.rdoc +45 -0
  4. data/HISTORY.rdoc +18 -0
  5. data/QED.rdoc +1 -0
  6. data/README.rdoc +42 -16
  7. data/lib/hashery.rb +16 -9
  8. data/lib/hashery.yml +57 -92
  9. data/lib/hashery/association.rb +3 -1
  10. data/lib/hashery/basic_object.rb +74 -0
  11. data/lib/hashery/basic_struct.rb +288 -1
  12. data/lib/hashery/basicobject.rb +1 -74
  13. data/lib/hashery/basicstruct.rb +1 -280
  14. data/lib/hashery/casting_hash.rb +171 -1
  15. data/lib/hashery/castinghash.rb +1 -171
  16. data/lib/hashery/core_ext.rb +82 -0
  17. data/lib/hashery/dictionary.rb +3 -0
  18. data/lib/hashery/fuzzy_hash.rb +154 -1
  19. data/lib/hashery/fuzzyhash.rb +1 -154
  20. data/lib/hashery/ini.rb +3 -2
  21. data/lib/hashery/key_hash.rb +186 -0
  22. data/lib/hashery/keyhash.rb +1 -0
  23. data/lib/hashery/linked_list.rb +195 -1
  24. data/lib/hashery/linkedlist.rb +1 -195
  25. data/lib/hashery/lru_hash.rb +273 -1
  26. data/lib/hashery/lruhash.rb +1 -273
  27. data/lib/hashery/open_cascade.rb +99 -1
  28. data/lib/hashery/open_hash.rb +77 -1
  29. data/lib/hashery/opencascade.rb +1 -99
  30. data/lib/hashery/openhash.rb +1 -77
  31. data/lib/hashery/ordered_hash.rb +168 -1
  32. data/lib/hashery/orderedhash.rb +1 -167
  33. data/lib/hashery/property_hash.rb +97 -1
  34. data/lib/hashery/propertyhash.rb +1 -97
  35. data/lib/hashery/query_hash.rb +35 -1
  36. data/lib/hashery/queryhash.rb +1 -35
  37. data/lib/hashery/stash.rb +3 -174
  38. data/lib/hashery/static_hash.rb +48 -1
  39. data/lib/hashery/statichash.rb +1 -48
  40. data/qed/06_opencascade.rdoc +12 -12
  41. data/test/case_association.rb +29 -15
  42. data/test/case_basicstruct.rb +192 -0
  43. data/test/case_dictionary.rb +149 -109
  44. data/test/case_keyhash.rb +175 -0
  45. data/test/case_opencascade.rb +89 -43
  46. data/test/case_openhash.rb +15 -11
  47. metadata +85 -78
  48. data/LICENSE +0 -206
  49. data/NOTICE +0 -11
  50. data/lib/hashery/sparse_array.rb +0 -1
  51. data/lib/hashery/sparsearray.rb +0 -577
  52. data/test/case_openobject.rb +0 -130
  53. data/test/case_sparsearray.rb +0 -316
  54. data/test/case_stash.rb +0 -131
data/.ruby CHANGED
@@ -1,98 +1,63 @@
1
- ---
2
- name: hashery
3
- company: RubyWorks
4
- title: Hashery
5
- contact: Trans <transfire@gmail.com>
6
- maintainers:
7
- - Trans <transfire@gmail.com>
8
- pom_verison: 1.0.0
9
- requires:
10
- - group:
1
+ ---
2
+ source:
3
+ - var
4
+ authors:
5
+ - name: Trans
6
+ email: transfire@gmail.com
7
+ - name: Kirk Haines
8
+ - name: Robert Klemme
9
+ - name: Jan Molic
10
+ - name: George Moschovitis
11
+ - name: Jeena Paradies
12
+ - name: Erik Veenstra
13
+ copyrights:
14
+ - holder: Rubyworks
15
+ year: '2010'
16
+ license: BSD-2-Clause
17
+ replacements: []
18
+ alternatives: []
19
+ requirements:
20
+ - name: blankslate
21
+ - name: detroit
22
+ groups:
11
23
  - build
12
- name: syckle
13
- version: 0+
14
- - group:
24
+ development: true
25
+ - name: qed
26
+ groups:
15
27
  - test
16
- name: qed
17
- version: 0+
18
- resources:
19
- repo: git://github.com/rubyworks/hashery.git
28
+ development: true
29
+ - name: lemon
30
+ groups:
31
+ - test
32
+ development: true
33
+ dependencies: []
34
+ conflicts: []
35
+ repositories:
36
+ - uri: git://github.com/rubyworks/hashery.git
37
+ scm: git
38
+ name: upstream
39
+ resources:
40
+ home: http://rubyworks.github.com/hashery
20
41
  code: http://github.com/rubyworks/hashery
21
- api: http://rubyworks.github.com/hashery/docs/api
22
42
  mail: http://groups.google.com/group/rubyworks-mailinglist
23
- host: http://rubygems.org/gems/hashery
43
+ docs: http://rubydocs.info/gems/hashery/frames
24
44
  wiki: http://wiki.github.com/rubyworks/hashery
25
- home: http://rubyworks.github.com/hashery
26
- manifest:
27
- - .ruby
28
- - lib/hashery/association.rb
29
- - lib/hashery/basic_struct.rb
30
- - lib/hashery/basicobject.rb
31
- - lib/hashery/basicstruct.rb
32
- - lib/hashery/casting_hash.rb
33
- - lib/hashery/castinghash.rb
34
- - lib/hashery/dictionary.rb
35
- - lib/hashery/fuzzy_hash.rb
36
- - lib/hashery/fuzzyhash.rb
37
- - lib/hashery/ini.rb
38
- - lib/hashery/linked_list.rb
39
- - lib/hashery/linkedlist.rb
40
- - lib/hashery/lru_hash.rb
41
- - lib/hashery/lruhash.rb
42
- - lib/hashery/memoizer.rb
43
- - lib/hashery/open_cascade.rb
44
- - lib/hashery/open_hash.rb
45
- - lib/hashery/open_object.rb
46
- - lib/hashery/opencascade.rb
47
- - lib/hashery/openhash.rb
48
- - lib/hashery/openobject.rb
49
- - lib/hashery/ordered_hash.rb
50
- - lib/hashery/orderedhash.rb
51
- - lib/hashery/ostructable.rb
52
- - lib/hashery/property_hash.rb
53
- - lib/hashery/propertyhash.rb
54
- - lib/hashery/query_hash.rb
55
- - lib/hashery/queryhash.rb
56
- - lib/hashery/sparse_array.rb
57
- - lib/hashery/sparsearray.rb
58
- - lib/hashery/stash.rb
59
- - lib/hashery/static_hash.rb
60
- - lib/hashery/statichash.rb
61
- - lib/hashery.rb
62
- - lib/hashery.yml
63
- - qed/01_openhash.rdoc
64
- - qed/02_queryhash.rdoc
65
- - qed/03_castinghash.rdoc
66
- - qed/04_statichash.rdoc
67
- - qed/05_association.rdoc
68
- - qed/06_opencascade.rdoc
69
- - qed/07_fuzzyhash.rdoc
70
- - qed/08_properyhash.rdoc
71
- - qed/09_ostructable.rdoc
72
- - qed/applique/ae.rb
73
- - test/case_association.rb
74
- - test/case_dictionary.rb
75
- - test/case_opencascade.rb
76
- - test/case_openhash.rb
77
- - test/case_openobject.rb
78
- - test/case_sparsearray.rb
79
- - test/case_stash.rb
80
- - HISTORY.rdoc
81
- - LICENSE
82
- - README.rdoc
83
- - NOTICE
84
- version: 1.4.0
85
- licenses:
86
- - Apache 2.0
87
- copyright: Copyright (c) 2010 Thomas Sawyer
88
- description: The Hashery is a collection of Hash-like classes, spun-off from the original Ruby Facets library. Included are the widely used OrderedHash, the related but more featured Dictionary class, a number of open classes, similiar to the standard OpenStruct and a few variations on the standard Hash.
45
+ gems: http://rubygems.org/gems/hashery
46
+ extra: {}
47
+ load_path:
48
+ - lib
49
+ revision: 0
50
+ created: '2010-04-21'
89
51
  summary: Facets-bread collection of Hash-like classes.
90
- authors:
91
- - Thomas Sawyer
92
- - Kirk Haines
93
- - Robert Klemme
94
- - Jan Molic
95
- - George Moschovitis
96
- - Jeena Paradies
97
- - Erik Veenstra
98
- created: 2010-04-21
52
+ title: Hashery
53
+ version: 1.5.0
54
+ name: hashery
55
+ description: ! 'The Hashery is a collection of Hash-like classes, spun-off from the
56
+ original
57
+
58
+ Ruby Facets library. Included are the widely used OrderedHash, the related but
59
+
60
+ more featured Dictionary class, a number of open classes, similiar to the
61
+
62
+ standard OpenStruct and a few variations on the standard Hash.'
63
+ date: '2011-11-10'
@@ -0,0 +1,8 @@
1
+ --output-dir doc
2
+ --title Hashery
3
+ --protected
4
+ --private
5
+ lib/
6
+ -
7
+ [A-Z]*.*
8
+
@@ -0,0 +1,45 @@
1
+ = COPYRIGHT NOTICES
2
+
3
+ == Hashery
4
+
5
+ Copyright:: (c) 2009 Thomas Sawyer, Rubyworks
6
+ License:: BSD-2-Clause
7
+ Website:: http://rubyworks.github.com/hashery
8
+
9
+ Copyright (c) 2009 Thomas Sawyer, Rubyworks
10
+
11
+ Redistribution and use in source and binary forms, with or without modification, are
12
+ permitted provided that the following conditions are met:
13
+
14
+ 1. Redistributions of source code must retain the above copyright notice, this list of
15
+ conditions and the following disclaimer.
16
+
17
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
18
+ of conditions and the following disclaimer in the documentation and/or other materials
19
+ provided with the distribution.
20
+
21
+ THIS SOFTWARE IS PROVIDED BY Thomas Sawyer ``AS IS'' AND ANY EXPRESS OR IMPLIED
22
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
23
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Thomas Sawyer OR
24
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+
31
+ The views and conclusions contained in the software and documentation are those of the
32
+ authors and should not be interpreted as representing official policies, either expressed
33
+ or implied, of Thomas Sawyer.
34
+
35
+ == BasicObject
36
+
37
+ Copyright:: (c) 2004 Jim Weirich
38
+ Website:: http://rake.rubyforge.org
39
+
40
+ BasicObject class is a variation of Jim Weirich's BlankSlate class.
41
+
42
+ BlankSlate
43
+ Copyright 2004 by Jim Weirich (jim@weirichhouse.org).
44
+ All rights reserved.
45
+
@@ -1,5 +1,23 @@
1
1
  = RELEASE HISTORY
2
2
 
3
+ == 1.5.0 / 2011-11-10
4
+
5
+ In this release, CoreExt module has been addeed to encapsulate
6
+ methods that extend Ruby's core Hash class (there are only a few).
7
+ Presently these are only loaded when using `require 'hashery'`.
8
+ If you are cherry-picking from Hashery but still want the core
9
+ extensions, you need to use `require 'hasery/core_ext'` first.
10
+ In addition, BasicStruct class now has a #key method. And finally
11
+ this release switches licensing to BSD 2-Clause.
12
+
13
+ Changes:
14
+
15
+ * Use CoreExt mixin for core Hash extensions.
16
+ * Add BasicStruct#key method (b/c #index is deprecated in Ruby 1.9).
17
+ * Deprecate SparseArray class.
18
+ * Switch license to BSD-2-Clause license.
19
+
20
+
3
21
  == 1.4.0 / 2011-01-19
4
22
 
5
23
  This release includes a copy of Ruby Facets' BasicObject class, which
@@ -0,0 +1 @@
1
+
@@ -1,7 +1,12 @@
1
1
  = Hashery
2
2
 
3
- * home: http://rubyworks.github.com/hashery
4
- * work: http://github.com/rubyworks/hashery
3
+ {Homepage}[http://rubyworks.github.com/hashery] |
4
+ {Development}[http://github.com/rubyworks/hashery] |
5
+ {Report Issue}[http://github.com/rubyworks/hashery/issues] |
6
+ {Mailing List}[http://googlegroups.com/group.rubyworks-mailinglist] |
7
+ {IRC}[irc://irc.freenode.net/rubyworks]
8
+
9
+ {<img src="http://travis-ci.org/rubyworks/hashery.png" />}[http://travis-ci.org/rubyworks/hashery]
5
10
 
6
11
 
7
12
  == DESCRIPTION
@@ -41,7 +46,7 @@ via {Ruby Setup}[http://proutils.github.com/setup].
41
46
 
42
47
  == AUTHORS
43
48
 
44
- Developers whose code has contributed the project include:
49
+ Developers who have contributed code to the project include:
45
50
 
46
51
  * Kirk Haines
47
52
  * Joshua Hull
@@ -52,25 +57,46 @@ Developers whose code has contributed the project include:
52
57
  * Erik Veenstra
53
58
 
54
59
 
55
- == LICENSE
60
+ == CONTRIBUTE
61
+
62
+ Don't be a lump on a log. See an issue? Have a suggestion? Want to help?
63
+ Well git in there!
64
+
65
+ === Testing
66
+
67
+ Hashery uses QED[http://rubyworks.github.com/qed] and
68
+ Lemon[http://rubyworks.github.com/lemon] test frameworks.
69
+ Both are used in nearly the same fashion:
70
+
71
+ $ qed -Ilib qed/
72
+
73
+ And
74
+
75
+ $ lemon -Ilib test/
76
+
77
+ === Patches
78
+
79
+ Hashery's repository is hosted on GitHub[http://github.com/rubyworks/hashery].
80
+ If you'd like to offer up a fix or feature change then fork the repo and
81
+ submit a pull request (preferably in a topic branch). I assume you have heard
82
+ all the talk about proper {practices}[http://learn.github.com/p/intro.html],
83
+ so I won't bug you with it yet again.
84
+
85
+ === Donations
56
86
 
57
- (Apache 2.0 License)
87
+ Yes, we FOSS programmers need to eat too! ;-) No seriously, any help you can
88
+ offer goes a long way toward continued development of Rubyworks projects,
89
+ including Hashery. See the upper right-hand corner on the
90
+ Rubyworks[http://rubyworks.github.com] hompage. Thanks.
58
91
 
59
- Copyright (c) 2010 Thomas Sawyer
60
92
 
61
- Licensed under the Apache License, Version 2.0 (the "License");
62
- you may not use this program except in compliance with the License.
63
- You may obtain a copy of the License at
93
+ == COPYRIGHTS
64
94
 
65
- http://www.apache.org/licenses/LICENSE-2.0
95
+ Copyright (c) 2010 Rubyworks
66
96
 
67
- Unless required by applicable law or agreed to in writing, software
68
- distributed under the License is distributed on an "AS IS" BASIS,
69
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
70
- See the License for the specific language governing permissions and
71
- limitations under the License.
97
+ Licensed under the *BSD-2-clause* license.
72
98
 
73
- See LICENSE file for further details.
99
+ See COPYING.rdoc file for further details.
74
100
 
75
101
  Some libraries included in the Hashery have special copyrights
76
102
  attributing specific authors. Please see each library script for
@@ -1,13 +1,20 @@
1
- require 'hashery/basicstruct'
2
- require 'hashery/castinghash'
1
+ require 'hashery/core_ext'
2
+
3
+ require 'hashery/basic_struct'
4
+ require 'hashery/casting_hash'
3
5
  require 'hashery/dictionary'
4
- require 'hashery/lruhash'
6
+ require 'hashery/fuzzy_hash'
7
+ require 'hashery/linked_list'
8
+ require 'hashery/lru_hash'
9
+ require 'hashery/key_hash'
5
10
  require 'hashery/memoizer'
6
- require 'hashery/opencascade'
7
- require 'hashery/openhash'
8
- require 'hashery/orderedhash'
11
+ require 'hashery/open_cascade'
12
+ require 'hashery/open_hash'
13
+ #require 'hashery/open_object'
14
+ require 'hashery/ordered_hash'
9
15
  require 'hashery/ostructable'
10
- require 'hashery/queryhash'
11
- require 'hashery/stash'
12
- require 'hashery/statichash'
16
+ require 'hashery/property_hash'
17
+ require 'hashery/query_hash'
18
+ require 'hashery/static_hash'
13
19
 
20
+ #require 'hashery/ini'
@@ -1,98 +1,63 @@
1
- ---
2
- name: hashery
3
- company: RubyWorks
4
- title: Hashery
5
- contact: Trans <transfire@gmail.com>
6
- maintainers:
7
- - Trans <transfire@gmail.com>
8
- pom_verison: 1.0.0
9
- requires:
10
- - group:
1
+ ---
2
+ source:
3
+ - var
4
+ authors:
5
+ - name: Trans
6
+ email: transfire@gmail.com
7
+ - name: Kirk Haines
8
+ - name: Robert Klemme
9
+ - name: Jan Molic
10
+ - name: George Moschovitis
11
+ - name: Jeena Paradies
12
+ - name: Erik Veenstra
13
+ copyrights:
14
+ - holder: Rubyworks
15
+ year: '2010'
16
+ license: BSD-2-Clause
17
+ replacements: []
18
+ alternatives: []
19
+ requirements:
20
+ - name: blankslate
21
+ - name: detroit
22
+ groups:
11
23
  - build
12
- name: syckle
13
- version: 0+
14
- - group:
24
+ development: true
25
+ - name: qed
26
+ groups:
15
27
  - test
16
- name: qed
17
- version: 0+
18
- resources:
19
- repo: git://github.com/rubyworks/hashery.git
28
+ development: true
29
+ - name: lemon
30
+ groups:
31
+ - test
32
+ development: true
33
+ dependencies: []
34
+ conflicts: []
35
+ repositories:
36
+ - uri: git://github.com/rubyworks/hashery.git
37
+ scm: git
38
+ name: upstream
39
+ resources:
40
+ home: http://rubyworks.github.com/hashery
20
41
  code: http://github.com/rubyworks/hashery
21
- api: http://rubyworks.github.com/hashery/docs/api
22
42
  mail: http://groups.google.com/group/rubyworks-mailinglist
23
- host: http://rubygems.org/gems/hashery
43
+ docs: http://rubydocs.info/gems/hashery/frames
24
44
  wiki: http://wiki.github.com/rubyworks/hashery
25
- home: http://rubyworks.github.com/hashery
26
- manifest:
27
- - .ruby
28
- - lib/hashery/association.rb
29
- - lib/hashery/basic_struct.rb
30
- - lib/hashery/basicobject.rb
31
- - lib/hashery/basicstruct.rb
32
- - lib/hashery/casting_hash.rb
33
- - lib/hashery/castinghash.rb
34
- - lib/hashery/dictionary.rb
35
- - lib/hashery/fuzzy_hash.rb
36
- - lib/hashery/fuzzyhash.rb
37
- - lib/hashery/ini.rb
38
- - lib/hashery/linked_list.rb
39
- - lib/hashery/linkedlist.rb
40
- - lib/hashery/lru_hash.rb
41
- - lib/hashery/lruhash.rb
42
- - lib/hashery/memoizer.rb
43
- - lib/hashery/open_cascade.rb
44
- - lib/hashery/open_hash.rb
45
- - lib/hashery/open_object.rb
46
- - lib/hashery/opencascade.rb
47
- - lib/hashery/openhash.rb
48
- - lib/hashery/openobject.rb
49
- - lib/hashery/ordered_hash.rb
50
- - lib/hashery/orderedhash.rb
51
- - lib/hashery/ostructable.rb
52
- - lib/hashery/property_hash.rb
53
- - lib/hashery/propertyhash.rb
54
- - lib/hashery/query_hash.rb
55
- - lib/hashery/queryhash.rb
56
- - lib/hashery/sparse_array.rb
57
- - lib/hashery/sparsearray.rb
58
- - lib/hashery/stash.rb
59
- - lib/hashery/static_hash.rb
60
- - lib/hashery/statichash.rb
61
- - lib/hashery.rb
62
- - lib/hashery.yml
63
- - qed/01_openhash.rdoc
64
- - qed/02_queryhash.rdoc
65
- - qed/03_castinghash.rdoc
66
- - qed/04_statichash.rdoc
67
- - qed/05_association.rdoc
68
- - qed/06_opencascade.rdoc
69
- - qed/07_fuzzyhash.rdoc
70
- - qed/08_properyhash.rdoc
71
- - qed/09_ostructable.rdoc
72
- - qed/applique/ae.rb
73
- - test/case_association.rb
74
- - test/case_dictionary.rb
75
- - test/case_opencascade.rb
76
- - test/case_openhash.rb
77
- - test/case_openobject.rb
78
- - test/case_sparsearray.rb
79
- - test/case_stash.rb
80
- - HISTORY.rdoc
81
- - LICENSE
82
- - README.rdoc
83
- - NOTICE
84
- version: 1.4.0
85
- licenses:
86
- - Apache 2.0
87
- copyright: Copyright (c) 2010 Thomas Sawyer
88
- description: The Hashery is a collection of Hash-like classes, spun-off from the original Ruby Facets library. Included are the widely used OrderedHash, the related but more featured Dictionary class, a number of open classes, similiar to the standard OpenStruct and a few variations on the standard Hash.
45
+ gems: http://rubygems.org/gems/hashery
46
+ extra: {}
47
+ load_path:
48
+ - lib
49
+ revision: 0
50
+ created: '2010-04-21'
89
51
  summary: Facets-bread collection of Hash-like classes.
90
- authors:
91
- - Thomas Sawyer
92
- - Kirk Haines
93
- - Robert Klemme
94
- - Jan Molic
95
- - George Moschovitis
96
- - Jeena Paradies
97
- - Erik Veenstra
98
- created: 2010-04-21
52
+ title: Hashery
53
+ version: 1.5.0
54
+ name: hashery
55
+ description: ! 'The Hashery is a collection of Hash-like classes, spun-off from the
56
+ original
57
+
58
+ Ruby Facets library. Included are the widely used OrderedHash, the related but
59
+
60
+ more featured Dictionary class, a number of open classes, similiar to the
61
+
62
+ standard OpenStruct and a few variations on the standard Hash.'
63
+ date: '2011-11-10'