File tree Expand file tree Collapse file tree 7 files changed +64
-3
lines changed
Expand file tree Collapse file tree 7 files changed +64
-3
lines changed Original file line number Diff line number Diff line change 1+ ## [ 0.5.1] - 2021-07-26
2+
3+ - ` helpers ` and ` configure ` methods added
4+
15## [ 0.5.0] - 2021-07-25
26
37- Templates rendering added
Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- yaframework (0.5.0 )
4+ yaframework (0.5.1 )
55 rack (~> 2.2 , >= 2.2.3 )
66 tilt (~> 2.0 )
77
Original file line number Diff line number Diff line change @@ -42,11 +42,20 @@ Here are some examples of applications created with Yaframework:
4242 How to use ` before ` and ` after ` hooks
4343
4444
45- 8 . [ ** Rendering** ] ( https://github.com/maxbarsukov/yaframework/tree/master/examples/rendering )
45+ 9 . [ ** Rendering** ] ( https://github.com/maxbarsukov/yaframework/tree/master/examples/rendering )
4646
4747 Rendering your ` .erb ` (or any else) files and partials using tilt.
4848
4949
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+
5059## Installation
5160
5261Clone this repo and go to this folder.
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require "yaframework"
4+ app = Yaframework ::Application
5+
6+ app . configure do
7+ @app_name
8+ end
9+
10+ app . get "/" do
11+ "Hey, that's #{ @app_name } "
12+ end
13+
14+ app . listen ( 9292 )
Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ def initialize
2525 end
2626 end
2727
28+ def helpers ( &block )
29+ exec ( block ) if block_given?
30+ end
31+
32+ def configure ( &block )
33+ exec ( block ) if block_given?
34+ end
35+
2836 def call ( env )
2937 @env = env
3038 @request = Yaframework ::Request . new @env
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module Yaframework
4- VERSION = "0.5.0 "
4+ VERSION = "0.5.1 "
55end
You can’t perform that action at this time.
0 commit comments