cuba-generator 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cuba/generator/version.rb +1 -1
- data/lib/cuba/templates/app.erb +31 -30
- data/lib/cuba/templates/rack_config.erb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4eec12e492f60c19414252cf7e9f5f0a6924de1
|
4
|
+
data.tar.gz: be9ea2e861b2a729bdf278f09429a3effaab8384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2808fc78401343a3b0901b7912691fc2c574629571324ed881d06ed871b3f1a3f68172080dd4ea198aa0ec1232f8750f254ee893f0052e76794b313d2093bdc
|
7
|
+
data.tar.gz: fd9495af1c195e0ca9164d37ba006418a1417a8814363b98d71d29c1d9b3198e28c9e0407f30de835377ae389b952e7b48792e1133c2c63cec3bcc90535f24f9
|
data/lib/cuba/templates/app.erb
CHANGED
@@ -1,39 +1,40 @@
|
|
1
|
-
<%=
|
2
|
-
|
1
|
+
<%=
|
2
|
+
<<-TEMPLATE
|
3
|
+
require 'cuba'
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
# If you need extra protection.
|
6
|
+
# require 'rack/protection'
|
7
|
+
# Cuba.use Rack::Protection
|
8
|
+
# Cuba.use Rack::Protection::RemoteReferrer
|
8
9
|
|
9
|
-
|
10
|
+
Cuba.use Rack::Session::Cookie, :secret => "#{SecureRandom.base64(64)}"
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
# Cuba includes a plugin called Cuba::Render that provides a couple of helper methods for rendering templates.
|
13
|
+
# require "cuba/render"
|
14
|
+
# Cuba.plugin(Cuba::Render)
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
# This plugin uses Tilt, which serves as an interface to a bunch of different Ruby template engines
|
17
|
+
# (ERB, Haml, Sass, CoffeeScript, etc.), so you can use the template engine of your choice.
|
18
|
+
# require 'slim'
|
19
|
+
# Cuba.settings[:render][:template_engine] = 'slim'
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
# Cuba.settings[:render][:template_engine] = "slim"
|
22
|
+
# Cuba.settings[:render][:views] = "./views/admin/"
|
23
|
+
# Cuba.settings[:render][:layout] = "admin"
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
on root do
|
34
|
-
res.redirect "/#{project_name}"
|
35
|
-
end
|
25
|
+
# To launch just type: 'rackup' in your console
|
26
|
+
Cuba.define do
|
27
|
+
on get do
|
28
|
+
on "#{project_name}" do
|
29
|
+
on root do
|
30
|
+
res.write 'Hello world!'
|
36
31
|
end
|
37
32
|
end
|
38
|
-
|
33
|
+
|
34
|
+
on root do
|
35
|
+
res.redirect "/#{project_name}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
TEMPLATE
|
39
40
|
%>
|