RailsのGemfileをゆるく眺める
ゆるく眺めましょう。
バージョンは4.2.5です。
Gemfile
rails new直後のものです
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
rails
Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
Railsアプリケーションを作成するために必要な物が全て含まれています。お世話になってます。
https://github.com/rails/rails
sqlite3
Use sqlite3 as the database for Active Record
Active RecordのDBとしてsqliteを使用できます。
rails new時に他の種類のDBを指定すると、指定したDBのgemになりますね(mysqlとか)。
sass-rails
Use SCSS for stylesheets
SCSSを使えます。
uglifier
Use Uglifier as compressor for JavaScript assets
JavaScriptのコードを軽量化するものです。
Uglifier.compileにコードを渡すと、コメントや改行や余計な空白が取り除かれ、ローカル変数の名前が短いものに変わったものが返されます。
coffee-rails
Use CoffeeScript for .coffee assets and views
CoffeeScriptを使えます。
therubyracer
See https://github.com/rails/execjs#readme for more supported runtimes
JavaScriptのエンジンであるv8をRubyから使えるようにするgemです。
v8エンジンがシステム上で利用できる場合はそのエンジンを、利用できない場合にはlibv8というgemを取得して、各環境ごとに利用できるバイナリのv8エンジンをlibv8から取得しているそうです。すごい。
jquery-rails
Use jquery as the JavaScript library
jQueryを使えます。
turbolinks
Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
ページ遷移をAjaxに置き換え、JavaScriptやCSSのパースを省略することで高速化してくれるものです。
遷移先ページをXMLHttpRequestで読み込み、jsファイルとcssファイルが現在ページと同じならtitleとbodyを入れ替えたページで置き換えて表示してくれます。
jbuilder
Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
jsonのテンプレートエンジンです。
複雑なjsonも見やすく書けることに定評があります。
sdoc
bundle exec rake doc:rails generates the API under doc/api.
ドキュメント生成ツールです。便利!
bcrypt
Use ActiveModel has_secure_password
パスワードを暗号化したり、セットしたり、認証等の機能を提供しています。
ログインなどの機能を自作するならこれ。
unicorn
Use Unicorn as the app server
汎用のRackアプリケーションサーバです。CPU・メモリを食わない、そして早いことで有名ですね。
これの記事また書こうと思います。(僕はpassengerを使っていますが)
capistrano-rails
Use Capistrano for deployment
Railsの自動デプロイツールです。Railsのデプロイツールといえばこれ。
byebug
Call 'byebug' anywhere in the code to stop execution and get a debugger console
Ruby 2.0系で登場したデバッガです。評判いいです。
web-console
Access an IRB console on exception pages or by using <%= console %> in views
<%= console %>
をViewに埋め込むと、ブラウザで見た時にコンソールが出てきます。
spring
Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
アプリケーションプリローダーです。
事前にバックグラウンドでライブラリとかをロードして、待ち時間を短くしてくれます。強い。
ゆるく眺めた感想
「あっ、なんかすごいことやってるんだな」ってなりますね!