From 86e2caa6b8d0ae86f2288684b6d49050663741d9 Mon Sep 17 00:00:00 2001 From: Jake Date: Sun, 19 Mar 2017 23:21:21 -0400 Subject: [PATCH] Challenge completed. All test pass. Signed-off-by: Jake --- Gemfile.lock | 34 +++++++++++++++++++--------------- parser.rb | 9 ++++++++- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e283e8f..b372e86 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,30 +1,34 @@ GEM remote: http://rubygems.org/ specs: - coderay (1.1.0) - diff-lcs (1.2.5) + coderay (1.1.1) + diff-lcs (1.3) method_source (0.8.2) - pry (0.10.1) + pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - rspec (3.1.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-core (3.1.4) - rspec-support (~> 3.1.0) - rspec-expectations (3.1.2) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.1.0) - rspec-mocks (3.1.2) - rspec-support (~> 3.1.0) - rspec-support (3.1.1) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) slop (3.6.0) PLATFORMS - ruby + x86-mingw32 DEPENDENCIES pry rspec + +BUNDLED WITH + 1.14.3 diff --git a/parser.rb b/parser.rb index adaad3e..97ca317 100644 --- a/parser.rb +++ b/parser.rb @@ -1,3 +1,10 @@ def word_in_string?(word, string) - # implement with your code here + string = string.gsub('_',' ') + string = string.gsub('-', ' ') + string = string.split.to_a + if string.include? word + :yes + else + :no + end end