app-routes 0.1.5 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/app-routes.rb +10 -13
  2. metadata +6 -5
data/lib/app-routes.rb CHANGED
@@ -1,20 +1,15 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
 
3
3
  # file: app-routes.rb
4
4
 
5
- class AppRoutes
5
+ module AppRoutes
6
6
 
7
- def initialize(params={})
8
- super()
7
+ def initialize()
9
8
  @route = {}
10
- @params = params
9
+ @params = {}
11
10
  end
12
-
13
- def routes()
14
- yield
15
- end
16
-
17
- def run(request)
11
+
12
+ def run_route(request)
18
13
 
19
14
  result = nil
20
15
 
@@ -22,7 +17,6 @@ class AppRoutes
22
17
  match = request.match(key)
23
18
 
24
19
  if match then
25
-
26
20
  args = match.captures
27
21
  @params[:captures] = *args
28
22
 
@@ -35,7 +29,10 @@ class AppRoutes
35
29
 
36
30
  begin
37
31
  result = @route[key][:block].call *args
38
- rescue
32
+ rescue Exception => e
33
+
34
+ err_label = e.message + " :: \n" + e.backtrace.join("\n")
35
+ puts err_label
39
36
  "app-routes error: " + ($!).to_s
40
37
  end
41
38
 
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app-routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ prerelease:
5
+ version: 0.1.7
5
6
  platform: ruby
6
7
  authors: []
7
8
 
@@ -9,7 +10,7 @@ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2010-07-06 00:00:00 +01:00
13
+ date: 2011-04-04 00:00:00 +01:00
13
14
  default_executable:
14
15
  dependencies: []
15
16
 
@@ -33,21 +34,21 @@ rdoc_options: []
33
34
  require_paths:
34
35
  - lib
35
36
  required_ruby_version: !ruby/object:Gem::Requirement
37
+ none: false
36
38
  requirements:
37
39
  - - ">="
38
40
  - !ruby/object:Gem::Version
39
41
  version: "0"
40
- version:
41
42
  required_rubygems_version: !ruby/object:Gem::Requirement
43
+ none: false
42
44
  requirements:
43
45
  - - ">="
44
46
  - !ruby/object:Gem::Version
45
47
  version: "0"
46
- version:
47
48
  requirements: []
48
49
 
49
50
  rubyforge_project:
50
- rubygems_version: 1.3.5
51
+ rubygems_version: 1.5.2
51
52
  signing_key:
52
53
  specification_version: 3
53
54
  summary: app-routes