Sha256: b13338ac56c8d7bb8ed088af63fef8184f08b2a34f28421587474f2b120e1ed6

Contents?: true

Size: 881 Bytes

Versions: 5

Compression:

Stored size: 881 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'

SourceRoute.output_html

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
source_route-0.6.0 examples/show_init_files_when_rails_server_start.rb
source_route-0.5.0 examples/show_init_files_when_rails_server_start.rb
source_route-0.4.0 examples/show_init_files_when_rails_server_start.rb
source_route-0.3.0 examples/show_init_files_when_rails_server_start.rb
source_route-0.2.0 examples/show_init_files_when_rails_server_start.rb