sapp 0.1.0 → 0.2.0

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: c3113b85ab5e758b91667c80d84dc1e60c9712b4
4
- data.tar.gz: 8eec613f494e6d40c27dc479ad4bb73a293c138e
3
+ metadata.gz: b84a46073963b8600392b6cbfbf9ee1bfa5644a1
4
+ data.tar.gz: 3bf8a0facc605e8c70e9ecf2e965c51c1e263428
5
5
  SHA512:
6
- metadata.gz: 329dfd3cacb98e05b6cddb238044677283fd0a2624596c93873d9994bde59207de23155010c4c998ec17e5c90dacca563f054173601ef932be708b5787930fd6
7
- data.tar.gz: c85f4766210506891481f850390967a49f79a14cf97dd01b407a6fd1225c84eb3cdee6f39eea3c0ca4bc542e8e20e6d97a82b0b66d261c588907eabdecdaed2a
6
+ metadata.gz: 2b558002a0b92e63134474d3b33da647cbb2dd2b63ddf08ea0b2d8a619517c2b5f65df2c0a5acdcc1e972fbff18e1e015781a296c2712a1fa56c9328662aeb64
7
+ data.tar.gz: 43935196c71e2782657f266700167a1e373cee1d97aa8a886f559151a4c64c84e8d80cd959979369887670a2c327766fee364ed9447aec73be4e663e23e01538
data/README.md CHANGED
@@ -37,6 +37,10 @@ Or install it yourself as:
37
37
 
38
38
  $ gem install sapp
39
39
 
40
+ ## Examples
41
+
42
+ [Sapp with SimpleSession]( http://github.com/hayduke19us/sapp_test )
43
+
40
44
  ## Usage
41
45
 
42
46
  Sapp is meant to be sublcassed.
@@ -126,7 +130,7 @@ Direct Mapping:
126
130
 
127
131
  ```
128
132
 
129
- Name spacing and opinionated nesting
133
+ Name spacing and opinionated nesting:
130
134
 
131
135
  ```ruby
132
136
 
@@ -152,6 +156,29 @@ Name spacing and opinionated nesting
152
156
 
153
157
  ```
154
158
 
159
+ Root:
160
+
161
+ ```ruby
162
+
163
+ # Declare the root like a normal route
164
+
165
+ get '/' do
166
+
167
+ "This is root"
168
+
169
+ end
170
+
171
+ # Declare the root with a simple method and block
172
+
173
+ root do
174
+
175
+ "This is root"
176
+
177
+ end
178
+
179
+ ```
180
+
181
+
155
182
 
156
183
 
157
184
  ### Response Body
@@ -70,9 +70,13 @@ module Sapp
70
70
  end
71
71
 
72
72
  def setup_extraction
73
- path = original.split('/')
74
- path.delete("")
75
- path
73
+ if original == '/'
74
+ [original]
75
+ else
76
+ path = original.split('/')
77
+ path.delete("")
78
+ path
79
+ end
76
80
  end
77
81
 
78
82
  def extract_keys_and_paths
data/lib/sapp/routes.rb CHANGED
@@ -14,6 +14,10 @@ module Sapp
14
14
  route_map.set_namespace names, nest
15
15
  end
16
16
 
17
+ def root &block
18
+ get '/', &block
19
+ end
20
+
17
21
  def routes
18
22
  route_map.routes
19
23
  end
data/lib/sapp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sapp
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - hayduke19us
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-06 00:00:00.000000000 Z
11
+ date: 2015-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler