osxsub 0.1.1 → 0.1.2
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/Gemfile.lock +1 -1
- data/lib/osxsub/ns_user_replacement_items.rb +7 -4
- data/lib/osxsub/version.rb +1 -1
- metadata +40 -25
data/Gemfile.lock
CHANGED
|
@@ -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
|
-
|
|
82
|
-
template = ERB.new(PLIST_TEMPLATE)
|
|
85
|
+
template = ERB.new(PLIST_TEMPLATE, nil, '>')
|
|
83
86
|
template.result(binding)
|
|
84
87
|
end
|
|
85
88
|
|
data/lib/osxsub/version.rb
CHANGED
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
47
|
-
segments:
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
hash: 3
|
|
60
|
+
segments:
|
|
48
61
|
- 0
|
|
49
|
-
|
|
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
|
-
|
|
56
|
-
segments:
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
hash: 3
|
|
69
|
+
segments:
|
|
57
70
|
- 0
|
|
58
|
-
|
|
71
|
+
version: "0"
|
|
59
72
|
requirements: []
|
|
73
|
+
|
|
60
74
|
rubyforge_project:
|
|
61
|
-
rubygems_version: 1.
|
|
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
|
+
|