dotremap 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dotremap/dsl/item.rb +6 -0
- data/lib/dotremap/openurl.rb +23 -0
- data/lib/dotremap/root.rb +3 -1
- data/lib/dotremap/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b583b2e6288717148abe4fdaf0a0005ee4e44d7b
|
4
|
+
data.tar.gz: 56162121e591fce2c2df10404fa8f058204f261e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6152e932f2ce3581d3bec446abb8697f9607a381e03c3b321e7ed1ef10091ed191ae693e85411c40c927cad8e34be869dbad70dd28d2c0bacf8218b7fbd0b407
|
7
|
+
data.tar.gz: de087ee48dac92eb7f479830e196e3b6fe63dc828d7784f1531fcd6489a086dd423b1907b23f6574b0cc1a77487fa2b38d075a64a96c970446fc17f80870289f
|
data/lib/dotremap/dsl/item.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "dotremap/dsl"
|
2
2
|
require "dotremap/property"
|
3
3
|
require "dotremap/remap"
|
4
|
+
require "dotremap/openurl"
|
4
5
|
|
5
6
|
module Dotremap::DSL::Item
|
6
7
|
AVAILABLE_PROPERTIES = %i(
|
@@ -19,6 +20,11 @@ module Dotremap::DSL::Item
|
|
19
20
|
childs << property
|
20
21
|
end
|
21
22
|
|
23
|
+
def invoke(application)
|
24
|
+
Dotremap::Openurl.register(application)
|
25
|
+
"VK_OPEN_URL_APP_#{application.gsub(/ /, '_')}"
|
26
|
+
end
|
27
|
+
|
22
28
|
private
|
23
29
|
|
24
30
|
def method_missing(property, value = '', options = {})
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "set"
|
2
|
+
|
3
|
+
module Dotremap::Openurl
|
4
|
+
def self.register(application)
|
5
|
+
@@registered_applications ||= Set.new
|
6
|
+
@@registered_applications.add(application)
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.registered_xml
|
10
|
+
return nil unless defined?(@@registered_applications)
|
11
|
+
|
12
|
+
@@registered_applications.map { |a| vkopenurl(a) }.join("\n\n").prepend("\n")
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.vkopenurl(application)
|
16
|
+
<<-EOS.unindent.gsub(/\n\Z/, "")
|
17
|
+
<vkopenurldef>
|
18
|
+
<name>KeyCode::VK_OPEN_URL_APP_#{application.gsub(/ /, "_")}</name>
|
19
|
+
<url type="file">/Applications/#{application}.app</url>
|
20
|
+
</vkopenurldef>
|
21
|
+
EOS
|
22
|
+
end
|
23
|
+
end
|
data/lib/dotremap/root.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "dotremap/openurl"
|
1
2
|
require "dotremap/dsl/root"
|
2
3
|
|
3
4
|
class Dotremap::Root
|
@@ -13,7 +14,8 @@ class Dotremap::Root
|
|
13
14
|
"<?xml version=\"1.0\"?>",
|
14
15
|
"<root>",
|
15
16
|
childs.map(&:to_xml).join("\n\n").gsub(/^/, " "),
|
17
|
+
Dotremap::Openurl.registered_xml.gsub(/^/, " "),
|
16
18
|
"</root>",
|
17
|
-
].join("\n")
|
19
|
+
].compact.join("\n")
|
18
20
|
end
|
19
21
|
end
|
data/lib/dotremap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotremap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- lib/dotremap/dsl/item.rb
|
75
75
|
- lib/dotremap/dsl/root.rb
|
76
76
|
- lib/dotremap/item.rb
|
77
|
+
- lib/dotremap/openurl.rb
|
77
78
|
- lib/dotremap/property.rb
|
78
79
|
- lib/dotremap/remap.rb
|
79
80
|
- lib/dotremap/root.rb
|