tubby 1.0 → 1.1
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 +5 -5
- data/CHANGELOG.md +6 -1
- data/LICENSE.md +55 -12
- data/README.md +4 -14
- data/lib/tubby.rb +14 -3
- metadata +8 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: bd594f1dcbabe992d83539b79b73d98c4fe21277458b20552c1e22529f1cf6d4
|
|
4
|
+
data.tar.gz: 1b7361729edb772bb64f67f12c8418e10f183abc198a7e6e7728866c44006a66
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a365e374496d4a097eeebe187757604f576e1886493c23b226c2cbba42228d0113c99d0c84af961b841e226b4e37dda008636f4d345994b8a38fe476911f5a8c
|
|
7
|
+
data.tar.gz: 7060f9c5bbbe77f6e6bfea7ec7e9c4ac56ae5bc078fcb4e7d1938f18a133d0d8235ad0a143e1d01ef1730e32654a425c6188257876ec5c23f987afdf5aaa48be
|
data/CHANGELOG.md
CHANGED
data/LICENSE.md
CHANGED
|
@@ -1,12 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
# Blue Oak Model License
|
|
2
|
+
|
|
3
|
+
Version 1.0.0
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
This license gives everyone as much permission to work with
|
|
8
|
+
this software as possible, while protecting contributors
|
|
9
|
+
from liability.
|
|
10
|
+
|
|
11
|
+
## Acceptance
|
|
12
|
+
|
|
13
|
+
In order to receive this license, you must agree to its
|
|
14
|
+
rules. The rules of this license are both obligations
|
|
15
|
+
under that agreement and conditions to your license.
|
|
16
|
+
You must not do anything with this software that triggers
|
|
17
|
+
a rule that you cannot or will not follow.
|
|
18
|
+
|
|
19
|
+
## Copyright
|
|
20
|
+
|
|
21
|
+
Each contributor licenses you to do everything with this
|
|
22
|
+
software that would otherwise infringe that contributor's
|
|
23
|
+
copyright in it.
|
|
24
|
+
|
|
25
|
+
## Notices
|
|
26
|
+
|
|
27
|
+
You must ensure that everyone who gets a copy of
|
|
28
|
+
any part of this software from you, with or without
|
|
29
|
+
changes, also gets the text of this license or a link to
|
|
30
|
+
<https://blueoakcouncil.org/license/1.0.0>.
|
|
31
|
+
|
|
32
|
+
## Excuse
|
|
33
|
+
|
|
34
|
+
If anyone notifies you in writing that you have not
|
|
35
|
+
complied with [Notices](#notices), you can keep your
|
|
36
|
+
license by taking all practical steps to comply within 30
|
|
37
|
+
days after the notice. If you do not do so, your license
|
|
38
|
+
ends immediately.
|
|
39
|
+
|
|
40
|
+
## Patent
|
|
41
|
+
|
|
42
|
+
Each contributor licenses you to do everything with this
|
|
43
|
+
software that would otherwise infringe any patent claims
|
|
44
|
+
they can license or become able to license.
|
|
45
|
+
|
|
46
|
+
## Reliability
|
|
47
|
+
|
|
48
|
+
No contributor can revoke this license.
|
|
49
|
+
|
|
50
|
+
## No Liability
|
|
51
|
+
|
|
52
|
+
***As far as the law allows, this software comes as is,
|
|
53
|
+
without any warranty or condition, and no contributor
|
|
54
|
+
will be liable to anyone for any damages related to this
|
|
55
|
+
software or this license, under any kind of legal claim.***
|
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Tubby: Tags in Ruby
|
|
2
2
|
|
|
3
|
+
[](https://rubygems.org/gems/tubby) [](https://travis-ci.com/judofyr/tubby)
|
|
4
|
+
|
|
3
5
|
Tubby is a lightweight library for writing HTML components in plain Ruby.
|
|
4
6
|
|
|
5
7
|
```ruby
|
|
@@ -377,17 +379,5 @@ compatible with earlier releases with the same MAJOR version.
|
|
|
377
379
|
|
|
378
380
|
## License
|
|
379
381
|
|
|
380
|
-
Tubby is is available under the
|
|
381
|
-
|
|
382
|
-
> Copyright (C) 2018 Magnus Holm <judofyr@gmail.com>
|
|
383
|
-
>
|
|
384
|
-
> Permission to use, copy, modify, and/or distribute this software for any
|
|
385
|
-
> purpose with or without fee is hereby granted.
|
|
386
|
-
>
|
|
387
|
-
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
388
|
-
> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
389
|
-
> AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
390
|
-
> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
391
|
-
> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
392
|
-
> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
393
|
-
> PERFORMANCE OF THIS SOFTWARE.
|
|
382
|
+
Tubby is is available under the Blue Oak Model License (see LICENSE.md).
|
|
383
|
+
This is a permissive license similar to BSD/MIT.
|
data/lib/tubby.rb
CHANGED
|
@@ -55,6 +55,18 @@ module Tubby
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def __attrs!(attrs)
|
|
58
|
+
if attrs.key?(:data) && attrs[:data].is_a?(Hash)
|
|
59
|
+
# Flatten present `data: {k1: v1, k2: v2}` attribute, inserting `data-k1: v1, data-k2: v2`
|
|
60
|
+
# into exact place where the attribute was
|
|
61
|
+
attrs = Hash[attrs.flat_map do |key, value|
|
|
62
|
+
if key == :data && value.is_a?(Hash)
|
|
63
|
+
value.map { |k, v| [:"data-#{k}", v] }
|
|
64
|
+
else
|
|
65
|
+
[[key, value]]
|
|
66
|
+
end
|
|
67
|
+
end]
|
|
68
|
+
end
|
|
69
|
+
|
|
58
70
|
attrs.each do |key, value|
|
|
59
71
|
if value.is_a?(Array)
|
|
60
72
|
value = value.compact.join(" ")
|
|
@@ -107,7 +119,7 @@ module Tubby
|
|
|
107
119
|
TAGS.each do |name|
|
|
108
120
|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
|
109
121
|
def #{name}(content = nil, **attrs, &blk)
|
|
110
|
-
tag!(#{name.inspect}, content, attrs, &blk)
|
|
122
|
+
tag!(#{name.inspect}, content, **attrs, &blk)
|
|
111
123
|
end
|
|
112
124
|
RUBY
|
|
113
125
|
end
|
|
@@ -115,7 +127,7 @@ module Tubby
|
|
|
115
127
|
SELF_CLOSING_TAGS.each do |name|
|
|
116
128
|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
|
117
129
|
def #{name}(**attrs)
|
|
118
|
-
self_closing_tag!(#{name.inspect}, attrs)
|
|
130
|
+
self_closing_tag!(#{name.inspect}, **attrs)
|
|
119
131
|
end
|
|
120
132
|
RUBY
|
|
121
133
|
end
|
|
@@ -134,4 +146,3 @@ module Tubby
|
|
|
134
146
|
end
|
|
135
147
|
end
|
|
136
148
|
end
|
|
137
|
-
|
metadata
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tubby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '1.
|
|
4
|
+
version: '1.1'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Magnus Holm
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-01-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description:
|
|
13
|
+
description:
|
|
14
14
|
email:
|
|
15
15
|
- judofyr@gmail.com
|
|
16
16
|
executables: []
|
|
@@ -23,9 +23,9 @@ files:
|
|
|
23
23
|
- lib/tubby.rb
|
|
24
24
|
homepage: https://github.com/judofyr/tubby
|
|
25
25
|
licenses:
|
|
26
|
-
-
|
|
26
|
+
- BlueOak-1.0.0
|
|
27
27
|
metadata: {}
|
|
28
|
-
post_install_message:
|
|
28
|
+
post_install_message:
|
|
29
29
|
rdoc_options: []
|
|
30
30
|
require_paths:
|
|
31
31
|
- lib
|
|
@@ -40,9 +40,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
41
|
version: '0'
|
|
42
42
|
requirements: []
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
signing_key:
|
|
43
|
+
rubygems_version: 3.0.3
|
|
44
|
+
signing_key:
|
|
46
45
|
specification_version: 4
|
|
47
46
|
summary: HTML templates as Ruby
|
|
48
47
|
test_files: []
|