Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby name of current file

# /rails_app_generator/cli/profile.rb

# Name of current program file
puts __FILE__					# => /rails_app_generator/cli/profile.rb
puts File.dirname(__FILE__)		# => /rails_app_generator/cli
puts File.basename(__FILE__)	# => profile.rb

# Name of starting program file
puts $0							# => exe/rag
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ruby #current #file
ADD COMMENT
Topic
Name
6+5 =