Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

trying again #130

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
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
Binary file not shown.
13 changes: 13 additions & 0 deletions catfriend_test_gem/catfriend_test_gem.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Gem::Specification.new do |s|
s.name = 'catfriend_test_gem'
s.version = '0.0.0'
s.date = '2013-11-25'
s. summary = "test_gem is just so testy"
s.description = "A very testy test_gem"
s.authors = ["catfriend"]
s.email = "[email protected]"
s.files = [
"lib/catfriend_test_gem.rb"
]
s.require_paths = ["lib"]
end
7 changes: 7 additions & 0 deletions catfriend_test_gem/lib/catfriend_test_gem.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module TestGem
class Test
def self.testy?
puts "Test Gem is sooooo testy"
end
end
end
Binary file added catfriend_test_gem/test_gem-0.0.0.gem
Binary file not shown.
6 changes: 3 additions & 3 deletions midterm/instructions_and_questions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ Instructions for Mid-Term submission and Git Review (10pts):
- After 6pm Tuesday November 19th you will not be able to push to your remote repository (or clone).

Questions (20pts):
- What are the three uses of the curly brackets {} in Ruby?
- What are the three uses of the curly brackets {} in Ruby? blocks, hashes, lambdas
- What is a regular expression and what is a common use for them?
- What is the difference between how a String, a symbol, a FixNum, and a Float are stored in Ruby?
- What is the difference between how a String, a symbol, a FixNum, and a Float are stored in Ruby? Strings are stored using the string object.
- Are these two statements equivalent? Why or Why Not?
1. x, y = "hello", "hello"
2. x = y = "hello"
- What is the difference between a Range and an Array?
- Why would I use a Hash instead of an Array?
- What is your favorite thing about Ruby so far?
- What is your least favorite thing about Ruby so far?
- What is your least favorite thing about Ruby so far? rspec with git a very close second

Programming Problems (10pts each):
- Write a passing rspec file called even_number_spec.rb that tests a class called EvenNumber.
Expand Down
Empty file added midterm/turkey.rb
Empty file.
1 change: 1 addition & 0 deletions thetorturefiles
Submodule thetorturefiles added at 6294eb
19 changes: 19 additions & 0 deletions week1/exercises/book.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class Book

attr_accessor :title
attr_reader :page_count

@@book_count = 0

def self.library_count
@@book_count
end

def initialize title = "Not Set", page_count = 0
@@book_count += 1
@page_count = page_count
@title = title

end

end
Empty file added week1/exercises/book_spec.rb
Empty file.
6 changes: 3 additions & 3 deletions week1/exercises/rspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@
# Fix the Failing Test
# Order of Operations is Please Excuse My Dear Aunt Sally:
# Parentheses, Exponents, Multiplication, Division, Addition, Subtraction
(1+2-5*6/2).should eq -13
(1+2-5*6/2).should eq -12
end
it "should count the characters in your name" do
pending
"cheri" should have (5).characters
end

it "should check basic math"

(1+3).should eq 4
it "should check basic spelling"

end
Expand Down
151 changes: 151 additions & 0 deletions week1/exercises/rspec_spec.sublime-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"auto_complete":
{
"selected_items":
[
]
},
"buffers":
[
],
"build_system": "",
"command_palette":
{
"height": 0.0,
"selected_items":
[
],
"width": 0.0
},
"console":
{
"height": 0.0,
"history":
[
]
},
"distraction_free":
{
"menu_visible": true,
"show_minimap": false,
"show_open_files": false,
"show_tabs": false,
"side_bar_visible": false,
"status_bar_visible": false
},
"file_history":
[
"/Users/elizabethakari/UWRuby/RubyFall2013/week1/exercises/rspec_spec.rb"
],
"find":
{
"height": 0.0
},
"find_in_files":
{
"height": 0.0,
"where_history":
[
]
},
"find_state":
{
"case_sensitive": false,
"find_history":
[
],
"highlight": true,
"in_selection": false,
"preserve_case": false,
"regex": false,
"replace_history":
[
],
"reverse": false,
"show_context": true,
"use_buffer2": true,
"whole_word": false,
"wrap": true
},
"groups":
[
{
"sheets":
[
]
}
],
"incremental_find":
{
"height": 23.0
},
"input":
{
"height": 0.0
},
"layout":
{
"cells":
[
[
0,
0,
1,
1
]
],
"cols":
[
0.0,
1.0
],
"rows":
[
0.0,
1.0
]
},
"menu_visible": true,
"project": "rspec_spec.sublime-project",
"replace":
{
"height": 0.0
},
"save_all_on_build": true,
"select_file":
{
"height": 0.0,
"selected_items":
[
],
"width": 0.0
},
"select_project":
{
"height": 0.0,
"selected_items":
[
],
"width": 0.0
},
"select_symbol":
{
"height": 0.0,
"selected_items":
[
],
"width": 0.0
},
"settings":
{
},
"show_minimap": true,
"show_open_files": false,
"show_tabs": true,
"side_bar_visible": true,
"side_bar_width": 150.0,
"status_bar_visible": true,
"template_settings":
{
}
}
20 changes: 20 additions & 0 deletions week1/homework/#*merge*#30459TA8#
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Please read:
Chapter 3 Classes, Objects, and Variables
p.86-90 Strings (Strings section in Chapter 6 Standard Types)

