hobby 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/hobby.gemspec +1 -1
- data/lib/hobby.rb +10 -8
- data/spec/app_spec.rb +7 -0
- data/spec/apps/Throw.rb +4 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e94efedb075ca089d085a994e9ecedb030f7abc5
|
4
|
+
data.tar.gz: 2310fa22a7721635a2c908c107c09389b0f72f79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04f4c02193c556faf6a89460471fbaafcbdc079a41f0c5775e5967963661720985a3229fd3191aca391305cf6722ea5bea1c1b37b91eb27114dc9a56b07b1467
|
7
|
+
data.tar.gz: 7fdce123c7f0b9a8c7ebbc1e3135b568ae09c9aa2915ef2011a402e1d2960f27ddcf88faf1d2bbe2735f680926bbb892feb32ac0b9ece61071c61db6ba3e353b
|
data/hobby.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'hobby'
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.4'
|
8
8
|
spec.authors = ['Anatoly Chernow']
|
9
9
|
spec.email = ['chertoly@gmail.com']
|
10
10
|
spec.summary = %q{A minimal DSL over rack}
|
data/lib/hobby.rb
CHANGED
@@ -4,7 +4,7 @@ require 'forwardable'
|
|
4
4
|
require 'hobby/router'
|
5
5
|
|
6
6
|
module Hobby
|
7
|
-
App = Hobby # to stay compatible old code
|
7
|
+
App = Hobby # to stay compatible with old code
|
8
8
|
VERBS = %w[DELETE GET HEAD OPTIONS PATCH POST PUT]
|
9
9
|
|
10
10
|
def self.included app
|
@@ -37,15 +37,17 @@ module Hobby
|
|
37
37
|
|
38
38
|
protected
|
39
39
|
def handle env
|
40
|
-
|
40
|
+
catch :halt do
|
41
|
+
route = self.class.router.route_for (@env = env)
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
if route
|
44
|
+
response.write instance_exec &route
|
45
|
+
else
|
46
|
+
response.status = 404
|
47
|
+
end
|
47
48
|
|
48
|
-
|
49
|
+
response
|
50
|
+
end
|
49
51
|
end
|
50
52
|
|
51
53
|
private
|
data/spec/app_spec.rb
CHANGED
data/spec/apps/Throw.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoly Chernow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- spec/apps/Map.rb
|
51
51
|
- spec/apps/Nested.rb
|
52
52
|
- spec/apps/OneRouteRouter.rb
|
53
|
+
- spec/apps/Throw.rb
|
53
54
|
- spec/apps/Use.rb
|
54
55
|
- spec/apps/WithoutPath.rb
|
55
56
|
- spec/helper.rb
|
@@ -87,6 +88,7 @@ test_files:
|
|
87
88
|
- spec/apps/Map.rb
|
88
89
|
- spec/apps/Nested.rb
|
89
90
|
- spec/apps/OneRouteRouter.rb
|
91
|
+
- spec/apps/Throw.rb
|
90
92
|
- spec/apps/Use.rb
|
91
93
|
- spec/apps/WithoutPath.rb
|
92
94
|
- spec/helper.rb
|