Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ The browser extension will also highlight the newly covered lines in `foo_bar.rb

1. On your existing `demo-branch` branch, modify `duplication.rb` and `duplication_2.rb` with [these](https://gist.github.com/dblandin/589e70345774298e1622850349c31876#file-duplication-rb) [files](https://gist.github.com/dblandin/589e70345774298e1622850349c31876#file-duplication_2-rb)

2. Commit to `demo-branch`. You should now see duplication issues reported by Code Climate.
2. Commit to `demo-branch`. You should now see duplication issues reported by Code Climate.

25 changes: 24 additions & 1 deletion foo_bar.rb
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
# TODO: Add FooBar content
class FooBar
def run(items = gets.chomp.to_i)
if items > 0
list = []
(1..items).each do |n|
if n % 3 == 0 && n % 5 == 0
list << "FOOBAR"
elsif n % 3 == 0
list << "FOO"
elsif n % 5 == 0
list << "BAR"
else
list << n
end
end
else
puts "Please enter a positive number"
end

list
end
end