1. What is an object? Everything in Ruby is an object. Specifically in Ruby it is synonymous with class instance.

2. What is a variable? A variable is something that holds data. They hold a reference to an object.

3. What is the difference between an object and a class? The class is the category. The object is the class instance.
Every object is generated from a class.

4. What is a String? Any text surrounded by single or double quotes, or, to put another way, sequences of characters
between delimiters.

5. What are three messages that I can send to a string object? Hint: think methods Are you just looking for string
methods? .index, .reverse, .upcase, .downcase, .swapcase, .split and many more.

6. What are two ways of defining a String literal? Bonus: What is the difference between the two? Text between single quotes
and text between double quotes. Uh, the quotes. Ruby does more work with the double quotes, such as looking for things that
start with a \, and expression interpolation.
17 changes: 11 additions & 6 deletions week1/homework/questions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@ Please read:
Chapter 3 Classes, Objects, and Variables
p.86-90 Strings (Strings section in Chapter 6 Standard Types)

1. What is an object?
1. What is an object? Everything in Ruby is an object. Specifically in Ruby it is synonymous with class instance.

2. What is a variable?
2. What is a variable? A variable is something that holds data. They hold a reference to an object.

3. What is the difference between an object and a class?
3. What is the difference between an object and a class? The class is the category. The object is the class instance.
Every object is generated from a class.

4. What is a String?
4. What is a String? Any text surrounded by single or double quotes, or, to put another way, sequences of characters
between delimiters.

5. What are three messages that I can send to a string object? Hint: think methods
5. What are three messages that I can send to a string object? Hint: think methods Are you just looking for string
methods? .index, .reverse, .upcase, .downcase, .swapcase, .split and many more.

6. What are two ways of defining a String literal? Bonus: What is the difference between the two?
6. What are two ways of defining a String literal? Bonus: What is the difference between the two? Text between single quotes
and text between double quotes. Uh, the quotes. Ruby does more work with the double quotes, such as looking for things that
start with a \, and expression interpolation.
42 changes: 42 additions & 0 deletions week1/homework/questions.txt.BACKUP.30389.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Please read:
Chapter 3 Classes, Objects, and Variables
p.86-90 Strings (Strings section in Chapter 6 Standard Types)

<<<<<<< HEAD
1. What is an object? Everything in Ruby is an object. Specifically in Ruby it is synonymous with class instance.

2. What is a variable? A variable is something that holds data. They hold a reference to an object.

3. What is the difference between an object and a class? The class is the category. The object is the class instance.
Every object is generated from a class.

4. What is a String? Any text surrounded by single or double quotes, or, to put another way, sequences of characters
between delimiters.

5. What are three messages that I can send to a string object? Hint: think methods Are you just looking for string
methods? .index, .reverse, .upcase, .downcase, .swapcase, .split and many more.

6. What are two ways of defining a String literal? Bonus: What is the difference between the two? Text between single quotes
and text between double quotes. Uh, the quotes. Ruby does more work with the double quotes, such as looking for things that
start with a \, and expression interpolation.
=======
1. What is an object?
An object is a representation in memory of a specific concept or thing that the Ruby interpreter knows about.

2. What is a variable?
A variable is a name for a location in memory. It can contain, or point to, any type of object.

