slides 0.1.5 → 0.1.6
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.
- data/lib/slides.rb +12 -1
- metadata +4 -4
data/lib/slides.rb
CHANGED
@@ -20,6 +20,17 @@ module Slides
|
|
20
20
|
@mtx ||= Mutex.new
|
21
21
|
end
|
22
22
|
|
23
|
+
def quote_string(k, v)
|
24
|
+
# try to find a quote style that fits
|
25
|
+
if !v.include?('"')
|
26
|
+
%{#{k}="#{v}"}
|
27
|
+
elsif !v.include?("'")
|
28
|
+
%{#{k}='#{v}'}
|
29
|
+
else
|
30
|
+
%{#{k}="#{v.gsub(/"/, '\\"')}"}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
23
34
|
def unparse(attrs)
|
24
35
|
attrs.map { |k, v| unparse_pair(k, v) }.compact.join(" ")
|
25
36
|
end
|
@@ -30,7 +41,7 @@ module Slides
|
|
30
41
|
if v == nil
|
31
42
|
nil
|
32
43
|
elsif v.is_a?(String) && v =~ /\s/
|
33
|
-
|
44
|
+
quote_string(k, v)
|
34
45
|
else
|
35
46
|
"#{k}=#{v}"
|
36
47
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slides
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: brandur@mutelight.org
|
@@ -39,8 +39,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
39
39
|
version: '0'
|
40
40
|
requirements: []
|
41
41
|
rubyforge_project:
|
42
|
-
rubygems_version: 1.8.
|
42
|
+
rubygems_version: 1.8.23
|
43
43
|
signing_key:
|
44
44
|
specification_version: 3
|
45
|
-
summary: An extremely simplistic logs-as-
|
45
|
+
summary: An extremely simplistic logs-as-events implementation.
|
46
46
|
test_files: []
|