<commit_before># This is a demonstration of Ruby's File.expand_path method.
#
# File.expand_path converts a pathname to an absolute pathname.
#
# Try running this file from a few different locations.
#
# From this directory:
# $ ruby expand_path.rb
#
# From the parent directory:
# $ ruby examples/expand_path.rb
#
# From your home directory
# $ ruby path/to/ruby-examples/examples/expand_path.rb

puts ""
puts "The value of `__FILE__` (the name of this Ruby file) is:"
puts __FILE__

puts ""
puts "The absolute path of this Ruby file is:"
puts File.expand_path(__FILE__)

puts ""
puts "The relative path from this file to `args.rb` is:"
puts "./args.rb"

puts ""
puts "Does `File.exists?` return true for the relative path `./args.rb`?"
puts File.exists?("./args.rb")

puts ""
puts "The absolute path to `args.rb` is:"
puts File.expand_path("../args.rb", __FILE__)

puts ""
puts "Does `File.exists?` return true for the absolute path of `args.rb`?"
puts File.exists?(File.expand_path("../args.rb", __FILE__))

puts ""
puts "The tilde character '~' represents your home directory, so `File.expand_path('~/')` is:"
puts File.expand_path('~/')

puts ""
puts "A single period '.' represents the current directory, so `File.expand_path('.')` is:"
puts File.expand_path('.')

puts ""
puts "Two periods '..' represents the parent directory, so `File.expand_path('..')` is:"
puts File.expand_path('..')<commit_msg>Show lines of output in expand_path code more clearly<commit_after># This is a demonstration of Ruby's File.expand_path method.
#
# File.expand_path converts a pathname to an absolute pathname.
#
# Try running this file from a few different locations.
#
# From this directory:
# $ ruby expand_path.rb
#
# From the parent directory:
# $ ruby examples/expand_path.rb
#
# From your home directory
# $ ruby path/to/ruby-examples/examples/expand_path.rb

puts ""
puts "The value of `__FILE__` (the name of this Ruby file) is:"
puts "=> #{__FILE__}"

puts ""
puts "The absolute path of this Ruby file is:"
puts "=> #{File.expand_path(__FILE__)}"

puts ""
puts "The relative path from this file to `args.rb` is:"
puts "=> #{"./args.rb"}"

puts ""
puts "Does `File.exists?` return true for the relative path `./args.rb`?"
puts "=> #{File.exists?("./args.rb")}"

puts ""
puts "The absolute path to `args.rb` is:"
puts "=> #{File.expand_path("../args.rb", __FILE__)}"

puts ""
puts "Does `File.exists?` return true for the absolute path of `args.rb`?"
puts "=> #{File.exists?(File.expand_path("../args.rb", __FILE__))}"

puts ""
puts "The tilde character '~' represents your home directory."
puts "`File.expand_path('~/')` is:"
puts "=> #{File.expand_path('~/')}"

puts ""
puts "A single period '.' represents the current directory."
puts "`File.expand_path('.')` is:"
puts "=> #{File.expand_path('.')}"

puts ""
puts "Two periods '..' represents the parent directory."
puts "`File.expand_path('..')` is:"
puts "=> #{File.expand_path('..')}"
{'fraction_non_alphanumeric': 0.1650782845473111, 'fraction_numerical': 0.0, 'mean_word_length': 4.493457943925233, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4191167', 'n_tokens_mistral': 1025, 'n_tokens_neox': 1007, 'n_words': 333}