ruby_html 0.0.2 → 0.0.3
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/README.md +17 -16
- data/lib/ruby_html/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4875574430eb91491d8bc9df2596a672b27f7af4c64d69cf346846e2da34bff
|
4
|
+
data.tar.gz: 53e7cd3caafb6d3c7494f2ffc41460a620548d3c40768ab167d0dcd513bb0819
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc3efe40d2695bda6044721fc28e6d20fb2818f841c3fab757fae165d0d22fc3fe3166140e765a1622547bd803fe5e5a6e3cbffe51fc32f5aca6e755f4e45e86
|
7
|
+
data.tar.gz: d84b875bf71c100fd786bb150e0427ada92bb85455178cfcf9212db38308914039f599d00e132457120b5983249a12cbfca8e9a99157e2becc587e4681945036
|
data/README.md
CHANGED
@@ -1,24 +1,26 @@
|
|
1
1
|
# Ruby HTML
|
2
2
|
|
3
|
-
|
3
|
+
An HTML document builder in Ruby.
|
4
4
|
|
5
5
|
### Installation
|
6
6
|
|
7
|
-
|
7
|
+
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
+
```ruby
|
10
|
+
gem "ruby_html"
|
9
11
|
```
|
10
|
-
git clone https://github.com/jonathanwthom/ruby_html.git
|
11
|
-
cd rhtml
|
12
|
-
irb
|
13
|
-
require_relative "ruby_html"
|
14
|
-
```
|
15
12
|
|
16
|
-
|
17
|
-
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install ruby_html
|
18
20
|
|
19
21
|
### How to Use It
|
20
22
|
|
21
|
-
HTML
|
23
|
+
HTML elements have the names you think they would. For example, to create a div:
|
22
24
|
|
23
25
|
```
|
24
26
|
div = Div.new
|
@@ -65,7 +67,7 @@ title = Title.new("Page Title")
|
|
65
67
|
Document.new(Div.new, header_elements: [title])
|
66
68
|
```
|
67
69
|
|
68
|
-
`Document` has a special method, `#render_to_file` that
|
70
|
+
`Document` has a special method, `#render_to_file` that receives a file path, and creates your html document there.
|
69
71
|
|
70
72
|
```
|
71
73
|
Document.new.render_to_file("hello_world.html")
|
@@ -75,11 +77,10 @@ Document.new.render_to_file("hello_world.html")
|
|
75
77
|
|
76
78
|
### TODO
|
77
79
|
|
78
|
-
|
79
|
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
- Gemify it.
|
80
|
+
- Build out remaining elements. There are a few that conflict with ruby (such as `Object`).
|
81
|
+
- Code clean up (alphabetical order, some methods probably don't need to be public, etc).
|
82
|
+
- The single quotes for attributes are a bit weird, and you might not always want those.
|
83
|
+
- It desperately needs some tests!
|
83
84
|
|
84
85
|
### Contributing
|
85
86
|
|
data/lib/ruby_html/version.rb
CHANGED