From 15b4cd7d09d4b89a4a9cc7dbc1cb110f5b54a855 Mon Sep 17 00:00:00 2001 From: Budmin Date: Wed, 4 Feb 2026 17:41:31 -0500 Subject: [PATCH 01/12] mentoring notes for Bob on the Ruby track --- tracks/ruby/exercises/bob/mentoring.md | 90 ++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 tracks/ruby/exercises/bob/mentoring.md diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md new file mode 100644 index 000000000..2685d5887 --- /dev/null +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -0,0 +1,90 @@ +# Mentoring + +## Resonable Solutions + +### Using String Methods +```ruby +module Bob + + def self.hey(remark) + remark = remark.strip + question = remark.end_with?('?') + yelling = remark == remark.upcase && remark != remark.downcase + + if remark.empty? + 'Fine. Be that way!' + elsif yelling && question + "Calm down, I know what I'm doing!" + elsif yelling + 'Whoa, chill out!' + elsif question + 'Sure.' + else + 'Whatever.' + end + end + +end +``` + +### Using Regular Expressions +```ruby +module Bob + + SILENCE = /\A\s*\z/.freeze + ASKING = /\?\s*\z/.freeze + SHOUTING = /\A[^A-Za-z]*[A-Z]+(?:[^a-z]*)\z/.freeze + + + def self.hey(input) + case + when silence?(input) + 'Fine. Be that way!' + when asking?(input) && shouting?(input) + "Calm down, I know what I'm doing!" + when asking?(input) + 'Sure.' + when shouting?(input) + 'Whoa, chill out!' + else + 'Whatever.' + end + end + + class << self + protected + def silence?(input) + SILENCE.match?(input) + end + + def shouting?(input) + SHOUTING.match?(input) + end + + def asking?(input) + ASKING.match?(input) + end + end +end +``` + + + +## Common Suggestions + +### Predicate Methods + +The names of predicate methods (methods that return a boolean value) should end in a question mark (i.e. Array#empty?). + +Resources about style: +- https://rubystyle.guide/#bool-methods-qmark +- https://rubystyle.guide/#bool-methods-prefix + +### Using `end_with?` + +* If the student is using indicies to check for a question marks at the end of the input, guide them towards Ruby's `String#end_with?` method. + +### Usage of Regular Expressions + + +Regular expressions are powerful, can be illegible. While regex is common in Ruby code, and if the student is having a hard time understanding regex, it may be better to guide them toward a solution that uses simpler String methods. From df1e507b685517b79efe6e86940b361ad2b522e3 Mon Sep 17 00:00:00 2001 From: Budmin Date: Wed, 4 Feb 2026 22:18:27 -0500 Subject: [PATCH 02/12] Whitespace changes --- tracks/ruby/exercises/bob/mentoring.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index 2685d5887..dc41f91a5 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -3,6 +3,7 @@ ## Resonable Solutions ### Using String Methods + ```ruby module Bob @@ -28,6 +29,7 @@ end ``` ### Using Regular Expressions + ```ruby module Bob @@ -68,8 +70,6 @@ module Bob end ``` - - ## Common Suggestions ### Predicate Methods @@ -86,5 +86,4 @@ Resources about style: ### Usage of Regular Expressions - Regular expressions are powerful, can be illegible. While regex is common in Ruby code, and if the student is having a hard time understanding regex, it may be better to guide them toward a solution that uses simpler String methods. From c0617cc68713a413acf55440a5b22916f6bb205d Mon Sep 17 00:00:00 2001 From: Budmin Date: Wed, 4 Feb 2026 22:19:15 -0500 Subject: [PATCH 03/12] added missing word --- tracks/ruby/exercises/bob/mentoring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index dc41f91a5..a3a50f14d 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -86,4 +86,4 @@ Resources about style: ### Usage of Regular Expressions -Regular expressions are powerful, can be illegible. While regex is common in Ruby code, and if the student is having a hard time understanding regex, it may be better to guide them toward a solution that uses simpler String methods. +Regular expressions are powerful, but can be illegible. While regex is common in Ruby code, and if the student is having a hard time understanding regex, it may be better to guide them toward a solution that uses simpler String methods. From c3c65ca8060796b72dde22f1a60db0656a26ab6b Mon Sep 17 00:00:00 2001 From: Budmin Date: Wed, 4 Feb 2026 22:21:42 -0500 Subject: [PATCH 04/12] minor grammer changes --- tracks/ruby/exercises/bob/mentoring.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index a3a50f14d..833084ffa 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -82,8 +82,8 @@ Resources about style: ### Using `end_with?` -* If the student is using indicies to check for a question marks at the end of the input, guide them towards Ruby's `String#end_with?` method. +* If the student is using indicies to check for a question mark at the end of the input, guide them towards Ruby's `String#end_with?` method. ### Usage of Regular Expressions -Regular expressions are powerful, but can be illegible. While regex is common in Ruby code, and if the student is having a hard time understanding regex, it may be better to guide them toward a solution that uses simpler String methods. +Regular expressions are powerful, but can be illegible. While regex is common in Ruby code, if the student is having a hard time understanding regex it may be better to guide them toward a solution that uses simpler String methods. From 6de7c01e095364e1e599dbe145cc895911af9d9f Mon Sep 17 00:00:00 2001 From: Budmin Date: Wed, 4 Feb 2026 22:48:09 -0500 Subject: [PATCH 05/12] added short problem overview --- tracks/ruby/exercises/bob/mentoring.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index 833084ffa..fe2c15a0b 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -1,5 +1,7 @@ # Mentoring +The key to this exercise is to look for patterns in a string, and extracting the specific criteria in order to make return the correct response. Most solutions look for `yelling` and `asking` criteria + ## Resonable Solutions ### Using String Methods From c9bcd5a72c6402f716e15dce75006c5d0cb7b75f Mon Sep 17 00:00:00 2001 From: Andrew Garvin Date: Thu, 5 Feb 2026 22:32:27 -0500 Subject: [PATCH 06/12] Update tracks/ruby/exercises/bob/mentoring.md Co-authored-by: Isaac Good --- tracks/ruby/exercises/bob/mentoring.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index fe2c15a0b..69f40b86a 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -1,6 +1,7 @@ # Mentoring -The key to this exercise is to look for patterns in a string, and extracting the specific criteria in order to make return the correct response. Most solutions look for `yelling` and `asking` criteria +The key to this exercise is to look for patterns in a string, and extracting the specific criteria in order to make return the correct response. +Most solutions look for `yelling` and `asking` criteria. ## Resonable Solutions From f1c10286b7a98354fd4248f66ed7f6b8e4043487 Mon Sep 17 00:00:00 2001 From: Budmin Date: Thu, 5 Feb 2026 22:38:45 -0500 Subject: [PATCH 07/12] Exercism uses one sentence per line --- tracks/ruby/exercises/bob/mentoring.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index 69f40b86a..b5ca1cb5f 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -89,4 +89,5 @@ Resources about style: ### Usage of Regular Expressions -Regular expressions are powerful, but can be illegible. While regex is common in Ruby code, if the student is having a hard time understanding regex it may be better to guide them toward a solution that uses simpler String methods. +Regular expressions are powerful, but can be illegible. +While regex is common in Ruby code, if the student is having a hard time understanding regex it may be better to guide them toward a solution that uses simpler String methods. From 962654290ec95d85c3e9b164cc840bceca431276 Mon Sep 17 00:00:00 2001 From: Budmin Date: Thu, 5 Feb 2026 22:39:13 -0500 Subject: [PATCH 08/12] removed freeze on regular expressions --- tracks/ruby/exercises/bob/mentoring.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index b5ca1cb5f..32b83535e 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -36,9 +36,9 @@ end ```ruby module Bob - SILENCE = /\A\s*\z/.freeze - ASKING = /\?\s*\z/.freeze - SHOUTING = /\A[^A-Za-z]*[A-Z]+(?:[^a-z]*)\z/.freeze + SILENCE = /\A\s*\z/ + ASKING = /\?\s*\z/ + SHOUTING = /\A[^A-Za-z]*[A-Z]+(?:[^a-z]*)\z/ def self.hey(input) From cf9ec78ccfccff3d696b6e3f5f3b67c76448261f Mon Sep 17 00:00:00 2001 From: Budmin Date: Thu, 5 Feb 2026 23:17:19 -0500 Subject: [PATCH 09/12] Added sentence about prefixing predicate methods --- tracks/ruby/exercises/bob/mentoring.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index 32b83535e..a0e5cdbad 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -79,6 +79,9 @@ end The names of predicate methods (methods that return a boolean value) should end in a question mark (i.e. Array#empty?). +Students should avoid prefixing predicate methods with auxiliary verbs such as `is_yelling` or `has_question` +These words are redundant and inconsistent with the style of boolean methods in the Ruby core library, such as `empty?` and `include?`. + Resources about style: - https://rubystyle.guide/#bool-methods-qmark - https://rubystyle.guide/#bool-methods-prefix From 9df0b2bce793f0a24399447a5dea3ebfd55b85f3 Mon Sep 17 00:00:00 2001 From: Budmin Date: Fri, 6 Feb 2026 00:30:29 -0500 Subject: [PATCH 10/12] Updated `Using end_with?` header --- tracks/ruby/exercises/bob/mentoring.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index a0e5cdbad..dfa9a0062 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -86,9 +86,10 @@ Resources about style: - https://rubystyle.guide/#bool-methods-qmark - https://rubystyle.guide/#bool-methods-prefix -### Using `end_with?` +### Checking for a Question Mark With Indices -* If the student is using indicies to check for a question mark at the end of the input, guide them towards Ruby's `String#end_with?` method. +If the student is using indices or extra transforms to check for a question mark (e.g., `remark[-1] == '?'`, `remark.chars.last == '?'`, etc.), guide them toward `String#end_with?`. +It is more readable and explicitly communicates the intent of the check. ### Usage of Regular Expressions From 3a1a141cbbbe65a828c517a381fee307b457b39d Mon Sep 17 00:00:00 2001 From: Andrew Garvin Date: Fri, 6 Feb 2026 08:28:06 -0500 Subject: [PATCH 11/12] Update mentoring.md Co-authored-by: Victor Goff --- tracks/ruby/exercises/bob/mentoring.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index dfa9a0062..5e64471e8 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -39,8 +39,6 @@ module Bob SILENCE = /\A\s*\z/ ASKING = /\?\s*\z/ SHOUTING = /\A[^A-Za-z]*[A-Z]+(?:[^a-z]*)\z/ - - def self.hey(input) case when silence?(input) From 5dbf8dccabf37986c67a62e932e9a094cdb4d59e Mon Sep 17 00:00:00 2001 From: Andrew Garvin Date: Fri, 6 Feb 2026 08:28:15 -0500 Subject: [PATCH 12/12] Update mentoring.md Co-authored-by: Victor Goff --- tracks/ruby/exercises/bob/mentoring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracks/ruby/exercises/bob/mentoring.md b/tracks/ruby/exercises/bob/mentoring.md index 5e64471e8..18b56e369 100644 --- a/tracks/ruby/exercises/bob/mentoring.md +++ b/tracks/ruby/exercises/bob/mentoring.md @@ -75,7 +75,7 @@ end ### Predicate Methods -The names of predicate methods (methods that return a boolean value) should end in a question mark (i.e. Array#empty?). +The names of predicate methods (methods that return a boolean value) should end in a question mark (i.e. `Array#empty?`). Students should avoid prefixing predicate methods with auxiliary verbs such as `is_yelling` or `has_question` These words are redundant and inconsistent with the style of boolean methods in the Ruby core library, such as `empty?` and `include?`.