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

week 9 gem uploaded - jonas haskins #119

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e15fe96
finished the homework!
Oct 15, 2013
7e6e8be
my homework
Oct 16, 2013
8c7cb8c
Merge branch 'master' of github.com:UWE-Ruby/RubyFall2013
Oct 16, 2013
8f4539f
Merge branch 'master' of github.com:UWE-Ruby/RubyFall2013
Oct 16, 2013
1dfb52e
Finished the homework questions, and the simon_says.rb module for hom…
sanojsniksah Oct 22, 2013
99b604b
Merge branch 'master' of github.com:UWE-Ruby/RubyFall2013
sanojsniksah Oct 23, 2013
433e2fe
my book exe
sanojsniksah Oct 24, 2013
3d0172c
spec file.
sanojsniksah Oct 24, 2013
0fc7874
exercises and stuff ...
sanojsniksah Oct 24, 2013
a2085b7
homework ! jonas haskins week 3
sanojsniksah Oct 30, 2013
2d2a8d3
Merge github.com:UWE-Ruby/RubyFall2013
sanojsniksah Nov 5, 2013
72c3def
Merge github.com:UWE-Ruby/RubyFall2013
sanojsniksah Nov 6, 2013
a52c98b
Merge branch 'master' of github.com:UWE-Ruby/RubyFall2013
sanojsniksah Nov 11, 2013
24c4b92
Initial commit
sanojsniksah Nov 11, 2013
a909850
Created the new depo and added the instructions to get started.
sanojsniksah Nov 11, 2013
24496d5
first draft of working even numbers and even numberes spec.
sanojsniksah Nov 12, 2013
65dc743
Merge branch 'master' of github.com:sanojsniksah/jonashaskins_midterm
sanojsniksah Nov 12, 2013
761d1b1
Merge branch 'master' of github.com:UWE-Ruby/RubyFall2013
sanojsniksah Nov 14, 2013
8816f5d
Merge branch 'master' of github.com:UWE-Ruby/RubyFall2013
sanojsniksah Nov 20, 2013
978f2c2
homework for week 7
sanojsniksah Nov 27, 2013
25791bd
Merge branch 'master' of github.com:UWE-Ruby/RubyFall2013
sanojsniksah Dec 3, 2013
767bfa4
Merge branch 'master' of github.com:UWE-Ruby/RubyFall2013
sanojsniksah Dec 3, 2013
3e357cf
Merge branch 'master' of github.com:UWE-Ruby/RubyFall2013
sanojsniksah Dec 5, 2013
2b2f5ae
added all these goodies and the .travis.yml
sanojsniksah Dec 6, 2013
d0378b1
fixed a issue with .travis.yml
sanojsniksah Dec 6, 2013
e2d9429
added my gem.
sanojsniksah Dec 10, 2013
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 added .DS_Store
Binary file not shown.
48 changes: 0 additions & 48 deletions .rvmrc

This file was deleted.

10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: ruby
rvm:
- "1.8.7"
- "1.9.2"
- "1.9.3"
- jruby-18mode # JRuby in 1.8 mode
- jruby-19mode # JRuby in 1.9 mode
- rbx-18mode
# uncomment this line if your project needs to run something other than `rake`:
# script: bundle exec rspec spec
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD
RubyFall2013
============

Expand Down Expand Up @@ -57,7 +58,16 @@ Week 10
* Final due!
* Project due!
* Interesting Stuff
<<<<<<< HEAD
=======
jonashaskins_midterm
====================

keeps my midter
>>>>>>> a909850fc83ae544cc25011759e2c6217f254bb5
=======


