Chapter 1 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

scaffolding define:

A

generating code. quicker, easier, more seductive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ruby on rails:

A

web development framework written in ruby.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what makes rails so great?

A

open source. easy to write web applications: generating html, making data models, routing URL’s are easy with rails. also follows REST architectural style. great for rapid prototype

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

IDE:

A

integrated development enviroment. programming enviroment consisting of code editor, compiler, debugger, and more. (eclipse)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

command to install rails at version 4.2.2

A

gem install rails -v 4.2.2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

-v flag

A

ensures specified version gets installed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how do we install packages

A

use gem command provided by the rubygems package manager

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

bash:

A

shell command-line interface. (linux command line)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

ls -l

A

lists the contents of the directory. -l lists more

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

mkdir

A

creates directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

cd

A

change directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

cd ..

A

go up a directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

cd ~ or cd

A

change to home directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

cd ~/workspace

A

go to home directory and go to workspace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

mv README.rdoc README.md

A

move file (rename)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

cp README.rdoc README.md

A

copy file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

rm README.rdoc

A

delete file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

rmdir workspace

A

remove empty directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

rm -rf tmp

A

remove nonempty directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

cat ~/.ssh/id_rsa.pub

A

display file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

command to run rails at specific version

A

rails 4.2.2 new hello_app

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

app/

A

core application code, including models, views, controllers, and helpers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

app/assets

A

applications assets such as css, javascript, and images

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

bin/

A

binary executable files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

cofig/

A

application configuration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

db/

A

database files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

doc/

A

documentation for the application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

lib/

A

library modules

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

lib/assets

A

library assets such as css, javascript, and images

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

log/

A

application log files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

public/

A

data accessible to the public (via web browser) such as error pages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

bin/rails

A

a program for generating code, opening console sessions, or starting a local server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

test/

A

application tests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

tmp/

A

temporary files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

vendor/

A

third-party code such as plugins and gems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

vendor/assets

A

thirst party assets such as css, javascript, and images

37
Q

README.rdoc

A

a brief description of the application

38
Q

Rakefile

A

utility tasks available via the rake command

39
Q

gemfile

A

gem requirements for this app

40
Q

gemfile.lock

A

a list of gems used to ensure that all copies of the app use the same gem versions

41
Q

config.ru

A

a configuration file for rack middleware

42
Q

.gitignore

A

patterns for files that should be ignored by Git

43
Q

bundler

A

used to install included gems needed by the app.

44
Q

gem ‘sqlite3’

A

install latest version of this gem

45
Q

gem ‘ugligier’, ‘>=1.3.0’

A

(handles file compression for the asset pipeline). install gem as long as its greater than or equal to the version specified.

46
Q

gem ‘coffee-rails’, ‘~> 4.0.0’

A

install gem as long as its newer than version 4.0.0 and not newer than 4.1 (minor point releases). 4.0.0 to 4.0.1 is ok, but 4.0 to 4.1 is not

47
Q

command to use bundler

A

bundle install

48
Q

running rails in cloud9 command

A

rails server -b $IP -p $PORT

49
Q

MVC model

A

enforces separation between domain logic (data models) and the presentation logic (web page)

50
Q

interaction with rails application:

A

browser sends request which is received by web server and passed on to a rails controller, which is in charge of what to do next. controller interacts with model, which is ruby object that represents an element of the site and is in charge of communication with the database. the controller then renders the view and returns the complete web page to the browser

51
Q

define an action to render a string

A
def hello
  render text: "hello"
end
52
Q

rails router

A

determines where to send requests that come in from the browser.

53
Q

root route:

A

page that is the root URL

54
Q

create root route to application_controller.rb, hello action

A

root ‘application#hello’. tells rails to send the root route to the hello action in the application controller

55
Q

version control

A

allows us to track changes to our projects code, collaborate more easily, and roll back any errors.

56
Q

git

A

distributed version control system

57
Q

before using git for the first time, what do you need to do

A

need to do one-time setup. these are system steps, you do them once per computer

58
Q

git system setup steps:

A

git config –global user.name “your name”
git config –global user.email your.email@example.com
git config –global push.default matching
git config –global alia.co checkout. the name and email will be available in any repository you make public

59
Q

git config –global push.default matching

A

ensures forward-compatibility with an upcoming release of Git.

60
Q

git config –global alias.co checkout

A

use co in place of the more verbose checkout command

61
Q

initialize a repository

A

git init

62
Q

git add -A

A

add all the project files to the repository apart from those that match the patterns in a special file called .gitignore

63
Q

git status

A

see files in staging area (changes to be committed (changes to be kept in repository))

64
Q

git commit -m “Initialize repository”

A

tells git to keep changes and -m flags lets you add messages for the commit

65
Q

git log

A

list of commit messages

66
Q

ls app/controllers
rm -rm app/controllers
ls app/controllers

A

deleted app/controllers which is critical. but it is only in the working tree; they havent been committed yet so you can get them back with:
git checkout -f
or
git co -f

67
Q

SSH keys

A

identify trusted computers without involving passwords

68
Q

cat ~/.ssh/id_rsa.pub

A

printing the public key using cat

69
Q

git remote add origin https://github.com//first_app.git

A

setup github as the origin for your branch

70
Q

git push -u origin master

A

push your repository up to github

71
Q

branch, edit, commit, merge workflow

A

recommonded workflow when using Git

72
Q

branches

A

copies of repository where you can make changes without modifying the parent files(master branch).

73
Q

git checkout -b modify-README

A

create new topic branch and switch to it

74
Q

git branch

A

lists branches

75
Q

.md

A

markdown markup language

76
Q

git commit -a -m “Improve the README file”

A

git add provides a shortcut -a which is very common for committing all modifications to existing files.

77
Q

merge branch to master branch

A

git checkout master

git merge modify-README

78
Q

delete a branch

A

git branch -d modify-README

79
Q

delete branch even though we havent merged any changes

A

git branch -D topic-branch

80
Q

delete remote branch

A

git push origin –delete

81
Q

Heroku

A

platform for deploying rails and other web applications. deploying is very easy when your source code is under version control

82
Q

bundle install –without production

A

prevent local installation of any production gems

83
Q

login to heroku command:

A

heroku login

84
Q

add key to heroku:

A

heroku keys:add

85
Q

create a new application at Heroku

A

heroku create

86
Q

use git to push master branch up to heroku

A

git push heroku master

87
Q

rename heroku website command:

A

heroku rename rails-hello-example

88
Q

(‘a’..’z’).to_a.shuffle[0..7].join

A

take all values from ‘a’ through ‘z’, convert to array, shuffle whole array and take first 8 indexes and join them to create unique sequence