stone 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ == 0.1.2 2008-04-17
2
+
3
+ * Fixed number of bugs which prohibited result ordering in some cases
4
+
1
5
  == 0.1.1 2008-04-16
2
6
 
3
7
  * Added result ordering to Resource.all
@@ -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
- objs.sort! {|x,y| x.send(order[0]) <=> y.send(order[0])}
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
@@ -2,7 +2,7 @@ module Stone #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Author
2
- created_at: 2008-04-16T10:16:10-07:00
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: 2
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-16T10:16:10-07:00
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: 9
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-16T10:16:10-07:00
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: 33
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-16T10:16:10-07:00
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: 15
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-16T10:16:10-07:00
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: 24
7
+ favorite_number: 7
8
8
  id: 5
9
9
  name: Ben Hurr
10
10
  times_validated_hash:
@@ -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.1</a>
36
+ <a href="http://rubyforge.org/projects/stone" class="numbers">0.1.2</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;stone&#8217;</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&#8230; 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, 16th April 2008<br>
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>
@@ -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>
@@ -37,12 +37,20 @@
37
37
  </div>
38
38
  <%= body %>
39
39
  <p class="coda">
40
- Nick DeMonner, <%= modified.pretty %><br>
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.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-16 00:00:00 -07:00
12
+ date: 2008-04-17 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency