Chapter 1 - Rails Environments Flashcards

1
Q

Gemfile.lock

A

Bundler calculates the dependency tree for your application and stores the results in a file named Gemfile.lock. From that point on, Bundler will only load specific versions of gems that you are using at the moment that the Gemfile was locked.`

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

There are three files involved in setting up the entire Rails stack:

A

config/ boot.rb Sets up Bundler and load paths.

config/ application.rb Loads Rails gems and gems for the specified Rails.env and configures the application.

config/ environment.rb Runs all initializers.

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

inflections.rb

A

The default inflections for pluralization and singularization of uncountable words are kept in an interesting file inside the Active Support gem, named inflections.rb.

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

session_store.rb

A

As of Rails 4, session cookies are encrypted by default using the new encrypted cookie store. The session_store.rb initializer configures the session store of the application by setting its session store type and key.

Rails.application.config.session_store :cookie_store,
key: ‘_example_session’

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

session_store.rb

A

As of Rails 4, session cookies are encrypted by default using the new encrypted cookie store. The session_store.rb initializer configures the session store of the application by setting its session store type and key.

Rails.application.config.session_store :cookie_store,
key: ‘_example_session’

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

Setup Pry

A
console do
    # This block is called only 
        when running console, 
     # so we can safely require 
        pry here.
    require "pry"
    config.console = Pry
end
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Spring

A

As of version 4.1, Rails ships with an application preloader named Spring. 9 In doing so, during development, your application will remain running in the background. This speeds up development by eliminating the need to boot up Rails every time you execute tests or run a rake task.

https:// github.com/ rails/ spring

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

Spring

A

As of version 4.1, Rails ships with an application preloader named Spring. 9 In doing so, during development, your application will remain running in the background. This speeds up development by eliminating the need to boot up Rails every time you execute tests or run a rake task.

https:// github.com/ rails/ spring

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

Eager Load

A

To speed up the boot time of starting a Rails server during development, code is no longer eager loaded. This behavior is governed by the

config.eager_load setting:

 # Do not eager load code on boot. 
  config.eager_load = false 

In your production environment, you will want this set to true, as it copies most of your application in memory. This provides a performance increase to web servers that copy on write, such as Unicorn.

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