Sha256: ea2ec345a6d4606cd4e73f5b8f483643ec9ca78589867637c600ea921e53df97

Contents?: true

Size: 856 Bytes

Versions: 7

Compression:

Stored size: 856 Bytes

Contents

#!/usr/bin/env ruby

# copy this file content to bin/rails, then run ./bin/rails s, it should show init files in order

require 'source_route'

SourceRoute.enable do
  file_paths = []
  event :line
  path 'your_rails_application_root_dir_name'
  output_format do |tp|
    unless file_paths.include? tp.path
      puts tp.path
      file_paths.push(tp.path)
    end
  end
end

# The above source route block defines trace point feature as following
    # files = []
    # tp = TracePoint.new(:line) do |tp|
    #   if tp.path =~ /your_rails_application_root_dir_name/
    #     unless files.include? tp.path
    #       puts "#{tp.path}".inspect
    #       files.push(tp.path)
    #     end
    #   end
    # end
    # tp.enable

APP_PATH = File.expand_path('../../config/application',  __FILE__)
require_relative '../config/boot'
require 'rails/commands'

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
source_route-0.1.8 examples/show_init_files_when_rails_server_start.rb
source_route-0.1.7 examples/show_init_files_when_rails_server_start.rb
source_route-0.1.6 examples/show_init_files_when_rails_server_start.rb
source_route-0.1.5 examples/show_init_files_when_rails_server_start.rb
source_route-0.1.4 examples/show_init_files_when_rails_server_start.rb
source_route-0.1.3 examples/show_init_files_when_rails_server_start.rb
source_route-0.1.2 examples/show_init_files_when_rails_server_start.rb