htmle 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/lib/htmle.rb +79 -0
- data.tar.gz.sig +0 -0
- metadata +88 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d980bce6ca9cfce03ebe3a62efc74707be06eded
|
4
|
+
data.tar.gz: 1d042f9270d9dbfc620191a2fd4d5a1fc8f06f7f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6e0db1fb74c1db9343b146412658e3c5350b61178ea858683f43eb321fdb96b80a4667e7bf7b0787b9cc4fe28e990f0c686239b18373ac5f2fbadde07ffef8e1
|
7
|
+
data.tar.gz: f4b439ae1acbf42de6056d38094582a37db81fdfa61a4720cea0fe4f175169b3091e5067fdb670208047a2035c3d4e143fc322b5304bbe7a2d6d40086c538b09
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data/lib/htmle.rb
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: htmle.rb
|
4
|
+
|
5
|
+
require 'svgle'
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
DEFAULT_CSS = <<CSS
|
10
|
+
|
11
|
+
html {background-color: white}
|
12
|
+
div {background-color: green; padding: 30 10; margin: 5 5;}
|
13
|
+
|
14
|
+
CSS
|
15
|
+
|
16
|
+
class Htmle < Domle
|
17
|
+
|
18
|
+
class Box < Element
|
19
|
+
attr2_accessor *%i(class width height)
|
20
|
+
end
|
21
|
+
|
22
|
+
class Html < Box
|
23
|
+
end
|
24
|
+
|
25
|
+
class Head < Box
|
26
|
+
end
|
27
|
+
|
28
|
+
class Body < Box
|
29
|
+
end
|
30
|
+
|
31
|
+
class Div < Box
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def fetch_style(attribute)
|
37
|
+
|
38
|
+
h = super attribute
|
39
|
+
|
40
|
+
%i(margin padding).each do |x|
|
41
|
+
|
42
|
+
if h.has_key? x then
|
43
|
+
|
44
|
+
a = expand_shorthand(h[x])
|
45
|
+
h[x] = ([(sym.to_s + '-')] * 4).zip.%w(top right bottom left).zip(a)
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
def find_add_css()
|
55
|
+
|
56
|
+
# add the default CSS
|
57
|
+
add_css DEFAULT_CSS
|
58
|
+
|
59
|
+
|
60
|
+
@doc.root.xpath('//style').each {|e| add_css e.text }
|
61
|
+
|
62
|
+
# check for an external CSS file
|
63
|
+
# still to-do
|
64
|
+
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
def defined_elements()
|
70
|
+
{
|
71
|
+
doc: Rexle::Element,
|
72
|
+
html: Htmle::Html,
|
73
|
+
head: Htmle::Head,
|
74
|
+
body: Htmle::Body,
|
75
|
+
div: Htmle::Div
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: htmle
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Robertson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
|
+
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
+
8ixkARkWAmV1MB4XDTE1MTEyNTE1MDI1OFoXDTE2MTEyNDE1MDI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GV8QvV3GDUsKDQymbxUlCKoEDtJxURDkbICbZaQCYatMwnk
|
31
|
+
9/8tMrxMp33ZKdljAh8KititpZ31BDtBNavEU2kZMbNV6fFHnMRMx0k1U9EilTqT
|
32
|
+
SmSNn+xbqen7GA==
|
33
|
+
-----END CERTIFICATE-----
|
34
|
+
date: 2015-11-25 00:00:00.000000000 Z
|
35
|
+
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: domle
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0.1'
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.1.0
|
46
|
+
type: :runtime
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - "~>"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0.1'
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.1.0
|
56
|
+
description:
|
57
|
+
email: james@r0bertson.co.uk
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- lib/htmle.rb
|
63
|
+
homepage: https://github.com/jrobertson/htmle
|
64
|
+
licenses:
|
65
|
+
- MIT
|
66
|
+
metadata: {}
|
67
|
+
post_install_message:
|
68
|
+
rdoc_options: []
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
requirements: []
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 2.4.8
|
84
|
+
signing_key:
|
85
|
+
specification_version: 4
|
86
|
+
summary: "*Experimental gem under development* Htmle (HTML + Domle) is an implementation
|
87
|
+
of an HTML Document Object Model"
|
88
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|