Module: GuardHelpers::RailsHelper

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

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#run_on_modifications(paths) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/guard_helpers/rails_helper.rb', line 21

def run_on_modifications(paths)
  super if defined? super

  handle_each_path(%r{^db/schema\.rb$}) do |path|
    guard_reset
  end
end

#startObject



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

def start
  super if defined? super
  cmds = ::Pry::CommandSet.new do
    block_command "cn", "model columns name" do |model|
      m = Object.const_get(model.camelize.to_sym)
      column_name = m.columns.map(&:name)
      Out.raw_out column_name
      Out.out "file:#{File.basename __FILE__} line:#{__LINE__}", "red"
    end
  end

  ::Pry::Commands.import cmds
end