slides 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/slides.rb +12 -1
  2. 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
- %{#{k}="#{v}"}
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.5
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-06-17 00:00:00.000000000 Z
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.24
42
+ rubygems_version: 1.8.23
43
43
  signing_key:
44
44
  specification_version: 3
45
- summary: An extremely simplistic logs-as-data implementation.
45
+ summary: An extremely simplistic logs-as-events implementation.
46
46
  test_files: []