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 +2 -2
- data/lib/smoke/origin.rb +12 -0
- data/spec/smoke/origin_spec.rb +4 -0
- metadata +3 -3
data/VERSION.yml
CHANGED
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
|
#
|
data/spec/smoke/origin_spec.rb
CHANGED
@@ -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.
|
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-
|
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:
|
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
|
|