Dex 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/Dex.rb +1 -0
- data/lib/Dex/Rack_App.rb +10 -7
- data/lib/Dex/version.rb +1 -1
- data/spec/Dex.rb +14 -0
- data/spec/Dex_Rack_App.rb +5 -0
- metadata +1 -1
data/lib/Dex.rb
CHANGED
data/lib/Dex/Rack_App.rb
CHANGED
@@ -33,7 +33,7 @@ class Dex
|
|
33
33
|
def recent num = 10
|
34
34
|
vars = Hash[
|
35
35
|
:title => "Dex List",
|
36
|
-
:list => Dex.recent
|
36
|
+
:list => Dex.recent.to_a
|
37
37
|
]
|
38
38
|
view_index vars
|
39
39
|
end
|
@@ -54,13 +54,16 @@ class Dex
|
|
54
54
|
|
55
55
|
def view_index vars
|
56
56
|
layout(vars) {
|
57
|
-
vars[:list].
|
58
|
-
div {
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
if vars[:list].empty?
|
58
|
+
div.empty { p "No exceptions created." }
|
59
|
+
else
|
60
|
+
vars[:list].each { |db|
|
61
|
+
div {
|
62
|
+
p db[:message]
|
63
|
+
p db[:exception]
|
64
|
+
}
|
62
65
|
}
|
63
|
-
|
66
|
+
end
|
64
67
|
}
|
65
68
|
end
|
66
69
|
|
data/lib/Dex/version.rb
CHANGED
data/spec/Dex.rb
CHANGED
@@ -1,4 +1,18 @@
|
|
1
1
|
|
2
|
+
describe "Dex :db" do
|
3
|
+
|
4
|
+
it "resets :table to nil after specifying a new Database" do
|
5
|
+
t = Class.new {
|
6
|
+
include Dex::DSL
|
7
|
+
}.new
|
8
|
+
t.db "/tmp/db.test.1.db"
|
9
|
+
t.table.count
|
10
|
+
t.db "/tmp/db.test.2.db"
|
11
|
+
t.instance_eval { @table }.should.be == nil
|
12
|
+
end
|
13
|
+
|
14
|
+
end # === Dex :db
|
15
|
+
|
2
16
|
describe "Dex :recent" do
|
3
17
|
|
4
18
|
it "returns first result if n = 1" do
|
data/spec/Dex_Rack_App.rb
CHANGED