rubyview 0.0.1 → 0.0.2
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 +4 -4
- data/lib/rubyview/context.rb +1 -0
- data/lib/rubyview/dsl.rb +3 -3
- data/lib/rubyview/helpers/tag.rb +11 -7
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 741e5fa918e6c93f2719516d491baa3713aa6ca2e03ae3268415e33664a6177c
|
|
4
|
+
data.tar.gz: 517c6a5099e0ee7a344472b512876c0244e27ff55b86f2f731d821566a2f328e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50152215fed0616ae6773d3d814042fabed9b3a1a52cf32fe43e088d5bd0edb3a701716ec05de803eb27889f61b71f490ceb90ae5c8461ea35c94c76c06b48a7
|
|
7
|
+
data.tar.gz: 28abd11cc8393a0ca0bccc59ce1bb9d65e48fc880a25d9300798ef2a59e4327252b09c9b252c14695fff88ce2b3760d1094a0999e488e04e69389d2d439ecc1f
|
data/lib/rubyview/context.rb
CHANGED
data/lib/rubyview/dsl.rb
CHANGED
data/lib/rubyview/helpers/tag.rb
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
class RubyView
|
|
2
2
|
module Helpers
|
|
3
3
|
module Tag
|
|
4
|
-
def h1(
|
|
5
|
-
|
|
6
|
-
end
|
|
4
|
+
def h1(...); render_tag(:h1, ...); end;
|
|
5
|
+
def p(...); render_tag(:p, ...); end;
|
|
6
|
+
def div(...); render_tag(:div, ...); end;
|
|
7
7
|
|
|
8
|
-
def
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
def render_tag(...) # for storing to rendered content variable.
|
|
9
|
+
@_rendered_content += generate_tag(...)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def generate_tag(name, content, **html_opts) # for assembling HTML tag
|
|
13
|
+
"<#{name}#{format_html_opts(**html_opts)}>#{content}</#{name}>"
|
|
11
14
|
end
|
|
12
15
|
|
|
13
16
|
def format_html_opts(**html_opts)
|
|
@@ -16,4 +19,5 @@ class RubyView
|
|
|
16
19
|
end
|
|
17
20
|
end
|
|
18
21
|
end
|
|
19
|
-
end
|
|
22
|
+
end
|
|
23
|
+
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubyview
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Indigo Tech
|
|
@@ -38,7 +38,8 @@ files:
|
|
|
38
38
|
homepage: https://rubygems.org/gems/rubyview
|
|
39
39
|
licenses:
|
|
40
40
|
- MIT
|
|
41
|
-
metadata:
|
|
41
|
+
metadata:
|
|
42
|
+
source_code_uri: https://github.com/indigotechtutorials/rubyview
|
|
42
43
|
rdoc_options: []
|
|
43
44
|
require_paths:
|
|
44
45
|
- lib
|