mashed 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +13 -0
- data/docs/docco.css +500 -0
- data/docs/index.html +43 -0
- data/docs/mash.html +206 -0
- data/docs/mashed.html +43 -0
- data/docs/public/fonts/aller-bold.eot +0 -0
- data/docs/public/fonts/aller-bold.ttf +0 -0
- data/docs/public/fonts/aller-bold.woff +0 -0
- data/docs/public/fonts/aller-light.eot +0 -0
- data/docs/public/fonts/aller-light.ttf +0 -0
- data/docs/public/fonts/aller-light.woff +0 -0
- data/docs/public/fonts/novecento-bold.eot +0 -0
- data/docs/public/fonts/novecento-bold.ttf +0 -0
- data/docs/public/fonts/novecento-bold.woff +0 -0
- data/docs/public/stylesheets/normalize.css +375 -0
- data/docs/stringy_hash.html +114 -0
- data/docs/version.html +68 -0
- data/lib/mashed/mash.rb +3 -2
- data/lib/mashed/version.rb +1 -1
- metadata +18 -2
@@ -0,0 +1,114 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title>stringy_hash.rb</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
7
|
+
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
8
|
+
<link rel="stylesheet" media="all" href="docco.css" />
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div id="container">
|
12
|
+
<div id="background"></div>
|
13
|
+
|
14
|
+
<ul id="jump_to">
|
15
|
+
<li>
|
16
|
+
<a class="large" href="javascript:void(0);">Jump To …</a>
|
17
|
+
<a class="small" href="javascript:void(0);">+</a>
|
18
|
+
<div id="jump_wrapper">
|
19
|
+
<div id="jump_page">
|
20
|
+
|
21
|
+
|
22
|
+
<a class="source" href="mash.html">
|
23
|
+
mash.rb
|
24
|
+
</a>
|
25
|
+
|
26
|
+
|
27
|
+
<a class="source" href="stringy_hash.html">
|
28
|
+
stringy_hash.rb
|
29
|
+
</a>
|
30
|
+
|
31
|
+
|
32
|
+
<a class="source" href="version.html">
|
33
|
+
version.rb
|
34
|
+
</a>
|
35
|
+
|
36
|
+
</div>
|
37
|
+
</li>
|
38
|
+
</ul>
|
39
|
+
|
40
|
+
<ul class="sections">
|
41
|
+
|
42
|
+
<li id="title">
|
43
|
+
<div class="annotation">
|
44
|
+
<h1>stringy_hash.rb</h1>
|
45
|
+
</div>
|
46
|
+
</li>
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
<li id="section-1">
|
51
|
+
<div class="annotation">
|
52
|
+
|
53
|
+
<div class="pilwrap ">
|
54
|
+
<a class="pilcrow" href="#section-1">¶</a>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">require</span> <span class="hljs-string">'delegate'</span>
|
60
|
+
|
61
|
+
<span class="hljs-class"><span class="hljs-keyword">module</span> <span class="hljs-title">Mashed</span></span>
|
62
|
+
<span class="hljs-class"><span class="hljs-keyword">module</span> <span class="hljs-title">ExtendHash</span></span>
|
63
|
+
<span class="hljs-function"><span class="hljs-keyword">def</span> </span>stringify
|
64
|
+
<span class="hljs-constant">StringyHash</span>.new(dup.each_with_object({}) <span class="hljs-keyword">do</span> |(k,v), h|
|
65
|
+
v = v.stringify <span class="hljs-keyword">if</span> v.respond_to?(<span class="hljs-symbol">:stringify</span>)
|
66
|
+
h[k.to_s] = v
|
67
|
+
<span class="hljs-keyword">end</span>)
|
68
|
+
<span class="hljs-keyword">end</span>
|
69
|
+
<span class="hljs-keyword">end</span>
|
70
|
+
|
71
|
+
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">StringyHash</span> <span class="hljs-inheritance">< <span class="hljs-parent">SimpleDelegator</span></span></span>
|
72
|
+
<span class="hljs-function"><span class="hljs-keyword">def</span> </span>stringify
|
73
|
+
dup
|
74
|
+
<span class="hljs-keyword">end</span>
|
75
|
+
|
76
|
+
<span class="hljs-function"><span class="hljs-keyword">def</span> </span>[](key)
|
77
|
+
<span class="hljs-keyword">super</span>(key.to_s)
|
78
|
+
<span class="hljs-keyword">end</span>
|
79
|
+
|
80
|
+
<span class="hljs-function"><span class="hljs-keyword">def</span> </span>[]=(key, value)
|
81
|
+
<span class="hljs-keyword">super</span>(key.to_s, value)
|
82
|
+
<span class="hljs-keyword">end</span>
|
83
|
+
<span class="hljs-keyword">alias</span> store []=
|
84
|
+
|
85
|
+
<span class="hljs-function"><span class="hljs-keyword">def</span> </span>delete(key, &blk)
|
86
|
+
<span class="hljs-keyword">super</span>(key.to_s, &blk)
|
87
|
+
<span class="hljs-keyword">end</span>
|
88
|
+
|
89
|
+
<span class="hljs-function"><span class="hljs-keyword">def</span> </span>merge(other_hash, &blk)
|
90
|
+
<span class="hljs-keyword">super</span>(other_hash.stringify, &blk)
|
91
|
+
<span class="hljs-keyword">end</span>
|
92
|
+
|
93
|
+
<span class="hljs-function"><span class="hljs-keyword">def</span> </span>merge!(other_hash, &blk)
|
94
|
+
<span class="hljs-keyword">super</span>(other_hash.stringify, &blk)
|
95
|
+
<span class="hljs-keyword">end</span>
|
96
|
+
|
97
|
+
<span class="hljs-function"><span class="hljs-keyword">def</span> </span>replace(other_hash, &blk)
|
98
|
+
<span class="hljs-keyword">super</span>(other_hash.stringify, &blk)
|
99
|
+
<span class="hljs-keyword">end</span>
|
100
|
+
|
101
|
+
<span class="hljs-function"><span class="hljs-keyword">def</span> </span>update(other_hash, &blk)
|
102
|
+
<span class="hljs-keyword">super</span>(other_hash.stringify, &blk)
|
103
|
+
<span class="hljs-keyword">end</span>
|
104
|
+
<span class="hljs-keyword">end</span>
|
105
|
+
<span class="hljs-keyword">end</span>
|
106
|
+
|
107
|
+
<span class="hljs-constant">Hash</span>.send <span class="hljs-symbol">:include</span>, <span class="hljs-constant">Mashed::ExtendHash</span></pre></div></div>
|
108
|
+
|
109
|
+
</li>
|
110
|
+
|
111
|
+
</ul>
|
112
|
+
</div>
|
113
|
+
</body>
|
114
|
+
</html>
|
data/docs/version.html
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title>version.rb</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
7
|
+
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
8
|
+
<link rel="stylesheet" media="all" href="docco.css" />
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div id="container">
|
12
|
+
<div id="background"></div>
|
13
|
+
|
14
|
+
<ul id="jump_to">
|
15
|
+
<li>
|
16
|
+
<a class="large" href="javascript:void(0);">Jump To …</a>
|
17
|
+
<a class="small" href="javascript:void(0);">+</a>
|
18
|
+
<div id="jump_wrapper">
|
19
|
+
<div id="jump_page">
|
20
|
+
|
21
|
+
|
22
|
+
<a class="source" href="mash.html">
|
23
|
+
mash.rb
|
24
|
+
</a>
|
25
|
+
|
26
|
+
|
27
|
+
<a class="source" href="stringy_hash.html">
|
28
|
+
stringy_hash.rb
|
29
|
+
</a>
|
30
|
+
|
31
|
+
|
32
|
+
<a class="source" href="version.html">
|
33
|
+
version.rb
|
34
|
+
</a>
|
35
|
+
|
36
|
+
</div>
|
37
|
+
</li>
|
38
|
+
</ul>
|
39
|
+
|
40
|
+
<ul class="sections">
|
41
|
+
|
42
|
+
<li id="title">
|
43
|
+
<div class="annotation">
|
44
|
+
<h1>version.rb</h1>
|
45
|
+
</div>
|
46
|
+
</li>
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
<li id="section-1">
|
51
|
+
<div class="annotation">
|
52
|
+
|
53
|
+
<div class="pilwrap ">
|
54
|
+
<a class="pilcrow" href="#section-1">¶</a>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div class="content"><div class='highlight'><pre><span class="hljs-class"><span class="hljs-keyword">module</span> <span class="hljs-title">Mashed</span></span>
|
60
|
+
<span class="hljs-constant">VERSION</span> = <span class="hljs-string">"0.9.0"</span>
|
61
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
62
|
+
|
63
|
+
</li>
|
64
|
+
|
65
|
+
</ul>
|
66
|
+
</div>
|
67
|
+
</body>
|
68
|
+
</html>
|
data/lib/mashed/mash.rb
CHANGED
data/lib/mashed/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mashed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -74,6 +74,22 @@ files:
|
|
74
74
|
- LICENSE.txt
|
75
75
|
- README.md
|
76
76
|
- Rakefile
|
77
|
+
- docs/docco.css
|
78
|
+
- docs/index.html
|
79
|
+
- docs/mash.html
|
80
|
+
- docs/mashed.html
|
81
|
+
- docs/public/fonts/aller-bold.eot
|
82
|
+
- docs/public/fonts/aller-bold.ttf
|
83
|
+
- docs/public/fonts/aller-bold.woff
|
84
|
+
- docs/public/fonts/aller-light.eot
|
85
|
+
- docs/public/fonts/aller-light.ttf
|
86
|
+
- docs/public/fonts/aller-light.woff
|
87
|
+
- docs/public/fonts/novecento-bold.eot
|
88
|
+
- docs/public/fonts/novecento-bold.ttf
|
89
|
+
- docs/public/fonts/novecento-bold.woff
|
90
|
+
- docs/public/stylesheets/normalize.css
|
91
|
+
- docs/stringy_hash.html
|
92
|
+
- docs/version.html
|
77
93
|
- lib/mashed.rb
|
78
94
|
- lib/mashed/mash.rb
|
79
95
|
- lib/mashed/stringy_hash.rb
|