Sorry for the very basic question.
System information:
- Language - Ruby
- Texteditor - Sublime 2
- Shell - Terminal
- Operating System - Mac Mavericks
Problem: I am writing code in ruby. How do I view in terminal the results/output from the code? For example, When I run the following code I would like to see how the gsub and squeeze commands modify the test document?
For example:
require 'tactful_tokenizer'
require 'treat'
require 'pry'
require_relative 'lib/extensions/String'
include Treat::Core::DSL # Gives quick access to named entity
tt = TactfulTokenizer::Model.new # Creates an instance of the tokenizer
keywordRegexes = [/death/,
/died/,
/passed \s+ away/xm,]
#Open example documents
Dir.glob('examples/*.txt'). each do |filename|
testdocument = File.open(filename).read
testdocument.gsub!(/[\n\r]/," ")
testdocument.squeeze!(" ")
end
Thanks in advance