From 0a20b77bf90a1d6bd498eff516f5ece2b67a2779 Mon Sep 17 00:00:00 2001 From: Leon Davis Date: Tue, 8 Aug 2017 13:02:07 +0100 Subject: [PATCH 01/14] Create setup.sh --- setup.sh | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..f8972be --- /dev/null +++ b/setup.sh @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + +#!/bin/bash + +PROFILELINE='[[ -s "$HOME/.rvm/scripts/rvm" ]] && source +"$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a +function*' +PROFILEFILE=~/.profile +BASHRCLINE="source $PROFILEFILE" +BASHRCFILE=~/.bashrc +RUBYVERSION=2.3 + +checkerror () { +        RC=$? +        if [ $RC -ne 0 ]; then +                echo +"ERROR: $*" +        fi +} + +echo "Installing gpg key" +gpg --keyserver hkp://keys.gnupg.net --recv-keys +409B6B1796C275462A1703113804BB82D39DC0E3 +7D2BAF1CF37B13E2069D6956105BD0E739499BDB +checkerror "Unable to install GPG key required to install RVM" + +\curl -sSL https://get.rvm.io | +bash -s stable --ruby +checkerror "Unable io install RVM" + +source $PROFILEFILE +checkerror "Unable to source profile file" + +echo "Installing Ruby - enter corporate password when prompted" +rvm install ruby-$RUBYVERSION +checkerror "Unable to install Ruby version $RUBYVERSION" + +grep -qF "$PROFILELINE" "$PROFILEFILE" || echo +"$PROFILELINE" >> "$PROFILEFILE" +checkerror "Unable to add $PROFILELINE to $PROFILEFILE" + +source $PROFILEFILE +checkerror "Unable to source profile file" + +if [[ -f $BASHRCFILE ]]; then +    grep -qF "$BASHRCLINE" +"$BASHRCFILE" || echo "$BASHRCLINE" >> +"$BASHRCFILE" +    checkerror "Unable to add $BASHRCLINE to $BASHRCFILE" +else +    echo "Unable to locate the bashrc file +$BASHRCFILE" +    exit 1 +fi + + +source $PROFILEFILE +checkerror "Unable to source profile file" + +rvm --default use $RUBYVERSION +checkerror "Unable to set the default version of ruby within RVM to +$RUBYVERSION" + + + + + + From 4fc20a6e9141be3f9b2e854ec6fc615780e210eb Mon Sep 17 00:00:00 2001 From: leon Date: Tue, 8 Aug 2017 13:23:58 +0100 Subject: [PATCH 02/14] initial commit --- setup.sh | 86 +++++++++----------------------------------------------- 1 file changed, 13 insertions(+), 73 deletions(-) diff --git a/setup.sh b/setup.sh index f8972be..d798774 100644 --- a/setup.sh +++ b/setup.sh @@ -1,72 +1,23 @@ - - - - - - - - - - - - - - - #!/bin/bash -PROFILELINE='[[ -s "$HOME/.rvm/scripts/rvm" ]] && source -"$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a -function*' +PROFILELINE='[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' PROFILEFILE=~/.profile BASHRCLINE="source $PROFILEFILE" BASHRCFILE=~/.bashrc RUBYVERSION=2.3 checkerror () { -        RC=$? -        if [ $RC -ne 0 ]; then -                echo -"ERROR: $*" -        fi + RC=$? + if [ $RC -ne 0 ]; then + echo "ERROR: $*" + fi } echo "Installing gpg key" -gpg --keyserver hkp://keys.gnupg.net --recv-keys -409B6B1796C275462A1703113804BB82D39DC0E3 -7D2BAF1CF37B13E2069D6956105BD0E739499BDB +gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB checkerror "Unable to install GPG key required to install RVM" -\curl -sSL https://get.rvm.io | -bash -s stable --ruby +\curl -sSL https://get.rvm.io | bash -s stable --ruby checkerror "Unable io install RVM" source $PROFILEFILE @@ -76,22 +27,18 @@ echo "Installing Ruby - enter corporate password when prompted" rvm install ruby-$RUBYVERSION checkerror "Unable to install Ruby version $RUBYVERSION" -grep -qF "$PROFILELINE" "$PROFILEFILE" || echo -"$PROFILELINE" >> "$PROFILEFILE" +grep -qF "$PROFILELINE" "$PROFILEFILE" || echo "$PROFILELINE" >> "$PROFILEFILE" checkerror "Unable to add $PROFILELINE to $PROFILEFILE" source $PROFILEFILE checkerror "Unable to source profile file" if [[ -f $BASHRCFILE ]]; then -    grep -qF "$BASHRCLINE" -"$BASHRCFILE" || echo "$BASHRCLINE" >> -"$BASHRCFILE" -    checkerror "Unable to add $BASHRCLINE to $BASHRCFILE" + grep -qF "$BASHRCLINE" "$BASHRCFILE" || echo "$BASHRCLINE" >> "$BASHRCFILE" + checkerror "Unable to add $BASHRCLINE to $BASHRCFILE" else -    echo "Unable to locate the bashrc file -$BASHRCFILE" -    exit 1 + echo "Unable to locate the bashrc file $BASHRCFILE" + exit 1 fi @@ -99,11 +46,4 @@ source $PROFILEFILE checkerror "Unable to source profile file" rvm --default use $RUBYVERSION -checkerror "Unable to set the default version of ruby within RVM to -$RUBYVERSION" - - - - - - +checkerror "Unable to set the default version of ruby within RVM to $RUBYVERSION" From a7b052d884a5e80c6d179f047c6ffe086e8569d6 Mon Sep 17 00:00:00 2001 From: Leon Davis Date: Tue, 8 Aug 2017 14:05:50 +0100 Subject: [PATCH 03/14] Update setup.sh --- setup.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index d798774..240cf9b 100644 --- a/setup.sh +++ b/setup.sh @@ -1,6 +1,8 @@ #!/bin/bash -PROFILELINE='[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' +PROFILELINE='export PATH=$PATH:/$HOME/.rvm/bin && [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' + + PROFILEFILE=~/.profile BASHRCLINE="source $PROFILEFILE" BASHRCFILE=~/.bashrc @@ -17,7 +19,7 @@ echo "Installing gpg key" gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB checkerror "Unable to install GPG key required to install RVM" -\curl -sSL https://get.rvm.io | bash -s stable --ruby +\curl -sSL https://raw.githubusercontent.com/wayneeseguin/rvm/stable/binscripts/rvm-installer | bash -s stable checkerror "Unable io install RVM" source $PROFILEFILE @@ -27,6 +29,7 @@ echo "Installing Ruby - enter corporate password when prompted" rvm install ruby-$RUBYVERSION checkerror "Unable to install Ruby version $RUBYVERSION" + grep -qF "$PROFILELINE" "$PROFILEFILE" || echo "$PROFILELINE" >> "$PROFILEFILE" checkerror "Unable to add $PROFILELINE to $PROFILEFILE" From 879e3eaf80537704219ca97b9ce64e5d3457e8cf Mon Sep 17 00:00:00 2001 From: Leon Davis Date: Tue, 8 Aug 2017 14:13:30 +0100 Subject: [PATCH 04/14] Update environment.md --- environment.md | 51 ++++++++------------------------------------------ 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/environment.md b/environment.md index 5e5e54e..5aa00dd 100644 --- a/environment.md +++ b/environment.md @@ -8,52 +8,17 @@ In order to set yourself up for this course properly you are going to need a mac ## Setup your environment -You are going to need administrator access to your laptop to install the software that we are going to use. With the help of the group facilitator you can make the request. - -After you have got administrator rights you are going to need to do a few bits and pieces: - -* Register a Google Apps account to use Hangouts with -* Install Slack and get an invite to the Sky or Sky Training team from your facilitator (we use this for most communication) -* Install Google Chrome from the web (not Sky's self serve app store) -* Install the Google Hangouts Chrome extension (we'll use this for video calling in the event we're working remotely) -* Register for a Floobits account (Floobits is a really great service that will allow us to write code together) -* Register a Github account (if you don't already have one) -* Get access to Safari Books Online -* Get access to Pluralsight -* Get access to codeschool - - -## Install Ruby - -To install Ruby we're going to use a tool called [`rbenv`](https://github.com/sstephenson/rbenv). To install this tool you can use [Homebrew](http://brew.sh/). - -For more information about installing this tool, [consult the readme](https://github.com/sstephenson/rbenv#homebrew-on-mac-os-x). - -The short version of this is: - -``` -# Install Homebrew - -ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +ALl exercises should be done on your linux VDI. If you have don't have access to this contact someone who can help you. -# Install rbenv - -brew update -brew install rbenv ruby-build - -# Install a Ruby version - -rbenv install 2.2.3 -``` +You will need the following bits and pieces: +* Access to Safari Books Online +* Access to Pluralsight +* Get access to codeschool ## Checkout the bootcamp materials -The [ruby-bootcamp](https://github.com/sky-uk/ruby-bootcamp) repository is the starting point for the bootcamp. You'll want to [fork the repository](https://github.com/sky-uk/ruby-bootcamp) and clone it locally. Start by reading the [readme](https://github.com/sky-uk/ruby-bootcamp/blob/master/readme.md). +The [ruby-bootcamp](https://github.com/lvl-up/ruby-bootcamp-fil) repository is the starting point for the bootcamp. You'll want to [fork the repository](https://github.com/lvl-up/ruby-bootcamp-fil) and clone it locally. Start by reading the [readme](https://github.com/lvl-up/ruby-bootcamp-fil/blob/master/readme.md). - -## Setup Floobits - -Floobits has a few features that require you to be authenticated against your account. Login in to Floobits and follow the instructions in under your settings area to create a .floorc.json in the home area of you VM. - -This step is optional as you may not require Floobits to pair with your facilitator (as they might be in the same room). +## Install Ruby +From the terminal, cd in to where you have checked out the bootcamp repo and run `.setup.sh` From 8e373b702059913d789e9af83177c49d2ba972a1 Mon Sep 17 00:00:00 2001 From: Leon Davis Date: Tue, 8 Aug 2017 14:30:12 +0100 Subject: [PATCH 05/14] Update environment.md --- environment.md | 1 - 1 file changed, 1 deletion(-) diff --git a/environment.md b/environment.md index 5aa00dd..39284ad 100644 --- a/environment.md +++ b/environment.md @@ -14,7 +14,6 @@ You will need the following bits and pieces: * Access to Safari Books Online * Access to Pluralsight -* Get access to codeschool ## Checkout the bootcamp materials From a7323a09c3f2c816d591f1acb08367d7ce5d455e Mon Sep 17 00:00:00 2001 From: Leon Davis Date: Wed, 9 Aug 2017 09:39:34 +0100 Subject: [PATCH 06/14] Update environment.md --- environment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.md b/environment.md index 39284ad..4e8fa0c 100644 --- a/environment.md +++ b/environment.md @@ -17,7 +17,7 @@ You will need the following bits and pieces: ## Checkout the bootcamp materials -The [ruby-bootcamp](https://github.com/lvl-up/ruby-bootcamp-fil) repository is the starting point for the bootcamp. You'll want to [fork the repository](https://github.com/lvl-up/ruby-bootcamp-fil) and clone it locally. Start by reading the [readme](https://github.com/lvl-up/ruby-bootcamp-fil/blob/master/readme.md). +The [ruby-bootcamp](https://github.com/lvl-up/ruby-bootcamp-fil) repository is the starting point for the bootcamp. You'll want to clone it locally. Start by reading the [readme](https://github.com/lvl-up/ruby-bootcamp-fil/blob/master/readme.md). ## Install Ruby -From the terminal, cd in to where you have checked out the bootcamp repo and run `.setup.sh` +From the terminal, cd in to where you have checked out the bootcamp repo and run `./setup.sh` From ef166d00b5755e6d250e575d69cabe6579fdc206 Mon Sep 17 00:00:00 2001 From: leon Date: Wed, 9 Aug 2017 10:17:54 +0100 Subject: [PATCH 07/14] make executable --- setup.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 setup.sh diff --git a/setup.sh b/setup.sh old mode 100644 new mode 100755 From f67d457ef0f27bffde9b6c98437861d00728ceea Mon Sep 17 00:00:00 2001 From: Leon Davis Date: Wed, 9 Aug 2017 10:22:31 +0100 Subject: [PATCH 08/14] Update readme.md --- exercises/run-ruby/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/run-ruby/readme.md b/exercises/run-ruby/readme.md index 40145ae..fe7996f 100644 --- a/exercises/run-ruby/readme.md +++ b/exercises/run-ruby/readme.md @@ -32,4 +32,4 @@ Use `irb` to run some of the statements in [runme.rb](runme.rb): * What sort of object do you get when you run `Time.now`. (Use the `.class` method to find out) * What other methods does that returned object have on it? (use the `.public_methods` method to find out, e.g. `Time.now.public_methods`) -* Use the Time RDoc to find out what extras you get +* Use the [Time RDoc](https://ruby-doc.org/stdlib-2.3.1/libdoc/time/rdoc/Time.html) to find out what extras you get From 1a33e1282492116f66c37ac37ef8b4ac7545e669 Mon Sep 17 00:00:00 2001 From: leon Date: Mon, 9 Oct 2017 12:01:44 +0100 Subject: [PATCH 09/14] Adding a prototype exercise for exceptions --- exercises/exceptions/lib/cat.rb | 40 ++++++++++++++++++++++++ exercises/exceptions/lib/trick.rb | 15 +++++++++ exercises/exceptions/readme.md | 52 +++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 exercises/exceptions/lib/cat.rb create mode 100644 exercises/exceptions/lib/trick.rb create mode 100644 exercises/exceptions/readme.md diff --git a/exercises/exceptions/lib/cat.rb b/exercises/exceptions/lib/cat.rb new file mode 100644 index 0000000..2ae6f1f --- /dev/null +++ b/exercises/exceptions/lib/cat.rb @@ -0,0 +1,40 @@ +require_relative 'trick' + +class Cat + attr_reader :tricks + + # This constructor take named parameters, If you've not seen them before then + # have a read. They can be pretty useful and in the write cricumstances can + # make your code more readable + def initialize(age:, name:) + @name = name + @age = age + @tricks = {divide: Trick::DIVISION} + end + + + def age_in_human_years + if @age > 2 + 25 + calculate_remaining_years(@age - 2) + else + calculate_remaining_years(@age) + end + end + + def do_trick(name, *args) + tricks[name].call(*args) + end + + def print_age_in_human_years + puts "I'm #{age_in_human_years} human years old" + end + + private + def calculate_remaining_years age + age * 4 + end +end + +kitty = Cat.new(age: 35, name: 'billy') +kitty.print_age_in_human_years +puts kitty.do_trick(:divide, 5,0) \ No newline at end of file diff --git a/exercises/exceptions/lib/trick.rb b/exercises/exceptions/lib/trick.rb new file mode 100644 index 0000000..71acc43 --- /dev/null +++ b/exercises/exceptions/lib/trick.rb @@ -0,0 +1,15 @@ +class Trick + attr_reader :trick + def initialize(&block) + @trick = block + end + + def call(*args) + trick.call(*args) + end + + DIVISION = Trick.new do |arg1, arg2| + arg1/arg2 + end +end + diff --git a/exercises/exceptions/readme.md b/exercises/exceptions/readme.md new file mode 100644 index 0000000..d9207fd --- /dev/null +++ b/exercises/exceptions/readme.md @@ -0,0 +1,52 @@ +# Exceptions + + +## Introduction + +In this exercise you are going to write some exception handling code. + +## Exercise + +**_Note:_** You'll notice that there arn't any tests right now... Write them in order to add the new functionality required in the exercises that follow + +### Raise an exception +in [lib/cat.rb]('cat.rb') you'll find the `Cat` class. The constructor on this class requires you to set the age and name of the cat. However, this constructor could be more helpful than it is right now. Currently `Cat#initialize` will allow you to pass an age the is less than 0. This doesn't make much sense when thinking about cats and what's worse the `Cat#print_age_in_human_years` method just doesn't make sense when a negative age is used. + +```RUBY +kitty = Cat.new(age: -1, name: 'billy') +kitty.print_age_in_human_years #=> "I'm -4 human years old" +``` + +### 1. Raise a specific Exception +Raising specific exceptions gives the user of your api the chance to make a choice about how they handle it. + +Modify the code in the constructor to raise an ArguementError and a helpful message if the age specified is less than 0. + +```RUBY +kitty = Cat.new(age: -1, name: 'billy') #=> ArgumentError" +``` + +### 2. Raise a Custom Error +Having custom exception types can be exceptionally useful (excuse the pun). + +Define the method `Cat#learn_new_trick` that provides the signature utilised in the example below. If the cat is older than 100 in human years, throw a custom exception `ToBusySleepingError` + +```RUBY +billy = Cat.new(name: 'billy', age: 2) +billy.learn_new_trick(:answer_the_phone) do |args| + #code that performs the trick +end + +billy.tricks #=> [:answer_the_phone] + +bob = Cat.new(name: 'bob', age: 35) +bob.learn_new_trick(:answer_the_phone) #> Raises ToBusySleeingError +``` + +# Catch an Error +The cats built using the`Cat` are pretty clever. They know how to divide numbers! Problem is they don't know what to do when the second of those numbers is 0... Enhance the code for the skill to catch the divide by 0 error when if it happens and return nil instead. + +```RUBY +billy = Cat.new(name: 'billy', age: 2) +billy.do_trick(:divide, 5,0) # => should return 0 +``` \ No newline at end of file From 2a928f92c11359ea27f0abb4a45126a201db46a7 Mon Sep 17 00:00:00 2001 From: leon Date: Mon, 9 Oct 2017 12:33:09 +0100 Subject: [PATCH 10/14] Fix typo --- exercises/exceptions/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/exceptions/readme.md b/exercises/exceptions/readme.md index d9207fd..d36f3db 100644 --- a/exercises/exceptions/readme.md +++ b/exercises/exceptions/readme.md @@ -40,7 +40,7 @@ end billy.tricks #=> [:answer_the_phone] bob = Cat.new(name: 'bob', age: 35) -bob.learn_new_trick(:answer_the_phone) #> Raises ToBusySleeingError +bob.learn_new_trick(:answer_the_phone) #> Raises ToBusySleepingError ``` # Catch an Error From 0e9af5a29144f46ab14d47fb4ea7b3d7a5f9bba0 Mon Sep 17 00:00:00 2001 From: leon Date: Mon, 9 Oct 2017 12:34:24 +0100 Subject: [PATCH 11/14] fix formatting --- exercises/exceptions/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/exceptions/readme.md b/exercises/exceptions/readme.md index d36f3db..2436e48 100644 --- a/exercises/exceptions/readme.md +++ b/exercises/exceptions/readme.md @@ -43,7 +43,7 @@ bob = Cat.new(name: 'bob', age: 35) bob.learn_new_trick(:answer_the_phone) #> Raises ToBusySleepingError ``` -# Catch an Error +### 3. Catch an Error The cats built using the`Cat` are pretty clever. They know how to divide numbers! Problem is they don't know what to do when the second of those numbers is 0... Enhance the code for the skill to catch the divide by 0 error when if it happens and return nil instead. ```RUBY From 935d0d31764a32c60c100e7c8423d25b3a5ffd09 Mon Sep 17 00:00:00 2001 From: leon Date: Mon, 9 Oct 2017 12:35:38 +0100 Subject: [PATCH 12/14] Update exercise numbers --- exercises/exceptions/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/exceptions/readme.md b/exercises/exceptions/readme.md index 2436e48..fca73f7 100644 --- a/exercises/exceptions/readme.md +++ b/exercises/exceptions/readme.md @@ -9,7 +9,7 @@ In this exercise you are going to write some exception handling code. **_Note:_** You'll notice that there arn't any tests right now... Write them in order to add the new functionality required in the exercises that follow -### Raise an exception +### 1. Raise an exception in [lib/cat.rb]('cat.rb') you'll find the `Cat` class. The constructor on this class requires you to set the age and name of the cat. However, this constructor could be more helpful than it is right now. Currently `Cat#initialize` will allow you to pass an age the is less than 0. This doesn't make much sense when thinking about cats and what's worse the `Cat#print_age_in_human_years` method just doesn't make sense when a negative age is used. ```RUBY @@ -17,7 +17,7 @@ kitty = Cat.new(age: -1, name: 'billy') kitty.print_age_in_human_years #=> "I'm -4 human years old" ``` -### 1. Raise a specific Exception +### 2. Raise a specific Exception Raising specific exceptions gives the user of your api the chance to make a choice about how they handle it. Modify the code in the constructor to raise an ArguementError and a helpful message if the age specified is less than 0. @@ -26,7 +26,7 @@ Modify the code in the constructor to raise an ArguementError and a helpful mess kitty = Cat.new(age: -1, name: 'billy') #=> ArgumentError" ``` -### 2. Raise a Custom Error +### 3. Raise a Custom Error Having custom exception types can be exceptionally useful (excuse the pun). Define the method `Cat#learn_new_trick` that provides the signature utilised in the example below. If the cat is older than 100 in human years, throw a custom exception `ToBusySleepingError` @@ -43,7 +43,7 @@ bob = Cat.new(name: 'bob', age: 35) bob.learn_new_trick(:answer_the_phone) #> Raises ToBusySleepingError ``` -### 3. Catch an Error +### 4. Catch an Error The cats built using the`Cat` are pretty clever. They know how to divide numbers! Problem is they don't know what to do when the second of those numbers is 0... Enhance the code for the skill to catch the divide by 0 error when if it happens and return nil instead. ```RUBY From c976148132c7f80cae179f77352bd68873f18779 Mon Sep 17 00:00:00 2001 From: Leon Davis Date: Wed, 11 Oct 2017 10:25:42 +0100 Subject: [PATCH 13/14] Update cat.rb --- exercises/exceptions/lib/cat.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/exceptions/lib/cat.rb b/exercises/exceptions/lib/cat.rb index 2ae6f1f..7247748 100644 --- a/exercises/exceptions/lib/cat.rb +++ b/exercises/exceptions/lib/cat.rb @@ -3,8 +3,8 @@ class Cat attr_reader :tricks - # This constructor take named parameters, If you've not seen them before then - # have a read. They can be pretty useful and in the write cricumstances can + # This constructor takes named parameters, If you've not seen them before then + # have a read. They can be pretty useful and in the right circumstances can # make your code more readable def initialize(age:, name:) @name = name @@ -37,4 +37,4 @@ def calculate_remaining_years age kitty = Cat.new(age: 35, name: 'billy') kitty.print_age_in_human_years -puts kitty.do_trick(:divide, 5,0) \ No newline at end of file +puts kitty.do_trick(:divide, 5,0) From 00569e6b05a8b4c4b8a8f869807ba8f84827edad Mon Sep 17 00:00:00 2001 From: Leon Davis Date: Wed, 11 Oct 2017 10:26:15 +0100 Subject: [PATCH 14/14] Update cat.rb --- exercises/exceptions/lib/cat.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/exercises/exceptions/lib/cat.rb b/exercises/exceptions/lib/cat.rb index 7247748..64491f9 100644 --- a/exercises/exceptions/lib/cat.rb +++ b/exercises/exceptions/lib/cat.rb @@ -34,7 +34,3 @@ def calculate_remaining_years age age * 4 end end - -kitty = Cat.new(age: 35, name: 'billy') -kitty.print_age_in_human_years -puts kitty.do_trick(:divide, 5,0)