osxsub 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- osxsub (0.1.1)
4
+ osxsub (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -2,6 +2,8 @@ require 'rexml/document'
2
2
 
3
3
  module OsxSub
4
4
  class NSUserReplacementItems
5
+ require 'erb'
6
+
5
7
  PLIST_TEMPLATE = <<-PLIST
6
8
  <?xml version="1.0" encoding="UTF-8"?>
7
9
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@@ -14,9 +16,9 @@ module OsxSub
14
16
  <integer>1</integer>
15
17
  <% end %>
16
18
  <key>replace</key>
17
- <string><%= substitution.replace %></string>
19
+ <string><%= html_escape substitution.replace %></string>
18
20
  <key>with</key>
19
- <string><%= substitution.with %></string>
21
+ <string><%= html_escape substitution.with %></string>
20
22
  </dict>
21
23
  <% end %>
22
24
  </array>
@@ -67,6 +69,8 @@ module OsxSub
67
69
  self.new(default_substitutions)
68
70
  end
69
71
 
72
+ include ERB::Util
73
+
70
74
  attr_reader :substitutions
71
75
 
72
76
  def initialize(substitutions)
@@ -78,8 +82,7 @@ module OsxSub
78
82
  end
79
83
 
80
84
  def to_plist
81
- require 'erb'
82
- template = ERB.new(PLIST_TEMPLATE)
85
+ template = ERB.new(PLIST_TEMPLATE, nil, '>')
83
86
  template.result(binding)
84
87
  end
85
88
 
@@ -1,3 +1,3 @@
1
1
  module OsxSub
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,24 +1,34 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: osxsub
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ hash: 31
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 2
10
+ version: 0.1.2
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Mark Wunsch
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2013-01-28 00:00:00.000000000 Z
17
+
18
+ date: 2013-01-28 00:00:00 -05:00
19
+ default_executable:
13
20
  dependencies: []
21
+
14
22
  description: Command line utility for OS X Text Substition Preferences.
15
- email:
23
+ email:
16
24
  - mark@markwunsch.com
17
- executables:
25
+ executables:
18
26
  - osxsub
19
27
  extensions: []
28
+
20
29
  extra_rdoc_files: []
21
- files:
30
+
31
+ files:
22
32
  - .gitignore
23
33
  - Gemfile
24
34
  - Gemfile.lock
@@ -32,34 +42,39 @@ files:
32
42
  - lib/osxsub/substitution.rb
33
43
  - lib/osxsub/version.rb
34
44
  - osxsub.gemspec
45
+ has_rdoc: true
35
46
  homepage: http://github.com/mwunsch/osxsub
36
47
  licenses: []
48
+
37
49
  post_install_message:
38
50
  rdoc_options: []
39
- require_paths:
51
+
52
+ require_paths:
40
53
  - lib
41
- required_ruby_version: !ruby/object:Gem::Requirement
54
+ required_ruby_version: !ruby/object:Gem::Requirement
42
55
  none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
- segments:
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 3
60
+ segments:
48
61
  - 0
49
- hash: -1580353545740192625
50
- required_rubygems_version: !ruby/object:Gem::Requirement
62
+ version: "0"
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
64
  none: false
52
- requirements:
53
- - - ! '>='
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
- segments:
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ hash: 3
69
+ segments:
57
70
  - 0
58
- hash: -1580353545740192625
71
+ version: "0"
59
72
  requirements: []
73
+
60
74
  rubyforge_project:
61
- rubygems_version: 1.8.24
75
+ rubygems_version: 1.3.7
62
76
  signing_key:
63
77
  specification_version: 3
64
78
  summary: Command line utility for OS X Text Substition Preferences.
65
79
  test_files: []
80
+