Sha256: 1a40478992faaf99493f7dd7923b240987eed7390be86a5ee8a50cd32feb3ef7

Contents?: true

Size: 724 Bytes

Versions: 1

Compression:

Stored size: 724 Bytes

Contents

require 'guard_helpers/base_helper'

module ::GuardHelpers
  module RailsHelper
    include BaseHelper

    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

    def run_on_modifications(paths)
      super if defined? super

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

    module ClassMethods

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rrjj-0.0.1 lib/guard_helpers/rails_helper.rb