Skip to content

Commit

Permalink
Remove destructive string substitutions, bump to 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Woodrich committed Jun 4, 2015
1 parent 07c8d53 commit f4d54a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions lib/lita/handlers/poetry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ def save_last_haiku(one, two, three)
end

def process_sentence(sentence)
sentence.gsub!("'", "")
sentence.gsub!(",","")
sentence.gsub!(".","")
words = sentence.split(' ')
processed_sentence = sentence.gsub("'", "").gsub(",","").gsub(".","")
words = processed_sentence.split(' ')
return words.map{|word| count_syllables(word)}.inject(:+)
end

Expand Down
4 changes: 2 additions & 2 deletions lita-poetry.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = "lita-poetry"
spec.version = "0.2.1"
spec.version = "0.3.0"
spec.authors = ["Chris Woodrich"]
spec.email = ["cwoodrich@gmail.com"]
spec.description = "A Haiku detector for Lita"
Expand All @@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_runtime_dependency "lita", ">= 4.2"
spec.add_runtime_dependency "lita", ">= 4.0"

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
Expand Down

0 comments on commit f4d54a7

Please sign in to comment.