[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/UWE-Ruby/rubyfall2013/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

>>>>>>> 8b3b197baa14a59c207aca832acf7ce570e9e099
File renamed without changes.
Empty file added test
Empty file.
Binary file added week1/.DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions week1/class_materials/name_printer_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
describe "NamePrinter Application" do

context "When Somethings Happens When I'm Logged In" do
it "should say Something" do
"Something".should eq "Something"
end
end
end
30 changes: 22 additions & 8 deletions week1/exercises/rspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@

# When this example fails,
# it will show "expected" as 2, and "actual" as 1
1.should eq 2
1.should eq 1

end

it "supports placeholder examples that lack code (like this one)"

# jhjh
it "supports placeholder examples that lack code (like this one)" do
1.should eq 1
end

it "requires that examples use expectations (like #should) to work properly" do

Expand All @@ -71,21 +74,32 @@
end

end

## JHJH added class tests
context "When Somethings Happens When I'm Logged In" do
it "should say Something" do
"Something".should eq "Something"
end
end


context "Examples for in-class test exploration" do
it "should know order of operations" do
# 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

context "Count my name" do
it "should count the characters in your name" do
"Jonas".should have(5).characters
end
end

it "should check basic math"
it "should check basic math"

it "should check basic spelling"
it "should check basic spelling"

end

Expand Down
32 changes: 32 additions & 0 deletions week1/homework/questions.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,47 @@
Please read:
Chapter 3 Classes, Objects, and Variables

p.86-90 Strings (Strings section in Chapter 6 Standard Types)

1. What is an object?
a instance of a class.

2. What is a variable?
a reference to a object

3. What is the difference between an object and a class?
a class is a combination of state and methods. an object is a instance of that class ( class instance ).


4. What is a String?
A sequence of characters.

5. What are three messages that I can send to a string object? Hint: think methods
chomp, count, delete, empty? , length, upcase, downcase, split, squeeze! ... woah there are alot.


6. What are two ways of defining a String literal? Bonus: What is the difference between the two?

single or double quotation marks.

single quotes 'foo', foo becomes the value.
For Double quotes, "foo\nbar" ruby looks for substitutions, interpolation "#{foo}" and escape sequences "Foo \nBar"

also %q ( single quotes ), %Q ( double quotes )

%q/foo bar/
%Q!oh no #{crap}!

you can choose a delimiter.

Finally here documents.

string = << HERE
some kinda text
about something
i forgot what
HERE



check them in and send a pull request !!
29 changes: 25 additions & 4 deletions week1/homework/strings_and_rspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,35 @@
before(:all) do
@my_string = "Renée is a fun teacher. Ruby is a really cool programming language"
end
it "should be able to count the charaters"
it "should be able to count the charaters" do
result = @my_string.count @my_string
result.should eq 66
#puts "Count is #{result}"

# These work to
# white space are characters to
# size = @my_string.size
# size.should eq 66
# puts "Size is #{size}"

# delete the white spaces !
# @new_string = @my_string.delete(' ')
# size = @new_string.size
# size.should eq 55
# puts "Size is #{size}"

end

it "should be able to split on the . charater" do
pending
result = #do something with @my_string here
result = @my_string.split(".")
result.should have(2).items
end
it "should be able to give the encoding of the string" do
pending 'helpful hint: should eq (Encoding.find("UTF-8"))'
#pending 'helpful hint: should eq (Encoding.find("UTF-8"))'
"#{@my_string.encoding}".should eq "UTF-8"
#puts "Encoding of #{@my_string.inspect} is #{@my_string.encoding}"


end
end
end
Expand Down
26 changes: 26 additions & 0 deletions week1/homework/strings_and_rspec_spec_org.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# encoding: utf-8

# Please make these examples all pass
# You will need to change the 3 pending tests
# You will need to write a passing test for the first example
# (Hint: If you need help refer to the in-class exercises)
# The two tests with the pending keyword, require some ruby code to be written
# (Hint: You should do the reading on Strings first)

describe String do
context "When a string is defined" do
before(:all) do
@my_string = "Renée is a fun teacher. Ruby is a really cool programming language"
end
it "should be able to count the charaters"
it "should be able to split on the . charater" do
pending
result = #do something with @my_string here
result.should have(2).items
end
it "should be able to give the encoding of the string" do
pending 'helpful hint: should eq (Encoding.find("UTF-8"))'
end
end
end

9 changes: 9 additions & 0 deletions week2/count_frequency.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def count_frequency(word_list)
counts = Hash.new(0)
for word in word_list
counts[word] += 1
end
counts
end

p count_frequency(["sparky", "the", "cat", "sat", "on", "the", "mat"])
32 changes: 31 additions & 1 deletion week2/exercises/book.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
class Book
<<<<<<< HEAD
attr_accessor :title
attr_reader :page_count
#attr_reader :title #reader only ?
@@book_count = 0

#self. = class level
def self.book.count
## @@ = class level varable
@@book_count
end

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

def test
@test = "Hellow!"
end

def out_put_test
puts @test
puts @@book_count
end

end
=======
attr_accessor :title
attr_reader :page_count

Expand All @@ -24,4 +53,5 @@ def out_put_test
puts @@book_count
end

end
end
>>>>>>> 4706ad52545867a37a0e21a394c5e1103020fe67
29 changes: 28 additions & 1 deletion week2/exercises/book_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

describe Book do

<<<<<<< HEAD
context "::book_count" do

it "should count how many books have been created" do
Book.new
Book.new
Book.new
Book.book_count.should eq 3
end
end



it "should should set some defaults" do
@book.new
end
it "should allow me to set the title" do
@boot.title = "Harry Potter"
@book.title.should eq "Harry Potter"


it "should return the page count" do
@book.page_count.should eq "Page count is 200"
end
end
=======

context "::book_count" do

Expand Down Expand Up @@ -46,4 +72,5 @@

end

end
end
>>>>>>> 4706ad52545867a37a0e21a394c5e1103020fe67
8 changes: 4 additions & 4 deletions week2/exercises/mad_libs.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
puts "Please enter a noun"
print "Please enter a noun : "
noun = gets.chomp
puts "Please enter an adjective"
print "Please enter an adjective : "
adjective = gets.chomp
puts "Please enter a past tense action verb"
print "Please enter a past tense action verb : "
verb_past_tense = gets.chomp
puts "What does the #{noun} say?"
print "What does the #{noun} say? : "
says = gets.chomp
story = "The #{adjective} #{noun} #{verb_past_tense} past the graveyard and says #{says}"
puts story
3 changes: 3 additions & 0 deletions week2/exercises/spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
describe Book do

context
Loading