app-routes 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e17b9a5db2cd4c91a1469c182ca5dac4f6cb6697
4
- data.tar.gz: 9fa2c33b17d0e659b4fee8f3ec912eec80dc18f2
3
+ metadata.gz: e5c95468c4c0a0c165a6c7bfc8c7eb1365d20d0c
4
+ data.tar.gz: e5c58059a05aef22ee78d3e807bdde3465e0d9b8
5
5
  SHA512:
6
- metadata.gz: e58e6e86c339e0690c7bf34b3b025de8b9f11ae7dbe8cb46f0c3294a443aff0fb603ceb0d566a8d766b1a9a6a7faa647531b1e8d686628993475082ae7dfaefc
7
- data.tar.gz: 987110e38e8c0c0595b1ef2d56d3399343cb0315001aa64f72ddb14c94665267a6b6f1b728557345d57412a72805689cf2b68569fda4a56e5f965188435533cc
6
+ metadata.gz: 31e18397dfd7fa8a8974da56be8e23aeff1c23c76e0305b6a93c433978edda961088c2f9c77f2a93ecb1f8b0713267477f929e13827620a99ec976171b90d7d9
7
+ data.tar.gz: 529c71a38202e4c5e18515e3d065cce97134b977e0ec1d0e36668d47a0ce61f8761aa2f1b6ff6b650816c11cd5869e3fca2cc83e5fc12b58e153097f5b51d196
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- 6���m4ˇ�S�>ǿ�xH_"���p9� w7��Lr��U
2
- w+�h2��L/bK%_JΑp��Sm��޼XT����Q���:����(��
1
+ ��s��0�S�i Gw�Y�O�Z���=8����4o�y�GA\�?n�wV�fY��ǀ�$�+�I����� ��y7�O����+V����g�V?M�?=;�Z���&J u�D���*���2\*���@��H
2
+ �,Ń�}q��™ꑃRx N߆ѥv�\����5 ��rO'�$��
@@ -6,7 +6,7 @@ module AppRoutes
6
6
 
7
7
  attr_accessor :routes
8
8
 
9
- def initialize()
9
+ def initialize(logfile='/tmp/app-routes.log')
10
10
  @routes = {}
11
11
  @params = {}
12
12
  end
@@ -16,7 +16,9 @@ module AppRoutes
16
16
  result = nil
17
17
 
18
18
  routes = @routes
19
+
19
20
  return unless routes
21
+
20
22
  route = routes.detect {|key, block| request.match(key) }
21
23
 
22
24
  if route then
@@ -28,8 +30,10 @@ module AppRoutes
28
30
 
29
31
  if routes[key][:s] then
30
32
  raw_params = routes[key][:s].gsub(':','').match(key).captures
33
+
31
34
  splat, raw_params2 = raw_params.each_with_index.partition {|x,i| x == '/*'}
32
35
  @params[:splat] = splat.map {|x,i| v = args[i]; args.delete_at(i); v}
36
+
33
37
  @params.merge!(Hash[raw_params2.map{|x,i| x.to_sym}.zip(args)])
34
38
  end
35
39
 
@@ -38,6 +42,7 @@ module AppRoutes
38
42
  rescue Exception => e
39
43
 
40
44
  err_label = e.message + " :: \n" + e.backtrace.join("\n")
45
+ raise 'app-routes: ' + request.inspect + ' ' + err_label
41
46
  end
42
47
 
43
48
  end
@@ -64,4 +69,4 @@ module AppRoutes
64
69
  @routes[r] = {block: block}
65
70
  end
66
71
 
67
- end
72
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app-routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,7 +29,7 @@ cert_chain:
29
29
  1oK5tbYwnM87KR/QtSfGpkC/3WnkpfkJ+NtCnKUgJ2enhlTjdIG9ZVSrwx2cKIp7
30
30
  CQIfMZZYe5gHY3oCDwM8fDrK3vsjKs/i
31
31
  -----END CERTIFICATE-----
32
- date: 2013-07-27 00:00:00.000000000 Z
32
+ date: 2013-12-24 00:00:00.000000000 Z
33
33
  dependencies: []
34
34
  description:
35
35
  email: james@r0bertson.co.uk
@@ -48,17 +48,17 @@ require_paths:
48
48
  - lib
49
49
  required_ruby_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - '>='
56
+ - - ">="
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  requirements: []
60
60
  rubyforge_project:
61
- rubygems_version: 2.0.0.rc.2
61
+ rubygems_version: 2.0.3
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: app-routes
metadata.gz.sig CHANGED
Binary file