karabiner 0.2.1 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7a0f316e44c4dcb9b913af362591b7002522f22
4
- data.tar.gz: eefaf1c21dc92d83765930efe35cc6e01b25e096
3
+ metadata.gz: 6cad9d51fd89f724dddd5a32a4131f4b47ca8a44
4
+ data.tar.gz: c754b37688ced16b446178aa8e84ede9dcc0aa52
5
5
  SHA512:
6
- metadata.gz: 55a4e821569aafbbf3d9c588ceed1d671d241cb209e3d13b9cdf5543a976184f93bafdd8c3217a3d32af14080a265bf089b89f1fed3a5decfb1e921fec1786b9
7
- data.tar.gz: c1db8415acacddc62ea206c846ebada797c035dfc224feadc1a0e0c74d2f098e4a416662376f77c27733b91fb4bd6a97043fb6c4e2e4f2713a3ca6e5b6fc113a
6
+ metadata.gz: 19bd1e9fc29b218399dbb2b8c01c60b16b5df8ffc6ffd9b5c96f298ce0b7f3de7901d10d0b7cfcfe67554a951823f9b98efa231a32f0dfbfa2aac180442edb69
7
+ data.tar.gz: 7d022b77f5b8a2cd4bceb13837bc6888fa30be66b8195fd6d9c9c49f667d46859841fcc3710bf1ed67b4cc1854b2d5f583941856b31f5b1e419bd5cd515e9253
@@ -1,5 +1,5 @@
1
1
  rvm:
2
- - 2.1.2
2
+ - 2.3.0
3
3
  branches:
4
4
  only:
5
5
  - master
data/README.md CHANGED
@@ -117,9 +117,9 @@ Shift_R Shift_L
117
117
 
118
118
  ```rb
119
119
  item "Application shortcuts" do
120
- remap "C-o", to: invoke("YoruFukurou")
121
- remap "C-u", to: invoke("Google Chrome")
122
- remap "C-h", to: invoke("iTerm")
120
+ remap "C-o", to: invoke("YoruFukurou") # Invoke the app under the /Applications.
121
+ remap "C-u", to: invoke("Google Chrome") # ditto.
122
+ remap "C-h", to: invoke("/Users/johndoe/Applications/iTerm.app") # Invoke the app of the specified path.
123
123
  end
124
124
 
125
125
  item "Copy date" do
@@ -1,3 +1,3 @@
1
1
  class Karabiner
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -4,7 +4,7 @@ class Karabiner::Vkopenurldef
4
4
  include Karabiner::XmlTree
5
5
 
6
6
  def self.application_keycode(application)
7
- "VK_OPEN_URL_APP_#{application.gsub(/ /, "_")}"
7
+ "VK_OPEN_URL_APP_#{File.basename(application, '.app').gsub(/ /, "_")}"
8
8
  end
9
9
 
10
10
  def self.script_keycode(script)
@@ -13,8 +13,15 @@ class Karabiner::Vkopenurldef
13
13
 
14
14
  def self.for_application(application)
15
15
  self.new.tap do |definition|
16
+
17
+ if application =~ %r|\A/.+app\z|
18
+ app_url = application
19
+ else
20
+ app_url = "/Applications/#{application}.app"
21
+ end
22
+
16
23
  name = Karabiner::Property.new("name", "KeyCode::#{application_keycode(application)}")
17
- url = Karabiner::Property.new("url", "/Applications/#{application}.app", type: "file")
24
+ url = Karabiner::Property.new("url", app_url, type: "file")
18
25
  definition.add_child(name, url)
19
26
  end
20
27
  end
@@ -203,7 +203,7 @@ describe Karabiner do
203
203
  item "Application shortcuts" do
204
204
  remap "C-o", to: invoke("YoruFukurou")
205
205
  remap "C-u", to: invoke("Google Chrome")
206
- remap "C-h", to: invoke("iTerm")
206
+ remap "C-h", to: invoke("/Users/johndoe/Applications/iTerm.app")
207
207
  end
208
208
 
209
209
  item "duplicate app" do
@@ -240,7 +240,7 @@ describe Karabiner do
240
240
 
241
241
  <vkopenurldef>
242
242
  <name>KeyCode::VK_OPEN_URL_APP_iTerm</name>
243
- <url type="file">/Applications/iTerm.app</url>
243
+ <url type="file">/Users/johndoe/Applications/iTerm.app</url>
244
244
  </vkopenurldef>
245
245
  </root>
246
246
  EOS
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karabiner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-30 00:00:00.000000000 Z
11
+ date: 2015-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  requirements: []
147
147
  rubyforge_project:
148
- rubygems_version: 2.4.5
148
+ rubygems_version: 2.5.1
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: Lightweight keyremap configuration DSL
@@ -156,3 +156,4 @@ test_files:
156
156
  - spec/lib/karabiner/remap_spec.rb
157
157
  - spec/lib/karabiner_spec.rb
158
158
  - spec/spec_helper.rb
159
+ has_rdoc: