Skip to content

Instantly share code, notes, and snippets.

@pyk
Forked from schneems/gist:3036609
Last active January 4, 2016 11:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyk/8613205 to your computer and use it in GitHub Desktop.
Save pyk/8613205 to your computer and use it in GitHub Desktop.
## Week 3 Quiz
## 1) What does ERB stand for?
Embedded Ruby
## 2) What is the name of the place (library) where additional built in Ruby functions can be accessed?
STDlib
## 3) Name 3 Reasons to use Version Control.
manage codebase with no painless, versioning codebase with ease, use same codebase within different device
## 4) Name one version control software.
GIT
## 5) What is the output of this Ruby code?
arry = ['Harry Potter', 'Hunger Games', 'Cat in the Hat']
arry.each do |x|
puts "I enjoy reading #{x}"
end
=> I enjoy readig Harry Potter
=> I enjoy readig Hunger Games
=> I enjoy readig Cat in the Hat
## 6) What is the output of this ruby code?
richard = User.create(:name => 'richard', :movie => 'zoolander')
chris = User.create(:name => 'chris', :movie => 'sandlot')
ruby = User.create(:name => 'ruby', :movie => 'princess bride')
user_array = [richard, ruby, chris]
user_array.each do |user|
puts "#{user.name} loves watching #{user.movie}"
end
=> richard loves watching zoolander
=> chris loves watching sandlot
=> ruby loves watching princess bride
### Hint
puts chris.name
# => 'chris'
puts chris.movie
# => 'sandlot'
## 7) Once we've modified and saved a file that is under version control what 3 steps do we need to get our changes on to our origin server?
1. git add
2. git commit
3. git push origin master
## 8) In the exercise we did for homework last week, you entered in a url similar to `http://localhost:8000/index` into your browser. Once the server got the request, explain what needed to happen in order for you to view the web page.
load file html.erb with name same as route, index. and then ERB parse that html.erb to pure html. then browser loaded that file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment