stone 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/stone/resource.rb +9 -5
- data/lib/stone/version.rb +1 -1
- data/sandbox_for_specs/datastore/authors/1.yml +2 -2
- data/sandbox_for_specs/datastore/authors/2.yml +2 -2
- data/sandbox_for_specs/datastore/authors/3.yml +2 -2
- data/sandbox_for_specs/datastore/authors/4.yml +2 -2
- data/sandbox_for_specs/datastore/authors/5.yml +2 -2
- data/website/index.html +17 -3
- data/website/index.txt +4 -0
- data/website/template.html.erb +10 -2
- metadata +2 -2
data/History.txt
CHANGED
data/lib/stone/resource.rb
CHANGED
@@ -193,21 +193,25 @@ module Stone
|
|
193
193
|
# A hash representing one or more Ruby expressions
|
194
194
|
def all(conditions = nil)
|
195
195
|
objs = []
|
196
|
+
if conditions && conditions[:order]
|
197
|
+
order = conditions[:order].to_a.flatten
|
198
|
+
conditions.delete(:order)
|
199
|
+
conditions = nil if conditions.empty?
|
200
|
+
end
|
196
201
|
unless conditions
|
197
202
|
@@store.resources[self.to_s.make_key].each do |o|
|
198
203
|
objs << o[1]
|
199
204
|
end
|
200
205
|
else
|
201
|
-
if conditions[:order]
|
202
|
-
order = conditions[:order].to_a.flatten
|
203
|
-
conditions.delete(:order)
|
204
|
-
end
|
205
206
|
objs = find(conditions, self.to_s.make_key)
|
206
207
|
end
|
207
208
|
if order
|
208
209
|
raise "Order should be passed with :asc or :desc, got #{order[1].inspect}" \
|
209
210
|
unless [:asc,:desc].include? order[1]
|
210
|
-
|
211
|
+
begin
|
212
|
+
objs.sort! {|x,y| x.send(order[0]) <=> y.send(order[0])}
|
213
|
+
rescue
|
214
|
+
end
|
211
215
|
objs.reverse! if order[1] == :desc
|
212
216
|
end
|
213
217
|
objs
|
data/lib/stone/version.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Author
|
2
|
-
created_at: 2008-04-
|
2
|
+
created_at: 2008-04-17T23:08:39-07:00
|
3
3
|
email: nick@cladby.com
|
4
4
|
errors: !ruby/object:Validatable::Errors
|
5
5
|
errors: {}
|
6
6
|
|
7
|
-
favorite_number:
|
7
|
+
favorite_number: 21
|
8
8
|
id: 1
|
9
9
|
name: Nick DeMonner
|
10
10
|
times_validated_hash:
|
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Author
|
2
|
-
created_at: 2008-04-
|
2
|
+
created_at: 2008-04-17T23:08:39-07:00
|
3
3
|
email: heyo@something.com
|
4
4
|
errors: !ruby/object:Validatable::Errors
|
5
5
|
errors: {}
|
6
6
|
|
7
|
-
favorite_number:
|
7
|
+
favorite_number: 26
|
8
8
|
id: 2
|
9
9
|
name: Mike McMichaels
|
10
10
|
times_validated_hash:
|
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Author
|
2
|
-
created_at: 2008-04-
|
2
|
+
created_at: 2008-04-17T23:08:39-07:00
|
3
3
|
email: weyo@something.com
|
4
4
|
errors: !ruby/object:Validatable::Errors
|
5
5
|
errors: {}
|
6
6
|
|
7
|
-
favorite_number:
|
7
|
+
favorite_number: 13
|
8
8
|
id: 3
|
9
9
|
name: Mary Poppins
|
10
10
|
times_validated_hash:
|
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Author
|
2
|
-
created_at: 2008-04-
|
2
|
+
created_at: 2008-04-17T23:08:39-07:00
|
3
3
|
email: nick@gmail.com
|
4
4
|
errors: !ruby/object:Validatable::Errors
|
5
5
|
errors: {}
|
6
6
|
|
7
|
-
favorite_number:
|
7
|
+
favorite_number: 7
|
8
8
|
id: 4
|
9
9
|
name: Nick Hicklesby
|
10
10
|
times_validated_hash:
|
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Author
|
2
|
-
created_at: 2008-04-
|
2
|
+
created_at: 2008-04-17T23:08:39-07:00
|
3
3
|
email: chariot_guy@hotmail.com
|
4
4
|
errors: !ruby/object:Validatable::Errors
|
5
5
|
errors: {}
|
6
6
|
|
7
|
-
favorite_number:
|
7
|
+
favorite_number: 7
|
8
8
|
id: 5
|
9
9
|
name: Ben Hurr
|
10
10
|
times_validated_hash:
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>Stone: Dead-Simple Data Persistence</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/stone"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/stone" class="numbers">0.1.
|
36
|
+
<a href="http://rubyforge.org/projects/stone" class="numbers">0.1.2</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘stone’</h1>
|
39
39
|
|
@@ -84,6 +84,12 @@ organized manner. Therefore, Stone was built to provide plug-and-play data persi
|
|
84
84
|
any application or framework. It is fast, and it is easy… therefore it is good.</p>
|
85
85
|
|
86
86
|
|
87
|
+
<p>You can check out an application that uses Merb+Stone <a href="http://theprestigio.us">here.</a></p>
|
88
|
+
|
89
|
+
|
90
|
+
<p>The source for that blog is <a href="http://github.com/ndemonner/written_in_stone/tree/master">here.</a></p>
|
91
|
+
|
92
|
+
|
87
93
|
<h2 id="installing">Installing</h2>
|
88
94
|
|
89
95
|
|
@@ -385,12 +391,20 @@ commit. =D</p>
|
|
385
391
|
|
386
392
|
<p>Comments are welcome. Join me in the <span class="caps">IRC</span> channel #stone on freenode.</p>
|
387
393
|
<p class="coda">
|
388
|
-
Nick DeMonner
|
394
|
+
<a href="http://theprestigio.us">Nick DeMonner</a>, 17th April 2008<br>
|
389
395
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
390
396
|
</p>
|
391
397
|
</div>
|
392
398
|
|
393
399
|
<!-- insert site tracking codes here, like Google Urchin -->
|
394
|
-
|
400
|
+
<script type="text/javascript">
|
401
|
+
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
402
|
+
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
403
|
+
</script>
|
404
|
+
<script type="text/javascript">
|
405
|
+
var pageTracker = _gat._getTracker("UA-2831521-3");
|
406
|
+
pageTracker._initData();
|
407
|
+
pageTracker._trackPageview();
|
408
|
+
</script>
|
395
409
|
</body>
|
396
410
|
</html>
|
data/website/index.txt
CHANGED
@@ -33,6 +33,10 @@ For small applications, a database can be overkill for storing your data in a co
|
|
33
33
|
organized manner. Therefore, Stone was built to provide plug-and-play data persistence for
|
34
34
|
any application or framework. It is fast, and it is easy... therefore it is good.
|
35
35
|
|
36
|
+
You can check out an application that uses Merb+Stone "here.":http://theprestigio.us
|
37
|
+
|
38
|
+
The source for that blog is "here.":http://github.com/ndemonner/written_in_stone/tree/master
|
39
|
+
|
36
40
|
h2(#installing). Installing
|
37
41
|
|
38
42
|
<pre>sudo gem install stone</pre>
|
data/website/template.html.erb
CHANGED
@@ -37,12 +37,20 @@
|
|
37
37
|
</div>
|
38
38
|
<%= body %>
|
39
39
|
<p class="coda">
|
40
|
-
Nick DeMonner
|
40
|
+
<a href="http://theprestigio.us">Nick DeMonner</a>, <%= modified.pretty %><br>
|
41
41
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
42
42
|
</p>
|
43
43
|
</div>
|
44
44
|
|
45
45
|
<!-- insert site tracking codes here, like Google Urchin -->
|
46
|
-
|
46
|
+
<script type="text/javascript">
|
47
|
+
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
48
|
+
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
49
|
+
</script>
|
50
|
+
<script type="text/javascript">
|
51
|
+
var pageTracker = _gat._getTracker("UA-2831521-3");
|
52
|
+
pageTracker._initData();
|
53
|
+
pageTracker._trackPageview();
|
54
|
+
</script>
|
47
55
|
</body>
|
48
56
|
</html>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick DeMonner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-04-
|
12
|
+
date: 2008-04-17 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|