3. What is the difference between an object and a class?
An object is an instance of a class, or a specific thing of that class's type in memory. The class is the specifics that are common to all things of that type. The classification of a concept or a thing is a class. A specific thing or concept of a class's type in memory is an object. For example: All books have titles (Class). This book's title is "Harry Potter and the Goblet of Fire" (Object).

4. What is a String?
A string is how Ruby understands text. It is a collection of characters (Bytes), and can be created by making an instance of the String class (String.new) or as a string literal ("",'', %Q[]).

5. What are three messages that I can send to a string object? Hint: think methods
chomp! - removes newline characters, or the specified characters, from the end of a string
strip! - removes leading or trailing whitespace from a string
split - returns an array of strings made up of the original string separated on whitespace or the specified characters or regexp

6. What are two ways of defining a String literal? Bonus: What is the difference between the two?
Single quotes ex: '' and Double quotes ex: "". The single quotes allow for 2 escape characters: \' and \\ . The double quoted string literal allows for many different escaped special characters (like \n is a line break) and allows for string interpolation, or the injection of evaluated Ruby code into the string ex: "Hello #{my_name}". The single quoted string takes up much less memory than a double quoted string with interpolation. Without interpolation, both are about the same.
>>>>>>> 02ccc7d94fdfc30a6d2d7e93c8bee3f07a3da618
15 changes: 15 additions & 0 deletions week1/homework/questions.txt.BASE.30389.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Please read:
Chapter 3 Classes, Objects, and Variables
p.86-90 Strings (Strings section in Chapter 6 Standard Types)

1. What is an object?

2. What is a variable?

3. What is the difference between an object and a class?

4. What is a String?

5. What are three messages that I can send to a string object? Hint: think methods

6. What are two ways of defining a String literal? Bonus: What is the difference between the two?
20 changes: 20 additions & 0 deletions week1/homework/questions.txt.LOCAL.30389.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Please read:
Chapter 3 Classes, Objects, and Variables
p.86-90 Strings (Strings section in Chapter 6 Standard Types)

1. What is an object? Everything in Ruby is an object. Specifically in Ruby it is synonymous with class instance.

2. What is a variable? A variable is something that holds data. They hold a reference to an object.

3. What is the difference between an object and a class? The class is the category. The object is the class instance.
Every object is generated from a class.

4. What is a String? Any text surrounded by single or double quotes, or, to put another way, sequences of characters
between delimiters.

5. What are three messages that I can send to a string object? Hint: think methods Are you just looking for string
methods? .index, .reverse, .upcase, .downcase, .swapcase, .split and many more.

6. What are two ways of defining a String literal? Bonus: What is the difference between the two? Text between single quotes
and text between double quotes. Uh, the quotes. Ruby does more work with the double quotes, such as looking for things that
start with a \, and expression interpolation.
23 changes: 23 additions & 0 deletions week1/homework/questions.txt.REMOTE.30389.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Please read:
Chapter 3 Classes, Objects, and Variables
p.86-90 Strings (Strings section in Chapter 6 Standard Types)

1. What is an object?
An object is a representation in memory of a specific concept or thing that the Ruby interpreter knows about.

2. What is a variable?
A variable is a name for a location in memory. It can contain, or point to, any type of object.

3. What is the difference between an object and a class?
An object is an instance of a class, or a specific thing of that class's type in memory. The class is the specifics that are common to all things of that type. The classification of a concept or a thing is a class. A specific thing or concept of a class's type in memory is an object. For example: All books have titles (Class). This book's title is "Harry Potter and the Goblet of Fire" (Object).

4. What is a String?
A string is how Ruby understands text. It is a collection of characters (Bytes), and can be created by making an instance of the String class (String.new) or as a string literal ("",'', %Q[]).

5. What are three messages that I can send to a string object? Hint: think methods
chomp! - removes newline characters, or the specified characters, from the end of a string
strip! - removes leading or trailing whitespace from a string
split - returns an array of strings made up of the original string separated on whitespace or the specified characters or regexp

6. What are two ways of defining a String literal? Bonus: What is the difference between the two?
Single quotes ex: '' and Double quotes ex: "". The single quotes allow for 2 escape characters: \' and \\ . The double quoted string literal allows for many different escaped special characters (like \n is a line break) and allows for string interpolation, or the injection of evaluated Ruby code into the string ex: "Hello #{my_name}". The single quoted string takes up much less memory than a double quoted string with interpolation. Without interpolation, both are about the same.
Loading