File tree Expand file tree Collapse file tree 6 files changed +69
-21
lines changed Expand file tree Collapse file tree 6 files changed +69
-21
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,12 @@ The HTML rp tag implemented in ruby.
9
9
This component can take 2 optional configuration params and optional content.
10
10
11
11
#### # id (optional)
12
- Expects a string with all ids the main should have.
12
+ Expects a string with all ids the rp should have.
13
13
14
14
#### # class (optional)
15
- Expects a string with all classes the main should have.
15
+ Expects a string with all classes the rp should have.
16
16
17
- ## Example
17
+ ## Example 1: Yield a given block
18
18
19
19
``` ruby
20
20
rp id: " foo" , class : " bar" do
@@ -29,3 +29,16 @@ returns
29
29
Hello World
30
30
</rp >
31
31
```
32
+
33
+ ## Example 2: Render options[ : text ] param
34
+
35
+ ``` ruby
36
+ rp id: " foo" , class : " bar" , text: ' Hello World'
37
+ ```
38
+
39
+ returns
40
+
41
+ ``` html
42
+ <rp id =" foo" class =" bar" >
43
+ Hello World
44
+ </rp >
Original file line number Diff line number Diff line change @@ -9,12 +9,12 @@ The HTML rt tag implemented in ruby.
9
9
This component can take 2 optional configuration params and optional content.
10
10
11
11
#### # id (optional)
12
- Expects a string with all ids the main should have.
12
+ Expects a string with all ids the rt should have.
13
13
14
14
#### # class (optional)
15
- Expects a string with all classes the main should have.
15
+ Expects a string with all classes the rt should have.
16
16
17
- ## Example
17
+ ## Example 1: Yield a given block
18
18
19
19
``` ruby
20
20
rt id: " foo" , class : " bar" do
@@ -29,3 +29,16 @@ returns
29
29
Hello World
30
30
</rt >
31
31
```
32
+
33
+ ## Example 2: Render options[ : text ] param
34
+
35
+ ``` ruby
36
+ rt id: " foo" , class : " bar" , text: ' Hello World'
37
+ ```
38
+
39
+ returns
40
+
41
+ ``` html
42
+ <rt id =" foo" class =" bar" >
43
+ Hello World
44
+ </rt >
Original file line number Diff line number Diff line change @@ -9,12 +9,12 @@ The HTML ruby tag implemented in ruby.
9
9
This component can take 2 optional configuration params and optional content.
10
10
11
11
#### # id (optional)
12
- Expects a string with all ids the main should have.
12
+ Expects a string with all ids the ruby should have.
13
13
14
14
#### # class (optional)
15
- Expects a string with all classes the main should have.
15
+ Expects a string with all classes the ruby should have.
16
16
17
- ## Example
17
+ ## Example 1: : Yield a given block
18
18
19
19
``` ruby
20
20
ruby id: " foo" , class : " bar" do
@@ -29,3 +29,16 @@ returns
29
29
Hello World
30
30
</ruby >
31
31
```
32
+
33
+ ## Example 2: Render options[ : text ] param
34
+
35
+ ``` ruby
36
+ ruby id: " foo" , class : " bar" , text: ' Hello World'
37
+ ```
38
+
39
+ returns
40
+
41
+ ``` html
42
+ <ruby id =" foo" class =" bar" >
43
+ Hello World
44
+ </ruby >
Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ class ExamplePage < Matestack::Ui::Page
9
9
10
10
def response
11
11
components {
12
+ # simple rp
13
+ rp text : 'I am simple'
14
+
15
+ # enhanced rp
12
16
rp id : 'my-id' , class : 'my-class' do
13
- plain 'Hello World' #optional content
17
+ plain 'I am enhanced'
14
18
end
15
19
}
16
20
end
@@ -22,9 +26,8 @@ def response
22
26
static_output = page . html
23
27
24
28
expected_static_output = <<~HTML
25
- < rp id ="my-id " class ="my-class ">
26
- Hello World
27
- </ rp >
29
+ < rp > I am simple</ rp >
30
+ < rp id ="my-id " class ="my-class "> I am enhanced</ rp >
28
31
HTML
29
32
30
33
expect ( stripped ( static_output ) ) . to include ( stripped ( expected_static_output ) )
Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ class ExamplePage < Matestack::Ui::Page
9
9
10
10
def response
11
11
components {
12
+ # simple rt
13
+ rt text : 'I am simple'
14
+
15
+ # enhanced rt
12
16
rt id : 'my-id' , class : 'my-class' do
13
- plain 'Hello World' #optional content
17
+ plain 'I am enhanced'
14
18
end
15
19
}
16
20
end
@@ -22,9 +26,8 @@ def response
22
26
static_output = page . html
23
27
24
28
expected_static_output = <<~HTML
25
- < rt id ="my-id " class ="my-class ">
26
- Hello World
27
- </ rt >
29
+ < rt > I am simple</ rt >
30
+ < rt id ="my-id " class ="my-class "> I am enhanced</ rt >
28
31
HTML
29
32
30
33
expect ( stripped ( static_output ) ) . to include ( stripped ( expected_static_output ) )
Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ class ExamplePage < Matestack::Ui::Page
9
9
10
10
def response
11
11
components {
12
+ # simple ruby
13
+ ruby text : 'I am simple'
14
+
15
+ # enhanced ruby
12
16
ruby id : 'my-id' , class : 'my-class' do
13
- plain 'Hello World' #optional content
17
+ plain 'I am enhanced'
14
18
end
15
19
}
16
20
end
@@ -22,9 +26,8 @@ def response
22
26
static_output = page . html
23
27
24
28
expected_static_output = <<~HTML
25
- < ruby id ="my-id " class ="my-class ">
26
- Hello World
27
- </ ruby >
29
+ < ruby > I am simple</ ruby >
30
+ < ruby id ="my-id " class ="my-class "> I am enhanced</ ruby >
28
31
HTML
29
32
30
33
expect ( stripped ( static_output ) ) . to include ( stripped ( expected_static_output ) )
You can’t perform that action at this time.
0 commit comments