rackstep 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a96502606655874e6a4ff8f9d617a49a6be5b74c
4
- data.tar.gz: aaed008abdfc950a191dbaacad82d25a0d5d3228
3
+ metadata.gz: 5ae595eef51cb68ce8488b0198916fd31f58a993
4
+ data.tar.gz: e0cac291299b137a9d5c94369e67a6ef696a6396
5
5
  SHA512:
6
- metadata.gz: d022ecba03a538210e8f92c125b291caa458dbf153ca207e90dc28c97acc0c5875ab1a8766072e4c0e0d1322ecbd5c57766ce46ef990f0bdb6a8670ed4028735
7
- data.tar.gz: 9663bf5ea208d782f58d2ff6d97b8d4168ecdb6f2abed35b2cf0e0e1282326f10af5335325f923701637a58febde0e6514f6fc0dd68befae00ea3cebb7b0a230
6
+ metadata.gz: 8558d518e2296257a2e6c59b2423bc6532ffadb97aab79950aa765c36ab09661862fc0f25d055128e92fc9aca4f812756b7dcd6f6e723969928214e83aa8382e
7
+ data.tar.gz: bd486f7573e6d50f024ec8fc09a61f96e85f520745e95bc68df2febe352d46d2eeb82d542bb254b0a6326ff6d1c06b08ffe7e135d42f137b3e71d2c0799de330
data/lib/controller.rb CHANGED
@@ -61,20 +61,6 @@ class RackStep::NotFoundController < RackStep::Controller
61
61
 
62
62
  end
63
63
 
64
- # A module for controllers to add static html pages rendering.
65
- # This is not the best way to serve static content. In production, consider
66
- # using Nginx or Apache or Amazon S3. Using ruby/rack to serve static content
67
- # is a waste of resources and should be only used for low traffic web pages.
68
- # This method is provided so that in this circumstances you may use it to
69
- # keep a simpler architecture.
70
- # TODO: Add layout support.
71
- module RackStep::Controller::HtmlRendering
72
-
73
- def render_page(page_name, pages_directory = 'app/public/pages')
74
- File.read("#{pages_directory}/#{page_name}.html")
75
- end
76
-
77
- end
78
64
 
79
65
  # A module for controllers to add ERB template rendering. RackStep is not meant
80
66
  # to be used for template rendering. We recommend you to use a SPA (Single Page
data/lib/rackstep.rb CHANGED
@@ -1,5 +1,8 @@
1
- # This is where we define an abstract class with the base of
2
- # a RackStep app. This class MUST be extended by the user.
1
+ # In this file you will find the RackStep::App class.
2
+ # This is one of the fundamental parts of the framework and
3
+ # is responsable for the whole orchestration.
4
+ # To use RackStep one of the first things you will have to
5
+ # do is extend this class.
3
6
 
4
7
  require 'rack'
5
8
  require_relative 'response'
@@ -10,6 +13,8 @@ require_relative 'controller'
10
13
 
11
14
  module RackStep
12
15
 
16
+ # Abstract class with the base of a RackStep app.
17
+ # This class MUST be extended by the user.
13
18
  class App
14
19
 
15
20
  # Will store the received request which will be injected into the user controllers.
@@ -30,6 +35,7 @@ module RackStep
30
35
  new(env).process_request
31
36
  end
32
37
 
38
+ # Initialize all instance variables and add a default "not found" route.
33
39
  def initialize(env)
34
40
  @request = Rack::Request.new(env)
35
41
  @settings = RackStep::GlobalConfiguration.instance.settings
data/lib/router.rb CHANGED
@@ -2,6 +2,8 @@
2
2
  # us, given a path and a http verb, what controller should handle the business
3
3
  # logic of the request.
4
4
 
5
+ require 'singleton'
6
+
5
7
  module RackStep
6
8
 
7
9
  class Router
@@ -51,4 +53,4 @@ module RackStep
51
53
 
52
54
  end
53
55
 
54
- end
56
+ end
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.4
4
+ version: 0.0.5
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-02-16 00:00:00.000000000 Z
11
+ date: 2016-02-23 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.
@@ -48,3 +48,4 @@ signing_key:
48
48
  specification_version: 4
49
49
  summary: RackStep micro web framework
50
50
  test_files: []
51
+ has_rdoc: