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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c20ff50b4c8c40e065b5b1e7660b06611f2c6659a32ddd6338332ce7a4b687d
4
- data.tar.gz: a75ff4d216cbb2b9179f7eaf27610ef0e56440a844962813be9bfa1a60616e77
3
+ metadata.gz: 741e5fa918e6c93f2719516d491baa3713aa6ca2e03ae3268415e33664a6177c
4
+ data.tar.gz: 517c6a5099e0ee7a344472b512876c0244e27ff55b86f2f731d821566a2f328e
5
5
  SHA512:
6
- metadata.gz: bb91c966c025a527fb3fcffb17d8944eb359e86021d3b329406e00bea4df0249421ea867b9a9f5e663106848fb1f6ef3860f84252df40375cfb67c849cb6e42d
7
- data.tar.gz: 6a75bf3bed066cc150fda873d4ea434b399d4f0be36cf3ea3825f9f7b9f0fb73c6693d9ef6d857562c1a6c3011f7eb0c4d37de9152d5901aa6c5bbb6551b7b5a
6
+ metadata.gz: 50152215fed0616ae6773d3d814042fabed9b3a1a52cf32fe43e088d5bd0edb3a701716ec05de803eb27889f61b71f490ceb90ae5c8461ea35c94c76c06b48a7
7
+ data.tar.gz: 28abd11cc8393a0ca0bccc59ce1bb9d65e48fc880a25d9300798ef2a59e4327252b09c9b252c14695fff88ce2b3760d1094a0999e488e04e69389d2d439ecc1f
@@ -12,6 +12,7 @@ class RubyView
12
12
  template_path = File.join(Dir.pwd, path_to_template)
13
13
  template_content = File.read(template_path)
14
14
  instance_eval(template_content)
15
+ @_rendered_content
15
16
  end
16
17
  end
17
18
  end
data/lib/rubyview/dsl.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  class RubyView
2
2
  module DSL
3
- def header(text, **html_opts)
4
- h1(text, **html_opts)
5
- end
3
+ def header(...); h1(...); end;
4
+ def text(...); p(...); end;
5
+ def container(...); div(...); end;
6
6
  end
7
7
  end
@@ -1,13 +1,16 @@
1
1
  class RubyView
2
2
  module Helpers
3
3
  module Tag
4
- def h1(text, **html_opts)
5
- generate_tag(:h1, text, **html_opts)
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 generate_tag(name, content, **html_opts)
9
- formatted_html_opts = format_html_opts(**html_opts)
10
- "<#{name}#{formatted_html_opts}>#{content}</#{name}>"
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.1
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