rackstep 0.0.7 → 0.0.8

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rackstep.rb +6 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a8d10779a752f00c4db5738ca0ae795808cbbd4
4
- data.tar.gz: 2f949fbc3e92736f34a0c2471173ae66f11116d2
3
+ metadata.gz: 47f7794e1baa598eb224745e87ee75f82672f72f
4
+ data.tar.gz: 8ec6cdc1ad6377e0a553e6fb8b8967a4a004e287
5
5
  SHA512:
6
- metadata.gz: 30c03a784c301fbd4b3846e6e15ab35b3e08852f43ab3b919e30ac96ed8e1af1e22db1d12c7a88052ab365f0f4844460e7af27fa0afbfdb846cd3ff04eb54b3e
7
- data.tar.gz: 463aba2fb38a21411366e7001c5511b2d6845c52d7ed77ac8f335a52a9a868b49212cb86fdf375219f9cf89ff3bce0fca4c6e9c88f4b646f731d2de5e649fc2c
6
+ metadata.gz: f203b94527651686da8616f175d1842fa5065d62405e90e1c4b39a6ad0ec3685a76fc8fa0e3efeba1c3c329e2ac8ecd78e596c8e4f59ed27ecc62d69c5366405
7
+ data.tar.gz: 41697df3b093a6ab27b82bcd26a895d31fef0f71c73bdf64d7a858b0f0c6ab3c9ed3a14878af66c93449f330b1910a1bdf3ca903f4efa9bcb257b69317aea2df
data/lib/rackstep.rb CHANGED
@@ -10,9 +10,10 @@ require_relative 'route'
10
10
  require_relative 'router'
11
11
  require_relative 'controller'
12
12
 
13
+
13
14
  module RackStep
14
15
 
15
- # Abstract class with the base of a RackStep app.
16
+ # Abstract class with the base of a RackStep app.
16
17
  # This class MUST be extended by the user.
17
18
  class App
18
19
 
@@ -34,7 +35,7 @@ module RackStep
34
35
  @request = Rack::Request.new(env)
35
36
 
36
37
  # Adding default routes to handle page not found (404).
37
- router.add_route_for_all_verbs('notfound', 'RackStep::NotFoundController')
38
+ router.add_route_for_all_verbs('notfound', RackStep::NotFoundController)
38
39
  end
39
40
 
40
41
  # TODO: Code Climate says this method is too big.
@@ -42,12 +43,12 @@ module RackStep
42
43
  verb = request.request_method
43
44
  path = request.path
44
45
 
45
- # In RackStep, each request is processed by a controller. The router
46
+ # In RackStep, each request is processed by a controller. The router
46
47
  # is responsable to find, based on the given path and http verb,
47
48
  # the apropriate controller to handle the request.
48
49
  route = router.find_route_for(path, verb)
49
50
  # Initialize the correspondent controller.
50
- controller = Object.const_get(route.controller).new
51
+ controller = route.controller.new
51
52
  # Inject the request into the controller.
52
53
  controller.request = request
53
54
  # Execute the before method of this controller.
@@ -62,7 +63,7 @@ module RackStep
62
63
  return response
63
64
  end
64
65
 
65
- # This method was created to make it easier for the user to add routes, but it
66
+ # This method was created to make it easier for the user to add routes, but it
66
67
  # will delegate to the router singleton class.
67
68
  def self.add_route(verb, path, controller)
68
69
  router = Router.instance
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rackstep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcio Frayze David
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-30 00:00:00.000000000 Z
11
+ date: 2016-05-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RackStep is (yet another) micro ruby framework for microservices and
14
14
  web development.