Dex 0.1.0 → 0.1.1

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.
data/lib/Dex.rb CHANGED
@@ -41,6 +41,7 @@ class Dex
41
41
  }
42
42
  db
43
43
  end
44
+ @table = nil
44
45
  end
45
46
 
46
47
  @db ||= db(Dex.default_db)
@@ -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].each { |db|
58
- div {
59
- p "test"
60
- p db[:message]
61
- p db[:exception]
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
 
@@ -1,3 +1,3 @@
1
1
  class Dex
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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
@@ -12,6 +12,11 @@ describe "get /" do
12
12
  }
13
13
  end
14
14
 
15
+ it "renders message when there are no exceptions" do
16
+ get "/"
17
+ last_response.body.should.match %r!No exceptions!
18
+ end
19
+
15
20
  end # === get /
16
21
 
17
22
  describe "get /recent/:num" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Dex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: