Class: Karabiner

Inherits:
Object
  • Object
show all
Defined in:
lib/karabiner/namespace.rb,
lib/karabiner.rb,
lib/karabiner/version.rb

Overview

Files which require this file can avoid deep nesting for class declaration

Defined Under Namespace

Modules: CLI, DSL, History, XmlTree Classes: Appdef, Config, Group, Item, Key, Property, Remap, Root, Vkopenurldef

Constant Summary collapse

XML_FILE_NAME =
"private.xml"
XML_DIR =
File.expand_path("~/Library/Application Support/Karabiner")
VERSION =
"0.2.1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_path) ⇒ Karabiner

Returns a new instance of Karabiner.



11
12
13
14
# File 'lib/karabiner.rb', line 11

def initialize(config_path)
  @config_path = config_path
  Karabiner::History.clear_histroy
end

Instance Attribute Details

#config_pathObject (readonly)

Returns the value of attribute config_path.



15
16
17
# File 'lib/karabiner.rb', line 15

def config_path
  @config_path
end

Instance Method Details

#apply_configurationObject



17
18
19
20
21
22
# File 'lib/karabiner.rb', line 17

def apply_configuration
  replace_private_xml
  CLI.reload_xml

  puts "Successfully updated Karabiner configuration"
end