Module: GuardHelpers::RrjjHelper

Includes:
BaseHelper
Defined in:
lib/guard_helpers/rrjj_helper.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#run_on_modifications(paths) ⇒ Object



23
24
25
26
27
28
# File 'lib/guard_helpers/rrjj_helper.rb', line 23

def run_on_modifications(paths)
  super if defined? super
  handle_each_path(%r{^lib/(.+)\.rb}) do |path|
    install
  end
end

#startObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/guard_helpers/rrjj_helper.rb', line 8

def start
  super if defined? super

  cmds_all = ::Rrjj::Cmds.all.dup
  cmds = ::Pry::CommandSet.new do
    cmds_all.each do |cmd|
      block_command cmd.shortcut, cmd.cmd do |*args|
        ::Kernel.system "#{cmd.cmd} #{args.join(" ")}"
      end
    end
  end

  ::Pry::Commands.import cmds
end