yaframework 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/examples/README.md +14 -0
- data/examples/configure.rb +14 -0
- data/examples/helpers.rb +26 -0
- data/examples/rendering/app.rb +5 -0
- data/examples/rendering/config.ru +3 -0
- data/examples/rendering/views/index.erb +4 -0
- data/examples/rendering/views/layout.erb +10 -0
- data/examples/rendering/views/partial.erb +1 -0
- data/lib/yaframework/base.rb +8 -0
- data/lib/yaframework/render.rb +1 -3
- data/lib/yaframework/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b01d1643e6921880fd3630c0b5898c502a0b3ff54c602f63ac54f9d32e263b36
|
4
|
+
data.tar.gz: 602742bc864f51d7151d946710d47583e2b3a7abfe257ffb74c2f2d48418ff89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80d9262cc6a0206ecbd058c3bb6d65c78b4abe0192924dd27685d61fd91ec90c60e85d3a3f7792e8ce6f45d4c6d1b6e30309fa6d66f3988debd0a8fa450bd1b6
|
7
|
+
data.tar.gz: 9d95222a443494ca862a16499f42662053515765c3cd2dbb06050b469b333f852c7097c1de16904704bc731a18c653a3980cd199b2dfe8738e5a1424148ce6ce
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/examples/README.md
CHANGED
@@ -42,6 +42,20 @@ Here are some examples of applications created with Yaframework:
|
|
42
42
|
How to use `before` and `after` hooks
|
43
43
|
|
44
44
|
|
45
|
+
9. [**Rendering**](https://github.com/maxbarsukov/yaframework/tree/master/examples/rendering)
|
46
|
+
|
47
|
+
Rendering your `.erb` (or any else) files and partials using tilt.
|
48
|
+
|
49
|
+
|
50
|
+
10. [**Helpers**](https://github.com/maxbarsukov/yaframework/blob/master/examples/helpers.rb)
|
51
|
+
|
52
|
+
Example of using helpers
|
53
|
+
|
54
|
+
|
55
|
+
11. [**Configure**](https://github.com/maxbarsukov/yaframework/blob/master/examples/configure.rb)
|
56
|
+
|
57
|
+
How to configure your application
|
58
|
+
|
45
59
|
## Installation
|
46
60
|
|
47
61
|
Clone this repo and go to this folder.
|
data/examples/helpers.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "yaframework"
|
4
|
+
app = Yaframework::Application
|
5
|
+
|
6
|
+
app.helpers do
|
7
|
+
def hello
|
8
|
+
"Hello"
|
9
|
+
end
|
10
|
+
|
11
|
+
def colon
|
12
|
+
", "
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
app.helpers do
|
17
|
+
def world
|
18
|
+
"world!"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
app.get "/" do
|
23
|
+
hello + colon + world
|
24
|
+
end
|
25
|
+
|
26
|
+
app.listen(9292)
|
data/examples/rendering/app.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
<p>Yout number was <b><%= number %></b></p>
|
data/lib/yaframework/base.rb
CHANGED
data/lib/yaframework/render.rb
CHANGED
@@ -36,9 +36,7 @@ module Yaframework
|
|
36
36
|
private
|
37
37
|
|
38
38
|
def _render(template, locals = {}, options = {}, &block)
|
39
|
-
_cache.fetch(template) {
|
40
|
-
Tilt.new(template, 1, options.merge(outvar: "@_output"))
|
41
|
-
}.render(self, locals, &block)
|
39
|
+
_cache.fetch(template) { Tilt.new(template, 1, options.merge(outvar: "@_output")) }.render(self, locals, &block)
|
42
40
|
end
|
43
41
|
|
44
42
|
def _cache
|
data/lib/yaframework/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaframework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- maxbarsukov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,17 +122,20 @@ files:
|
|
122
122
|
- examples/Gemfile
|
123
123
|
- examples/README.md
|
124
124
|
- examples/before_after_hooks.rb
|
125
|
+
- examples/configure.rb
|
125
126
|
- examples/content_types.rb
|
126
127
|
- examples/cookies.rb
|
127
128
|
- examples/error_handling.rb
|
128
129
|
- examples/halts_and_redirects.rb
|
129
130
|
- examples/headers.rb
|
130
131
|
- examples/hello_world.rb
|
132
|
+
- examples/helpers.rb
|
131
133
|
- examples/params.rb
|
132
134
|
- examples/rendering/app.rb
|
133
135
|
- examples/rendering/config.ru
|
134
136
|
- examples/rendering/views/index.erb
|
135
137
|
- examples/rendering/views/layout.erb
|
138
|
+
- examples/rendering/views/partial.erb
|
136
139
|
- lib/yaframework.rb
|
137
140
|
- lib/yaframework/base.rb
|
138
141
|
- lib/yaframework/render.rb
|