Class: Twiddler::TargetBuilder::Macros
- Inherits:
-
RegexpBuilder
- Object
- Builder
- RegexpBuilder
- Twiddler::TargetBuilder::Macros
- Defined in:
- lib/twiddler/target_builder.rb
Instance Method Summary collapse
Methods inherited from RegexpBuilder
Methods inherited from Builder
#go, #initialize, #output_to, register, registered
Constructor Details
This class inherits a constructor from Twiddler::TargetBuilder::Builder
Instance Method Details
#filename ⇒ Object
71 72 73 |
# File 'lib/twiddler/target_builder.rb', line 71 def filename "Macros" end |
#regexp ⇒ Object
75 76 77 78 79 80 81 82 |
# File 'lib/twiddler/target_builder.rb', line 75 def regexp macros = @config.keyboard.find_all do |chord| chord.keystrokes.length > 1 and chord.keystrokes.all? do |stroke| stroke[1].empty? end end return %r{^.{0,1}(?:#{match_any_of(macros.map{|chord| chord.render_action})}).{0,1}$} end |