Sha256: dcfcb22496af450f1f7f5dad93b64a07d98ade207ec3d5aabd0b971aeaaba7b6

Contents?: true

Size: 864 Bytes

Versions: 9

Compression:

Stored size: 864 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 similar 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

9 entries across 9 versions & 1 rubygems

Version Path
source_route-0.1.1 examples/show_init_files_when_rails_server_start.rb
source_route-0.1.0 examples/show_init_files_when_rails_server_start.rb
source_route-0.0.9 examples/show_init_files_when_rails_server_start.rb
source_route-0.0.8 examples/show_init_files_when_rails_server_start.rb
source_route-0.0.7 examples/show_init_files_when_rails_server_start.rb
source_route-0.0.6 examples/show_init_files_when_rails_server_start.rb
source_route-0.0.5 examples/show_init_files_when_rails_server_start.rb
source_route-0.0.4 examples/show_init_files_when_rails_server_start.rb
source_route-0.0.3 examples/show_init_files_when_rails_server_start.rb