From 7d0b7fa88ca10bf8ee1f943a630f6f8dd9e3946f Mon Sep 17 00:00:00 2001 From: Belizario Rocha Date: Wed, 5 Jul 2017 23:26:25 +0000 Subject: [PATCH 1/2] Master 2.0 Just testing... --- app/controllers/calculations_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/calculations_controller.rb b/app/controllers/calculations_controller.rb index 0df2d0f..c6cdaa4 100644 --- a/app/controllers/calculations_controller.rb +++ b/app/controllers/calculations_controller.rb @@ -11,9 +11,9 @@ def word_count # ================================================================================ - @word_count = "Replace this string with your answer." + @word_count = @text.split.count - @character_count_with_spaces = "Replace this string with your answer." + @character_count_with_spaces = @text.length @character_count_without_spaces = "Replace this string with your answer." From fd4e6fdd08153f64deb1cf3937858a047bf3e9d6 Mon Sep 17 00:00:00 2001 From: Belizario Rocha Date: Wed, 5 Jul 2017 23:39:29 +0000 Subject: [PATCH 2/2] Version 1.3, actually --- app/controllers/calculations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/calculations_controller.rb b/app/controllers/calculations_controller.rb index c6cdaa4..b3b1381 100644 --- a/app/controllers/calculations_controller.rb +++ b/app/controllers/calculations_controller.rb @@ -15,7 +15,7 @@ def word_count @character_count_with_spaces = @text.length - @character_count_without_spaces = "Replace this string with your answer." + @character_count_without_spaces = @text.gsub(/\s+/, "").length @occurrences = "Replace this string with your answer."