htmlutils 0.0.0.pre.dev → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +1 -0
- data/Rakefile +9 -0
- data/htmlutils.gemspec +26 -0
- data/lib/htmlutils.rb +3 -0
- data/lib/htmlutils/macro.rb +40 -0
- data/lib/htmlutils/version.rb +3 -0
- metadata +14 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 123ed02fd787c977334c60bfaa7248291880740d
|
4
|
+
data.tar.gz: 84a854b88d8d43a59b9dd01efceee9ee5716f33e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06bbeb16429054ff06175aec2534e00c44753f2744de02522650b3335d1385d7812bd5cd55b2638b4854b1ea1747023aeed187d4cad9211a93e161f37a63fe3d
|
7
|
+
data.tar.gz: 78f89a95c26b74f778af5ce86adab320537a438b9d75006099b1a4a360a70f7d257a9baec8205dc3e761279ec73f5c24d8a5e55357af8e3381838f655c3ee644
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Nickolay
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
NYI
|
data/Rakefile
ADDED
data/htmlutils.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'htmlutils/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "htmlutils"
|
8
|
+
spec.version = HtmlUtils::VERSION
|
9
|
+
spec.authors = ["Nickolay"]
|
10
|
+
spec.email = ["nickolay02@inbox.ru"]
|
11
|
+
|
12
|
+
spec.summary = %q{Some utils for writing shorter HTML (ERB) code}
|
13
|
+
spec.description = %q{}
|
14
|
+
spec.homepage = "https://github.com/handicraftsman/htmlutils"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.13"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
end
|
data/lib/htmlutils.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
module HtmlUtils
|
2
|
+
puts self.instance_methods
|
3
|
+
|
4
|
+
def loadScripts(urls, type="text/javascript")
|
5
|
+
str = ""
|
6
|
+
urls.each do |url|
|
7
|
+
str << %{<script type="#{type}" src="#{url}"></script>\n}
|
8
|
+
end
|
9
|
+
str
|
10
|
+
end
|
11
|
+
|
12
|
+
def loadStyles(urls, type="text/css")
|
13
|
+
str = ""
|
14
|
+
urls.each do |url|
|
15
|
+
str << %{<link type="#{type}" rel="stylesheet" src="#{url}"}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.makeVTable(data)
|
20
|
+
str = ""
|
21
|
+
str << "<table>\n"
|
22
|
+
str << " <tr>\n"
|
23
|
+
data.each do |d|
|
24
|
+
str << %{ <th>#{d[0]}</th>\n}
|
25
|
+
end
|
26
|
+
|
27
|
+
str << " </tr>\n"
|
28
|
+
|
29
|
+
data.each do |d|
|
30
|
+
str << " <tr>\n"
|
31
|
+
d[1..-1].each do |d1|
|
32
|
+
str << " <td>#{d1}</td>\n"
|
33
|
+
end
|
34
|
+
str << " </tr>\n"
|
35
|
+
end
|
36
|
+
|
37
|
+
str << "</table>\n"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: htmlutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nickolay
|
@@ -44,7 +44,16 @@ email:
|
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
|
-
files:
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- htmlutils.gemspec
|
54
|
+
- lib/htmlutils.rb
|
55
|
+
- lib/htmlutils/macro.rb
|
56
|
+
- lib/htmlutils/version.rb
|
48
57
|
homepage: https://github.com/handicraftsman/htmlutils
|
49
58
|
licenses:
|
50
59
|
- MIT
|
@@ -60,13 +69,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
69
|
version: '0'
|
61
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
71
|
requirements:
|
63
|
-
- - "
|
72
|
+
- - ">="
|
64
73
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
74
|
+
version: '0'
|
66
75
|
requirements: []
|
67
76
|
rubyforge_project:
|
68
77
|
rubygems_version: 2.5.1
|
69
78
|
signing_key:
|
70
79
|
specification_version: 4
|
71
|
-
summary: Some
|
80
|
+
summary: Some utils for writing shorter HTML (ERB) code
|
72
81
|
test_files: []
|