benschwarz-smoke 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :minor: 3
3
- :patch: 5
4
2
  :major: 0
3
+ :minor: 3
4
+ :patch: 6
data/lib/smoke/origin.rb CHANGED
@@ -113,6 +113,18 @@ module Smoke
113
113
  ensure
114
114
  return self
115
115
  end
116
+
117
+ # Reverse the order of the items
118
+ #
119
+ # Usage
120
+ # Smoke[:ruby].ouput
121
+ # Returns [{:header => "Platypus"}, {:header => "Kangaroo"}]
122
+ # Smoke[:ruby].reverse.output
123
+ # Returns [{:header => "Kangaroo"}, {:header => "Platypus"}]
124
+ def reverse
125
+ @items.reverse!
126
+ return self
127
+ end
116
128
 
117
129
  # Keep items that match the regex
118
130
  #
@@ -33,6 +33,10 @@ describe Smoke::Origin do
33
33
  Smoke[:test].sort(:header).output.first[:header].should == "Kangaroo"
34
34
  end
35
35
 
36
+ it "should reverse the results" do
37
+ Smoke[:test].sort(:header).reverse.output.should == [{:header => "Platypus"}, {:header => "Kangaroo"}]
38
+ end
39
+
36
40
  it "should truncate results given a length" do
37
41
  Smoke[:test].truncate(1).output.size.should == 1
38
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benschwarz-smoke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Schwarz
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-08 00:00:00 -07:00
12
+ date: 2009-06-09 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -100,7 +100,7 @@ requirements: []
100
100
  rubyforge_project:
101
101
  rubygems_version: 1.2.0
102
102
  signing_key:
103
- specification_version: 2
103
+ specification_version: 3
104
104
  summary: smoke is a DSL that allows you to take data from YQL, RSS / Atom
105
105
  test_files: []
106
106