Chapter 1 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
cofig/
application configuration
26
db/
database files
27
doc/
documentation for the application
28
lib/
library modules
29
lib/assets
library assets such as css, javascript, and images
30
log/
application log files
31
public/
data accessible to the public (via web browser) such as error pages
32
bin/rails
a program for generating code, opening console sessions, or starting a local server
33
test/
application tests
34
tmp/
temporary files
35
vendor/
third-party code such as plugins and gems
36
vendor/assets
thirst party assets such as css, javascript, and images
37
README.rdoc
a brief description of the application
38
Rakefile
utility tasks available via the rake command
39
gemfile
gem requirements for this app
40
gemfile.lock
a list of gems used to ensure that all copies of the app use the same gem versions
41
config.ru
a configuration file for rack middleware
42
.gitignore
patterns for files that should be ignored by Git
43
bundler
used to install included gems needed by the app.
44
gem 'sqlite3'
install latest version of this gem
45
gem 'ugligier', '>=1.3.0'
(handles file compression for the asset pipeline). install gem as long as its greater than or equal to the version specified.
46
gem 'coffee-rails', '~> 4.0.0'
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
command to use bundler
bundle install
48
running rails in cloud9 command
rails server -b $IP -p $PORT
49
MVC model
enforces separation between domain logic (data models) and the presentation logic (web page)
50
interaction with rails application:
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
define an action to render a string
``` def hello render text: "hello" end ```
52
rails router
determines where to send requests that come in from the browser.
53
root route:
page that is the root URL
54
create root route to application_controller.rb, hello action
root 'application#hello'. tells rails to send the root route to the hello action in the application controller
55
version control
allows us to track changes to our projects code, collaborate more easily, and roll back any errors.
56
git
distributed version control system
57
before using git for the first time, what do you need to do
need to do one-time setup. these are system steps, you do them once per computer
58
git system setup steps:
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
git config --global push.default matching
ensures forward-compatibility with an upcoming release of Git.
60
git config --global alias.co checkout
use co in place of the more verbose checkout command
61
initialize a repository
git init
62
git add -A
add all the project files to the repository apart from those that match the patterns in a special file called .gitignore
63
git status
see files in staging area (changes to be committed (changes to be kept in repository))
64
git commit -m "Initialize repository"
tells git to keep changes and -m flags lets you add messages for the commit
65
git log
list of commit messages
66
ls app/controllers rm -rm app/controllers ls app/controllers
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
SSH keys
identify trusted computers without involving passwords
68
cat ~/.ssh/id_rsa.pub
printing the public key using cat
69
git remote add origin https://github.com//first_app.git
setup github as the origin for your branch
70
git push -u origin master
push your repository up to github
71
branch, edit, commit, merge workflow
recommonded workflow when using Git
72
branches
copies of repository where you can make changes without modifying the parent files(master branch).
73
git checkout -b modify-README
create new topic branch and switch to it
74
git branch
lists branches
75
.md
markdown markup language
76
git commit -a -m "Improve the README file"
git add provides a shortcut -a which is very common for committing all modifications to existing files.
77
merge branch to master branch
git checkout master | git merge modify-README
78
delete a branch
git branch -d modify-README
79
delete branch even though we havent merged any changes
git branch -D topic-branch
80
delete remote branch
git push origin --delete
81
Heroku
platform for deploying rails and other web applications. deploying is very easy when your source code is under version control
82
bundle install --without production
prevent local installation of any production gems
83
login to heroku command:
heroku login
84
add key to heroku:
heroku keys:add
85
create a new application at Heroku
heroku create
86
use git to push master branch up to heroku
git push heroku master
87
rename heroku website command:
heroku rename rails-hello-example
88
('a'..'z').to_a.shuffle[0..7].join
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