tagz 4.3.0 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +2 -0
- data/gemspec.rb +4 -1
- data/lib/tagz.rb +13 -6
- metadata +15 -6
data/README
CHANGED
data/gemspec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
#! /usr/bin/env gem build
|
2
|
+
|
1
3
|
lib, version = File::basename(File::dirname(File::expand_path(__FILE__))).split %r/-/, 2
|
2
4
|
|
3
5
|
require 'rubygems'
|
@@ -21,14 +23,15 @@ Gem::Specification::new do |spec|
|
|
21
23
|
spec.executables = shiteless[Dir::glob("bin/*")].map{|exe| File::basename exe}
|
22
24
|
|
23
25
|
spec.require_path = "lib"
|
24
|
-
spec.autorequire = lib
|
25
26
|
|
26
27
|
spec.has_rdoc = File::exist? "doc"
|
27
28
|
spec.test_suite_file = "test/#{ lib }.rb" if File::directory? "test"
|
28
29
|
#spec.add_dependency 'lib', '>= version'
|
30
|
+
spec.add_dependency 'fattr'
|
29
31
|
|
30
32
|
spec.extensions << "extconf.rb" if File::exists? "extconf.rb"
|
31
33
|
|
34
|
+
spec.rubyforge_project = 'codeforpeople'
|
32
35
|
spec.author = "Ara T. Howard"
|
33
36
|
spec.email = "ara.t.howard@gmail.com"
|
34
37
|
spec.homepage = "http://codeforpeople.com/lib/ruby/#{ lib }/"
|
data/lib/tagz.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
unless defined? Tagz
|
2
2
|
|
3
|
-
require 'cgi'
|
4
|
-
|
5
3
|
module Tagz
|
6
4
|
unless defined?(Tagz::VERSION)
|
7
5
|
Tagz::VERSION = [
|
@@ -12,6 +10,15 @@ unless defined? Tagz
|
|
12
10
|
def Tagz.version() Tagz::VERSION end
|
13
11
|
end
|
14
12
|
|
13
|
+
def Tagz.escapeHTML string
|
14
|
+
string = string.to_s.dup
|
15
|
+
string.gsub!(%r/&/n, '&')
|
16
|
+
string.gsub!(%r/\"/n, '"')
|
17
|
+
string.gsub!(%r/>/n, '>')
|
18
|
+
string.gsub!(%r/</n, '<')
|
19
|
+
string
|
20
|
+
end
|
21
|
+
|
15
22
|
class Fragment < ::String
|
16
23
|
def << other
|
17
24
|
super other.to_s
|
@@ -28,8 +35,8 @@ unless defined? Tagz
|
|
28
35
|
unless options.empty?
|
29
36
|
' ' <<
|
30
37
|
options.map do |key, value|
|
31
|
-
key =
|
32
|
-
value =
|
38
|
+
key = Tagz.escapeHTML key.to_s
|
39
|
+
value = Tagz.escapeHTML value.to_s
|
33
40
|
if value =~ %r/"/
|
34
41
|
raise ArgumentError, value if value =~ %r/'/
|
35
42
|
value = "'#{ value }'"
|
@@ -113,8 +120,8 @@ unless defined? Tagz
|
|
113
120
|
unless options.empty?
|
114
121
|
attributes = ' ' <<
|
115
122
|
options.map do |key, value|
|
116
|
-
key =
|
117
|
-
value =
|
123
|
+
key = Tagz.escapeHTML key.to_s
|
124
|
+
value = Tagz.escapeHTML value.to_s
|
118
125
|
if value =~ %r/"/
|
119
126
|
raise ArgumentError, value if value =~ %r/'/
|
120
127
|
value = "'#{ value }'"
|
metadata
CHANGED
@@ -1,18 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tagz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ara T. Howard
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-24 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: fattr
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
16
25
|
description:
|
17
26
|
email: ara.t.howard@gmail.com
|
18
27
|
executables: []
|
@@ -57,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
66
|
version:
|
58
67
|
requirements: []
|
59
68
|
|
60
|
-
rubyforge_project:
|
69
|
+
rubyforge_project: codeforpeople
|
61
70
|
rubygems_version: 1.2.0
|
62
71
|
signing_key:
|
63
72
|
specification_version: 2
|