├── 01_sorcery └── learning_gems │ ├── log │ └── .keep │ ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── apple-touch-icon-precomposed.png │ └── robots.txt │ ├── test │ ├── helpers │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ └── user_test.rb │ ├── controllers │ │ ├── .keep │ │ ├── users_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ └── welcome_controller_test.rb │ ├── fixtures │ │ ├── .keep │ │ └── files │ │ │ └── .keep │ ├── integration │ │ └── .keep │ └── test_helper.rb │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ ├── channels │ │ │ │ └── .keep │ │ │ ├── users.coffee │ │ │ ├── sessions.coffee │ │ │ └── welcome.coffee │ │ ├── config │ │ │ └── manifest.js │ │ └── stylesheets │ │ │ ├── users.scss │ │ │ ├── sessions.scss │ │ │ └── welcome.scss │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ └── application_record.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── welcome_controller.rb │ │ └── application_controller.rb │ ├── views │ │ ├── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ │ └── welcome │ │ │ └── index.html.erb │ ├── helpers │ │ ├── users_helper.rb │ │ ├── welcome_helper.rb │ │ ├── sessions_helper.rb │ │ └── application_helper.rb │ ├── jobs │ │ └── application_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ └── mailers │ │ └── application_mailer.rb │ ├── README.md │ ├── vendor │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep │ ├── bin │ ├── bundle │ ├── rake │ └── rails │ ├── config │ ├── spring.rb │ ├── boot.rb │ ├── environment.rb │ ├── cable.yml │ ├── initializers │ │ ├── session_store.rb │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ └── cookies_serializer.rb │ └── routes.rb │ ├── config.ru │ ├── Rakefile │ └── db │ ├── migrate │ ├── 20161119031113_sorcery_remember_me.rb │ ├── 20161119031112_sorcery_core.rb │ └── 20161119031115_sorcery_user_activation.rb │ └── seeds.rb ├── 02_sorcery └── README.md ├── 04_sidekiq └── learning_gems │ ├── log │ └── .keep │ ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── apple-touch-icon-precomposed.png │ └── robots.txt │ ├── test │ ├── helpers │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ └── user_test.rb │ ├── controllers │ │ ├── .keep │ │ ├── users_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ └── welcome_controller_test.rb │ ├── fixtures │ │ ├── .keep │ │ └── files │ │ │ └── .keep │ ├── integration │ │ └── .keep │ └── test_helper.rb │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ ├── channels │ │ │ │ └── .keep │ │ │ ├── users.coffee │ │ │ ├── sessions.coffee │ │ │ └── welcome.coffee │ │ ├── config │ │ │ └── manifest.js │ │ └── stylesheets │ │ │ ├── users.scss │ │ │ ├── sessions.scss │ │ │ └── welcome.scss │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ └── application_record.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── welcome_controller.rb │ │ └── application_controller.rb │ ├── views │ │ └── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ ├── helpers │ │ ├── users_helper.rb │ │ ├── welcome_helper.rb │ │ ├── sessions_helper.rb │ │ └── application_helper.rb │ ├── jobs │ │ ├── application_job.rb │ │ └── standalone_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ └── mailers │ │ └── application_mailer.rb │ ├── README.md │ ├── vendor │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep │ ├── config │ ├── redis.yml │ ├── spring.rb │ ├── boot.rb │ ├── environment.rb │ ├── cable.yml │ ├── initializers │ │ ├── session_store.rb │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ └── cookies_serializer.rb │ ├── sidekiq.yml │ └── routes.rb │ ├── bin │ ├── bundle │ ├── rake │ └── rails │ ├── config.ru │ ├── Rakefile │ └── db │ ├── migrate │ ├── 20161119031113_sorcery_remember_me.rb │ ├── 20161119031112_sorcery_core.rb │ └── 20161119031115_sorcery_user_activation.rb │ └── seeds.rb ├── 05_sidekiq └── README.md ├── 06_unicorn └── learning_gems │ ├── log │ └── .keep │ ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── apple-touch-icon-precomposed.png │ └── robots.txt │ ├── test │ ├── helpers │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ └── user_test.rb │ ├── controllers │ │ ├── .keep │ │ ├── users_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ └── welcome_controller_test.rb │ ├── fixtures │ │ ├── .keep │ │ └── files │ │ │ └── .keep │ ├── integration │ │ └── .keep │ └── test_helper.rb │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ ├── channels │ │ │ │ └── .keep │ │ │ ├── users.coffee │ │ │ ├── sessions.coffee │ │ │ └── welcome.coffee │ │ ├── config │ │ │ └── manifest.js │ │ └── stylesheets │ │ │ ├── users.scss │ │ │ ├── sessions.scss │ │ │ └── welcome.scss │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ └── application_record.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── welcome_controller.rb │ │ └── application_controller.rb │ ├── views │ │ └── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ ├── helpers │ │ ├── users_helper.rb │ │ ├── welcome_helper.rb │ │ ├── sessions_helper.rb │ │ └── application_helper.rb │ ├── jobs │ │ ├── application_job.rb │ │ └── standalone_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ └── mailers │ │ └── application_mailer.rb │ ├── README.md │ ├── vendor │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep │ ├── config │ ├── redis.yml │ ├── spring.rb │ ├── boot.rb │ ├── environment.rb │ ├── cable.yml │ ├── initializers │ │ ├── session_store.rb │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ └── cookies_serializer.rb │ ├── sidekiq.yml │ └── routes.rb │ ├── bin │ ├── bundle │ ├── rake │ └── rails │ ├── config.ru │ ├── Rakefile │ └── db │ ├── migrate │ ├── 20161119031113_sorcery_remember_me.rb │ ├── 20161119031112_sorcery_core.rb │ └── 20161119031115_sorcery_user_activation.rb │ └── seeds.rb ├── 07_capistrano └── learning_gems │ ├── log │ └── .keep │ ├── lib │ ├── tasks │ │ └── .keep │ └── assets │ │ └── .keep │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── apple-touch-icon-precomposed.png │ └── robots.txt │ ├── test │ ├── fixtures │ │ ├── .keep │ │ └── files │ │ │ └── .keep │ ├── helpers │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ └── user_test.rb │ ├── controllers │ │ ├── .keep │ │ ├── users_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ └── welcome_controller_test.rb │ ├── integration │ │ └── .keep │ └── test_helper.rb │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ ├── channels │ │ │ │ └── .keep │ │ │ ├── users.coffee │ │ │ ├── welcome.coffee │ │ │ └── sessions.coffee │ │ ├── config │ │ │ └── manifest.js │ │ └── stylesheets │ │ │ ├── users.scss │ │ │ ├── welcome.scss │ │ │ └── sessions.scss │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ └── application_record.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── welcome_controller.rb │ │ └── application_controller.rb │ ├── views │ │ └── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ ├── helpers │ │ ├── users_helper.rb │ │ ├── sessions_helper.rb │ │ ├── welcome_helper.rb │ │ └── application_helper.rb │ ├── jobs │ │ ├── application_job.rb │ │ └── standalone_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ └── mailers │ │ └── application_mailer.rb │ ├── vendor │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep │ ├── README.md │ ├── config │ ├── redis.yml │ ├── boot.rb │ ├── spring.rb │ ├── environment.rb │ ├── cable.yml │ ├── initializers │ │ ├── session_store.rb │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ └── cookies_serializer.rb │ ├── sidekiq.yml │ └── routes.rb │ ├── bin │ ├── bundle │ ├── rake │ └── rails │ ├── config.ru │ ├── Rakefile │ └── db │ ├── migrate │ ├── 20161119031113_sorcery_remember_me.rb │ ├── 20161119031112_sorcery_core.rb │ └── 20161119031115_sorcery_user_activation.rb │ └── seeds.rb ├── 14_pundit └── learning_gems │ ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── apple-touch-icon-precomposed.png │ └── robots.txt │ ├── test │ ├── fixtures │ │ ├── .keep │ │ └── files │ │ │ └── .keep │ ├── helpers │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ ├── post_test.rb │ │ ├── role_test.rb │ │ ├── user_test.rb │ │ └── user_role_test.rb │ ├── controllers │ │ ├── .keep │ │ ├── users_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ ├── welcome_controller_test.rb │ │ └── posts_controller_test.rb │ ├── integration │ │ └── .keep │ └── test_helper.rb │ ├── .ruby-version │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ ├── channels │ │ │ │ └── .keep │ │ │ ├── posts.coffee │ │ │ ├── users.coffee │ │ │ ├── sessions.coffee │ │ │ └── welcome.coffee │ │ ├── config │ │ │ └── manifest.js │ │ └── stylesheets │ │ │ ├── application.scss │ │ │ ├── users.scss │ │ │ ├── sessions.scss │ │ │ └── welcome.scss │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ ├── application_record.rb │ │ ├── user_role.rb │ │ ├── role.rb │ │ └── post.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── welcome_controller.rb │ │ └── application_controller.rb │ ├── views │ │ ├── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ │ └── posts │ │ │ ├── edit.html.erb │ │ │ └── show.html.erb │ ├── helpers │ │ ├── posts_helper.rb │ │ ├── users_helper.rb │ │ ├── sessions_helper.rb │ │ ├── welcome_helper.rb │ │ └── application_helper.rb │ ├── jobs │ │ ├── application_job.rb │ │ └── standalone_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ ├── mailers │ │ └── application_mailer.rb │ └── policies │ │ ├── general_policy.rb │ │ └── post_policy.rb │ ├── vendor │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep │ ├── README.md │ ├── config │ ├── redis.yml │ ├── boot.rb │ ├── spring.rb │ ├── environment.rb │ ├── cable.yml │ ├── initializers │ │ ├── session_store.rb │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ └── cookies_serializer.rb │ ├── sidekiq.yml │ └── routes.rb │ ├── bin │ ├── bundle │ ├── rake │ └── rails │ ├── db │ ├── migrate │ │ ├── 20170728040838_create_roles.rb │ │ ├── 20170728031037_create_posts.rb │ │ ├── 20170728040853_create_user_roles.rb │ │ ├── 20161119031113_sorcery_remember_me.rb │ │ ├── 20161119031112_sorcery_core.rb │ │ └── 20161119031115_sorcery_user_activation.rb │ └── seeds.rb │ └── Rakefile ├── 03_bootstrap_fontawesome └── learning_gems │ ├── log │ └── .keep │ ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── apple-touch-icon-precomposed.png │ └── robots.txt │ ├── test │ ├── fixtures │ │ ├── .keep │ │ └── files │ │ │ └── .keep │ ├── helpers │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ └── user_test.rb │ ├── controllers │ │ ├── .keep │ │ ├── users_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ └── welcome_controller_test.rb │ ├── integration │ │ └── .keep │ └── test_helper.rb │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ ├── channels │ │ │ │ └── .keep │ │ │ ├── users.coffee │ │ │ ├── sessions.coffee │ │ │ └── welcome.coffee │ │ ├── config │ │ │ └── manifest.js │ │ └── stylesheets │ │ │ ├── users.scss │ │ │ ├── sessions.scss │ │ │ └── welcome.scss │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ └── application_record.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── welcome_controller.rb │ │ └── application_controller.rb │ ├── views │ │ └── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ ├── helpers │ │ ├── users_helper.rb │ │ ├── sessions_helper.rb │ │ ├── welcome_helper.rb │ │ └── application_helper.rb │ ├── jobs │ │ └── application_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ └── mailers │ │ └── application_mailer.rb │ ├── README.md │ ├── vendor │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep │ ├── bin │ ├── bundle │ ├── rake │ └── rails │ ├── config │ ├── boot.rb │ ├── spring.rb │ ├── environment.rb │ ├── cable.yml │ ├── initializers │ │ ├── session_store.rb │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ └── cookies_serializer.rb │ └── routes.rb │ ├── config.ru │ ├── Rakefile │ └── db │ ├── migrate │ └── 20161119031113_sorcery_remember_me.rb │ └── seeds.rb ├── 13_sassc_rails └── learning_gems │ ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── apple-touch-icon-precomposed.png │ └── robots.txt │ ├── test │ ├── fixtures │ │ ├── .keep │ │ └── files │ │ │ └── .keep │ ├── helpers │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ └── user_test.rb │ ├── controllers │ │ ├── .keep │ │ ├── users_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ └── welcome_controller_test.rb │ ├── integration │ │ └── .keep │ └── test_helper.rb │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ ├── channels │ │ │ │ └── .keep │ │ │ ├── users.coffee │ │ │ ├── sessions.coffee │ │ │ └── welcome.coffee │ │ ├── config │ │ │ └── manifest.js │ │ └── stylesheets │ │ │ ├── application.scss │ │ │ ├── users.scss │ │ │ ├── sessions.scss │ │ │ └── welcome.scss │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ └── application_record.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── welcome_controller.rb │ │ └── application_controller.rb │ ├── views │ │ └── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ ├── helpers │ │ ├── users_helper.rb │ │ ├── sessions_helper.rb │ │ ├── welcome_helper.rb │ │ └── application_helper.rb │ ├── jobs │ │ ├── application_job.rb │ │ └── standalone_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ └── mailers │ │ └── application_mailer.rb │ ├── vendor │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep │ ├── README.md │ ├── config │ ├── redis.yml │ ├── boot.rb │ ├── spring.rb │ ├── environment.rb │ ├── cable.yml │ ├── initializers │ │ ├── session_store.rb │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ └── cookies_serializer.rb │ ├── sidekiq.yml │ └── routes.rb │ ├── bin │ ├── bundle │ ├── rake │ └── rails │ ├── Rakefile │ └── db │ ├── migrate │ ├── 20161119031113_sorcery_remember_me.rb │ └── 20161119031112_sorcery_core.rb │ └── seeds.rb ├── .gitignore ├── 08_capistrano_with_unicorn └── learning_gems │ ├── log │ └── .keep │ ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep │ ├── test │ ├── models │ │ ├── .keep │ │ └── user_test.rb │ ├── controllers │ │ ├── .keep │ │ ├── users_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ └── welcome_controller_test.rb │ ├── fixtures │ │ ├── .keep │ │ └── files │ │ │ └── .keep │ ├── helpers │ │ └── .keep │ ├── integration │ │ └── .keep │ ├── mailers │ │ └── .keep │ └── test_helper.rb │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── apple-touch-icon-precomposed.png │ └── robots.txt │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ ├── channels │ │ │ │ └── .keep │ │ │ ├── sessions.coffee │ │ │ ├── users.coffee │ │ │ └── welcome.coffee │ │ ├── config │ │ │ └── manifest.js │ │ └── stylesheets │ │ │ ├── users.scss │ │ │ ├── sessions.scss │ │ │ └── welcome.scss │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ └── application_record.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── welcome_controller.rb │ │ └── application_controller.rb │ ├── views │ │ └── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ ├── helpers │ │ ├── users_helper.rb │ │ ├── welcome_helper.rb │ │ ├── sessions_helper.rb │ │ └── application_helper.rb │ ├── jobs │ │ ├── application_job.rb │ │ └── standalone_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ └── mailers │ │ └── application_mailer.rb │ ├── vendor │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep │ ├── README.md │ ├── config │ ├── redis.yml │ ├── spring.rb │ ├── boot.rb │ ├── environment.rb │ ├── cable.yml │ ├── initializers │ │ ├── session_store.rb │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ └── cookies_serializer.rb │ ├── sidekiq.yml │ └── routes.rb │ ├── bin │ ├── bundle │ ├── rake │ └── rails │ ├── config.ru │ ├── Rakefile │ └── db │ └── migrate │ └── 20161119031113_sorcery_remember_me.rb ├── 10_unicorn_worker_killer └── learning_gems │ ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── apple-touch-icon-precomposed.png │ └── robots.txt │ ├── test │ ├── fixtures │ │ ├── .keep │ │ └── files │ │ │ └── .keep │ ├── helpers │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ └── user_test.rb │ ├── controllers │ │ ├── .keep │ │ ├── users_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ └── welcome_controller_test.rb │ ├── integration │ │ └── .keep │ └── test_helper.rb │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ ├── channels │ │ │ │ └── .keep │ │ │ ├── users.coffee │ │ │ ├── sessions.coffee │ │ │ └── welcome.coffee │ │ ├── config │ │ │ └── manifest.js │ │ └── stylesheets │ │ │ ├── users.scss │ │ │ ├── sessions.scss │ │ │ └── welcome.scss │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ └── application_record.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── welcome_controller.rb │ │ └── application_controller.rb │ ├── views │ │ └── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ ├── helpers │ │ ├── users_helper.rb │ │ ├── sessions_helper.rb │ │ ├── welcome_helper.rb │ │ └── application_helper.rb │ ├── jobs │ │ ├── application_job.rb │ │ └── standalone_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ └── mailers │ │ └── application_mailer.rb │ ├── vendor │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep │ ├── README.md │ ├── config │ ├── redis.yml │ ├── boot.rb │ ├── spring.rb │ ├── environment.rb │ ├── cable.yml │ ├── initializers │ │ ├── session_store.rb │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ └── cookies_serializer.rb │ ├── sidekiq.yml │ └── routes.rb │ ├── bin │ ├── bundle │ ├── rake │ └── rails │ ├── Rakefile │ └── db │ ├── migrate │ └── 20161119031113_sorcery_remember_me.rb │ └── seeds.rb ├── 09_deploy_using_a_shell_script └── learning_gems │ ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep │ ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ ├── apple-touch-icon-precomposed.png │ └── robots.txt │ ├── test │ ├── helpers │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ └── user_test.rb │ ├── controllers │ │ ├── .keep │ │ ├── users_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ └── welcome_controller_test.rb │ ├── fixtures │ │ ├── .keep │ │ └── files │ │ │ └── .keep │ ├── integration │ │ └── .keep │ └── test_helper.rb │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ ├── channels │ │ │ │ └── .keep │ │ │ ├── users.coffee │ │ │ ├── sessions.coffee │ │ │ └── welcome.coffee │ │ ├── config │ │ │ └── manifest.js │ │ └── stylesheets │ │ │ ├── users.scss │ │ │ ├── sessions.scss │ │ │ └── welcome.scss │ ├── models │ │ ├── concerns │ │ │ └── .keep │ │ └── application_record.rb │ ├── controllers │ │ ├── concerns │ │ │ └── .keep │ │ ├── welcome_controller.rb │ │ └── application_controller.rb │ ├── views │ │ └── layouts │ │ │ ├── mailer.text.erb │ │ │ └── mailer.html.erb │ ├── helpers │ │ ├── users_helper.rb │ │ ├── welcome_helper.rb │ │ ├── sessions_helper.rb │ │ └── application_helper.rb │ ├── jobs │ │ ├── application_job.rb │ │ └── standalone_job.rb │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ └── mailers │ │ └── application_mailer.rb │ ├── vendor │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep │ ├── README.md │ ├── config │ ├── redis.yml │ ├── spring.rb │ ├── boot.rb │ ├── environment.rb │ ├── cable.yml │ ├── initializers │ │ ├── session_store.rb │ │ ├── mime_types.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter_parameter_logging.rb │ │ └── cookies_serializer.rb │ ├── sidekiq.yml │ └── routes.rb │ ├── bin │ ├── bundle │ ├── rake │ └── rails │ ├── config.ru │ ├── Rakefile │ └── db │ └── migrate │ └── 20161119031113_sorcery_remember_me.rb ├── 12_eventmachine_reaper └── reaper │ ├── .gitignore │ ├── config.yml │ ├── Gemfile │ ├── boot.rb │ ├── main.rb │ ├── bin │ ├── console │ ├── stop │ └── start │ ├── lib │ └── reaper │ │ ├── job │ │ ├── fetcher.rb │ │ └── uploader.rb │ │ └── config.rb │ ├── Gemfile.lock │ └── README.md └── README.md /01_sorcery/learning_gems/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /02_sorcery/README.md: -------------------------------------------------------------------------------- 1 | 和01_sorcery一样 2 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05_sidekiq/README.md: -------------------------------------------------------------------------------- 1 | 和04_sorcery一样 2 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/.ruby-version: -------------------------------------------------------------------------------- 1 | 2.4.0 2 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .byebug_history 2 | *.log 3 | tmp/ 4 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.pid 3 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/helpers/posts_helper.rb: -------------------------------------------------------------------------------- 1 | module PostsHelper 2 | end 3 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/config.yml: -------------------------------------------------------------------------------- 1 | development: 2 | key: 123 3 | 4 | production: 5 | key: 456 -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | http://eggman.tv 4 | 5 | learning gems courses 6 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | http://eggman.tv 4 | 5 | learning gems courses 6 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | http://eggman.tv 4 | 5 | learning gems courses 6 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/views/posts/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Posts

2 | 3 |

编辑:<%= @post.title %>

4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | http://eggman.tv 4 | 5 | learning gems courses 6 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | http://eggman.tv 4 | 5 | learning gems courses 6 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### eggman.tv 2 | 3 | [Ruby常用Gems系列](http://eggman.tv/c/s-learn-ruby-common-gems)课程源码 4 | 5 | ©EGGMAN.TV 蛋人网 -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | http://eggman.tv 4 | 5 | learning gems courses 6 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/views/welcome/index.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome#index

2 |

Find me in app/views/welcome/index.html.erb

3 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/views/posts/show.html.erb: -------------------------------------------------------------------------------- 1 |

Posts

2 | 3 |

<%= @post.title %>

4 |

作者: <%= @post.user.email %>

5 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/models/user_role.rb: -------------------------------------------------------------------------------- 1 | class UserRole < ApplicationRecord 2 | 3 | belongs_to :user 4 | belongs_to :role 5 | 6 | end 7 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/redis.yml: -------------------------------------------------------------------------------- 1 | development: 'redis://localhost:6379/10' 2 | test: 'redis://localhost:6379/10' 3 | production: 'redis://localhost:6379/10' -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/redis.yml: -------------------------------------------------------------------------------- 1 | development: 'redis://localhost:6379/10' 2 | test: 'redis://localhost:6379/10' 3 | production: 'redis://localhost:6379/10' -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/Gemfile: -------------------------------------------------------------------------------- 1 | # source "https://rubygems.org" 2 | source "https://ruby.taobao.org" 3 | 4 | gem "eventmachine", '>= 1.2.0' 5 | gem 'logger' 6 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/models/role.rb: -------------------------------------------------------------------------------- 1 | class Role < ApplicationRecord 2 | 3 | has_many :user_roles 4 | has_many :users, through: :user_roles 5 | 6 | end 7 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/redis.yml: -------------------------------------------------------------------------------- 1 | development: 'redis://localhost:6379/10' 2 | test: 'redis://localhost:6379/10' 3 | production: 'redis://localhost:6379/10' -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/redis.yml: -------------------------------------------------------------------------------- 1 | development: 'redis://localhost:6379/10' 2 | test: 'redis://localhost:6379/10' 3 | production: 'redis://localhost:6379/10' -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/redis.yml: -------------------------------------------------------------------------------- 1 | development: 'redis://localhost:6379/10' 2 | test: 'redis://localhost:6379/10' 3 | production: 'redis://localhost:6379/10' -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __FILE__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/redis.yml: -------------------------------------------------------------------------------- 1 | development: 'redis://localhost:6379/10' 2 | test: 'redis://localhost:6379/10' 3 | production: 'redis://localhost:6379/10' -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/redis.yml: -------------------------------------------------------------------------------- 1 | development: 'redis://localhost:6379/10' 2 | test: 'redis://localhost:6379/10' 3 | production: 'redis://localhost:6379/10' -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/redis.yml: -------------------------------------------------------------------------------- 1 | development: 'redis://localhost:6379/10' 2 | test: 'redis://localhost:6379/10' 3 | production: 'redis://localhost:6379/10' -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/models/post.rb: -------------------------------------------------------------------------------- 1 | class Post < ApplicationRecord 2 | 3 | belongs_to :user 4 | 5 | 6 | def self.policy_class 7 | PostPolicy 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | @import "bootstrap-sprockets"; 2 | @import "bootstrap"; 3 | @import "font-awesome"; 4 | 5 | h1 { 6 | font-weight: 700; 7 | } 8 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/models/post_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PostTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/models/role_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RoleTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/main.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | Bundler.require 3 | 4 | Dir["#{File.expand_path("../lib/*/**/**.rb", __FILE__)}"].each { |file| require file } 5 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | @import "bootstrap-sprockets"; 2 | @import "bootstrap"; 3 | @import "font-awesome"; 4 | 5 | h1 { 6 | font-weight: 700; 7 | } 8 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | 4 | include Pundit 5 | end 6 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/models/user_role_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserRoleTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_learning_gems_session' 4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_learning_gems_session' 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_learning_gems_session' 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_learning_gems_session' 4 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_learning_gems_session' 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_learning_gems_session' 4 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_learning_gems_session' 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_learning_gems_session' 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_learning_gems_session' 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_learning_gems_session' 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | root 'welcome#index' 4 | 5 | resources :sessions 6 | resources :users 7 | delete '/logout' => 'sessions#destroy', as: :logout 8 | 9 | end 10 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/assets/stylesheets/sessions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/assets/stylesheets/sessions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/assets/stylesheets/sessions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require "bundler/setup" 4 | $: << File.expand_path('../../lib', __FILE__) 5 | 6 | require File.expand_path('../../main', __FILE__) 7 | 8 | require "irb" 9 | IRB.start 10 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/stylesheets/sessions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/policies/general_policy.rb: -------------------------------------------------------------------------------- 1 | class GeneralPolicy 2 | 3 | attr_reader :user 4 | 5 | def initialize(user, _) 6 | @user = user 7 | end 8 | 9 | def is_banned? 10 | false 11 | end 12 | 13 | end 14 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/policies/post_policy.rb: -------------------------------------------------------------------------------- 1 | class PostPolicy < ApplicationPolicy 2 | 3 | def edit? 4 | user.has_role?('admin') || user == record.user 5 | end 6 | 7 | def can_edit? 8 | true 9 | end 10 | 11 | end 12 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/db/migrate/20170728040838_create_roles.rb: -------------------------------------------------------------------------------- 1 | class CreateRoles < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :roles do |t| 4 | t.string :title 5 | t.timestamps 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/assets/stylesheets/sessions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/assets/stylesheets/sessions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | root 'welcome#index' 4 | 5 | resources :sessions 6 | resources :users 7 | delete '/logout' => 'sessions#destroy', as: :logout 8 | 9 | end 10 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 5 2 | :pidfile: tmp/pids/sidekiq.pid 3 | development: 4 | :concurrency: 2 5 | production: 6 | :concurrency: 5 7 | :queues: 8 | - default 9 | - [mailers, 2] 10 | :logfile: log/sidekiq.log -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 5 2 | :pidfile: tmp/pids/sidekiq.pid 3 | development: 4 | :concurrency: 2 5 | production: 6 | :concurrency: 5 7 | :queues: 8 | - default 9 | - [mailers, 2] 10 | :logfile: log/sidekiq.log -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 5 2 | :pidfile: tmp/pids/sidekiq.pid 3 | development: 4 | :concurrency: 2 5 | production: 6 | :concurrency: 5 7 | :queues: 8 | - default 9 | - [mailers, 2] 10 | :logfile: log/sidekiq.log -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 5 2 | :pidfile: tmp/pids/sidekiq.pid 3 | development: 4 | :concurrency: 2 5 | production: 6 | :concurrency: 5 7 | :queues: 8 | - default 9 | - [mailers, 2] 10 | :logfile: log/sidekiq.log -------------------------------------------------------------------------------- /14_pundit/learning_gems/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/assets/stylesheets/sessions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/jobs/standalone_job.rb: -------------------------------------------------------------------------------- 1 | class StandaloneJob 2 | 3 | include Sidekiq::Worker 4 | sidekiq_options :queue => :default, :retry => true, :backtrace => true 5 | 6 | def perform(args) 7 | # User.find 10 8 | end 9 | 10 | end -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/jobs/standalone_job.rb: -------------------------------------------------------------------------------- 1 | class StandaloneJob 2 | 3 | include Sidekiq::Worker 4 | sidekiq_options :queue => :default, :retry => true, :backtrace => true 5 | 6 | def perform(args) 7 | # User.find 10 8 | end 9 | 10 | end -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/assets/stylesheets/sessions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/assets/stylesheets/sessions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 5 2 | :pidfile: tmp/pids/sidekiq.pid 3 | development: 4 | :concurrency: 2 5 | production: 6 | :concurrency: 5 7 | :queues: 8 | - default 9 | - [mailers, 2] 10 | :logfile: log/sidekiq.log -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/jobs/standalone_job.rb: -------------------------------------------------------------------------------- 1 | class StandaloneJob 2 | 3 | include Sidekiq::Worker 4 | sidekiq_options :queue => :default, :retry => true, :backtrace => true 5 | 6 | def perform(args) 7 | # User.find 10 8 | end 9 | 10 | end -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/jobs/standalone_job.rb: -------------------------------------------------------------------------------- 1 | class StandaloneJob 2 | 3 | include Sidekiq::Worker 4 | sidekiq_options :queue => :default, :retry => true, :backtrace => true 5 | 6 | def perform(args) 7 | # User.find 10 8 | end 9 | 10 | end -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/assets/stylesheets/sessions.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/jobs/standalone_job.rb: -------------------------------------------------------------------------------- 1 | class StandaloneJob 2 | 3 | include Sidekiq::Worker 4 | sidekiq_options :queue => :default, :retry => true, :backtrace => true 5 | 6 | def perform(args) 7 | # User.find 10 8 | end 9 | 10 | end -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 5 2 | :pidfile: tmp/pids/sidekiq.pid 3 | development: 4 | :concurrency: 2 5 | production: 6 | :concurrency: 5 7 | :queues: 8 | - default 9 | - [mailers, 2] 10 | :logfile: log/sidekiq.log -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 5 2 | :pidfile: tmp/pids/sidekiq.pid 3 | development: 4 | :concurrency: 2 5 | production: 6 | :concurrency: 5 7 | :queues: 8 | - default 9 | - [mailers, 2] 10 | :logfile: log/sidekiq.log -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/jobs/standalone_job.rb: -------------------------------------------------------------------------------- 1 | class StandaloneJob 2 | 3 | include Sidekiq::Worker 4 | sidekiq_options :queue => :default, :retry => true, :backtrace => true 5 | 6 | def perform(args) 7 | # User.find 10 8 | end 9 | 10 | end -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 5 2 | :pidfile: tmp/pids/sidekiq.pid 3 | development: 4 | :concurrency: 2 5 | production: 6 | :concurrency: 5 7 | :queues: 8 | - default 9 | - [mailers, 2] 10 | :logfile: log/sidekiq.log -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/jobs/standalone_job.rb: -------------------------------------------------------------------------------- 1 | class StandaloneJob 2 | 3 | include Sidekiq::Worker 4 | sidekiq_options :queue => :default, :retry => true, :backtrace => true 5 | 6 | def perform(args) 7 | # User.find 10 8 | end 9 | 10 | end -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/javascripts/posts.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get users_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/assets/javascripts/sessions.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get users_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/assets/javascripts/sessions.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get users_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/assets/javascripts/sessions.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get users_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get users_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/jobs/standalone_job.rb: -------------------------------------------------------------------------------- 1 | class StandaloneJob 2 | 3 | include Sidekiq::Worker 4 | sidekiq_options :queue => :default, :retry => true, :backtrace => true 5 | 6 | def perform(args) 7 | # User.find 10 8 | end 9 | 10 | end -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get users_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/javascripts/sessions.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/db/migrate/20170728031037_create_posts.rb: -------------------------------------------------------------------------------- 1 | class CreatePosts < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :posts do |t| 4 | t.string :title 5 | t.belongs_to :user 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get sessions_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get sessions_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get sessions_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/assets/javascripts/sessions.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/lib/reaper/job/fetcher.rb: -------------------------------------------------------------------------------- 1 | require 'reaper/job/base' 2 | 3 | module Reaper 4 | module Job 5 | class Fetcher < Base 6 | 7 | def do_run 8 | sleep 1 9 | puts "Fetcher done!" 10 | end 11 | end 12 | 13 | end 14 | end -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/assets/javascripts/sessions.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get sessions_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get welcome_index_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get welcome_index_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get users_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get welcome_index_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get welcome_index_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get sessions_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get welcome_index_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get users_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/lib/reaper/job/uploader.rb: -------------------------------------------------------------------------------- 1 | require 'reaper/job/base' 2 | 3 | module Reaper 4 | module Job 5 | class Uploader < Base 6 | 7 | def do_run 8 | sleep 2 9 | puts "Uploader done!" 10 | end 11 | 12 | end 13 | end 14 | end -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get sessions_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get welcome_index_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/assets/javascripts/sessions.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/assets/javascripts/sessions.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get users_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/assets/javascripts/sessions.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://ruby.taobao.org/ 3 | specs: 4 | eventmachine (1.2.0.1) 5 | logger (1.2.8) 6 | 7 | PLATFORMS 8 | ruby 9 | 10 | DEPENDENCIES 11 | eventmachine (>= 1.2.0) 12 | logger 13 | 14 | BUNDLED WITH 15 | 1.13.6 16 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get sessions_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get welcome_index_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/assets/javascripts/sessions.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get users_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get sessions_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get welcome_index_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/db/migrate/20170728040853_create_user_roles.rb: -------------------------------------------------------------------------------- 1 | class CreateUserRoles < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :user_roles do |t| 4 | t.belongs_to :user 5 | t.belongs_to :role 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get sessions_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get welcome_index_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get new" do 5 | get sessions_new_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get welcome_index_url 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | require 'sidekiq/web' 4 | mount Sidekiq::Web => '/sidekiq-stat' 5 | 6 | root 'welcome#index' 7 | 8 | resources :sessions 9 | resources :users 10 | delete '/logout' => 'sessions#destroy', as: :logout 11 | 12 | end 13 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | require 'sidekiq/web' 4 | mount Sidekiq::Web => '/sidekiq-stat' 5 | 6 | root 'welcome#index' 7 | 8 | resources :sessions 9 | resources :users 10 | delete '/logout' => 'sessions#destroy', as: :logout 11 | 12 | end 13 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | require 'sidekiq/web' 4 | mount Sidekiq::Web => '/sidekiq-stat' 5 | 6 | root 'welcome#index' 7 | 8 | resources :sessions 9 | resources :users 10 | delete '/logout' => 'sessions#destroy', as: :logout 11 | 12 | end 13 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/README.md: -------------------------------------------------------------------------------- 1 | # 使用 2 | 3 | ``` 4 | $bundle install # 安装依赖gems 5 | $bin/start -h # 查看启动帮助 6 | 7 | $bin/start -e development -D # 作为一个daemon以开发环境启动 8 | $bin/stop # 关闭进程 9 | $bin/console # 进入项目的console,方便测试 10 | ``` 11 | 12 | #### 文件 13 | 14 | ./run.log 日志文件 15 | ./reaper.pid 进程PID 16 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | require 'sidekiq/web' 4 | mount Sidekiq::Web => '/sidekiq-stat' 5 | 6 | root 'welcome#index' 7 | 8 | resources :sessions 9 | resources :users 10 | delete '/logout' => 'sessions#destroy', as: :logout 11 | 12 | end 13 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | require 'sidekiq/web' 4 | mount Sidekiq::Web => '/sidekiq-stat' 5 | 6 | root 'welcome#index' 7 | 8 | resources :sessions 9 | resources :users 10 | delete '/logout' => 'sessions#destroy', as: :logout 11 | 12 | end 13 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | require 'sidekiq/web' 4 | mount Sidekiq::Web => '/sidekiq-stat' 5 | 6 | root 'welcome#index' 7 | 8 | resources :sessions 9 | resources :users 10 | delete '/logout' => 'sessions#destroy', as: :logout 11 | 12 | end 13 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | require 'sidekiq/web' 4 | mount Sidekiq::Web => '/sidekiq-stat' 5 | 6 | root 'welcome#index' 7 | 8 | resources :sessions 9 | resources :users 10 | delete '/logout' => 'sessions#destroy', as: :logout 11 | 12 | end 13 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/bin/stop: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pid=$(dirname "$0")/../reaper.pid 4 | 5 | if [ ! -f $pid ]; then 6 | echo "Reaper was not running!"; 7 | exit 1 8 | fi 9 | 10 | if [ -z $pid ]; then 11 | echo "Reaper was not running!"; 12 | else 13 | kill `cat $pid` 14 | echo "Reaper quit!" 15 | fi 16 | rm -f $pid -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | resources :posts 4 | 5 | require 'sidekiq/web' 6 | mount Sidekiq::Web => '/sidekiq-stat' 7 | 8 | root 'welcome#index' 9 | 10 | resources :sessions 11 | resources :users 12 | delete '/logout' => 'sessions#destroy', as: :logout 13 | 14 | end 15 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/db/migrate/20161119031113_sorcery_remember_me.rb: -------------------------------------------------------------------------------- 1 | class SorceryRememberMe < ActiveRecord::Migration 2 | def change 3 | add_column :users, :remember_me_token, :string, :default => nil 4 | add_column :users, :remember_me_token_expires_at, :datetime, :default => nil 5 | 6 | add_index :users, :remember_me_token 7 | end 8 | end -------------------------------------------------------------------------------- /01_sorcery/learning_gems/db/migrate/20161119031113_sorcery_remember_me.rb: -------------------------------------------------------------------------------- 1 | class SorceryRememberMe < ActiveRecord::Migration 2 | def change 3 | add_column :users, :remember_me_token, :string, :default => nil 4 | add_column :users, :remember_me_token_expires_at, :datetime, :default => nil 5 | 6 | add_index :users, :remember_me_token 7 | end 8 | end -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/db/migrate/20161119031113_sorcery_remember_me.rb: -------------------------------------------------------------------------------- 1 | class SorceryRememberMe < ActiveRecord::Migration 2 | def change 3 | add_column :users, :remember_me_token, :string, :default => nil 4 | add_column :users, :remember_me_token_expires_at, :datetime, :default => nil 5 | 6 | add_index :users, :remember_me_token 7 | end 8 | end -------------------------------------------------------------------------------- /06_unicorn/learning_gems/db/migrate/20161119031113_sorcery_remember_me.rb: -------------------------------------------------------------------------------- 1 | class SorceryRememberMe < ActiveRecord::Migration 2 | def change 3 | add_column :users, :remember_me_token, :string, :default => nil 4 | add_column :users, :remember_me_token_expires_at, :datetime, :default => nil 5 | 6 | add_index :users, :remember_me_token 7 | end 8 | end -------------------------------------------------------------------------------- /07_capistrano/learning_gems/db/migrate/20161119031113_sorcery_remember_me.rb: -------------------------------------------------------------------------------- 1 | class SorceryRememberMe < ActiveRecord::Migration 2 | def change 3 | add_column :users, :remember_me_token, :string, :default => nil 4 | add_column :users, :remember_me_token_expires_at, :datetime, :default => nil 5 | 6 | add_index :users, :remember_me_token 7 | end 8 | end -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/db/migrate/20161119031113_sorcery_remember_me.rb: -------------------------------------------------------------------------------- 1 | class SorceryRememberMe < ActiveRecord::Migration 2 | def change 3 | add_column :users, :remember_me_token, :string, :default => nil 4 | add_column :users, :remember_me_token_expires_at, :datetime, :default => nil 5 | 6 | add_index :users, :remember_me_token 7 | end 8 | end -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/db/migrate/20161119031113_sorcery_remember_me.rb: -------------------------------------------------------------------------------- 1 | class SorceryRememberMe < ActiveRecord::Migration 2 | def change 3 | add_column :users, :remember_me_token, :string, :default => nil 4 | add_column :users, :remember_me_token_expires_at, :datetime, :default => nil 5 | 6 | add_index :users, :remember_me_token 7 | end 8 | end -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/db/migrate/20161119031113_sorcery_remember_me.rb: -------------------------------------------------------------------------------- 1 | class SorceryRememberMe < ActiveRecord::Migration 2 | def change 3 | add_column :users, :remember_me_token, :string, :default => nil 4 | add_column :users, :remember_me_token_expires_at, :datetime, :default => nil 5 | 6 | add_index :users, :remember_me_token 7 | end 8 | end -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/db/migrate/20161119031113_sorcery_remember_me.rb: -------------------------------------------------------------------------------- 1 | class SorceryRememberMe < ActiveRecord::Migration 2 | def change 3 | add_column :users, :remember_me_token, :string, :default => nil 4 | add_column :users, :remember_me_token_expires_at, :datetime, :default => nil 5 | 6 | add_index :users, :remember_me_token 7 | end 8 | end -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/db/migrate/20161119031113_sorcery_remember_me.rb: -------------------------------------------------------------------------------- 1 | class SorceryRememberMe < ActiveRecord::Migration 2 | def change 3 | add_column :users, :remember_me_token, :string, :default => nil 4 | add_column :users, :remember_me_token_expires_at, :datetime, :default => nil 5 | 6 | add_index :users, :remember_me_token 7 | end 8 | end -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/bin/start: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # Usage: 4 | # start -h 5 | # 6 | 7 | pid = File.expand_path('../../reaper.pid', __FILE__) 8 | if File.exists?(pid) 9 | print "Reaper is already running!(PID: #{File.read(pid).chomp})\n" 10 | else 11 | $: << File.expand_path('../../lib', __FILE__) 12 | 13 | require 'reaper' 14 | Reaper.main 15 | end -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/controllers/posts_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PostsControllerTest < ActionDispatch::IntegrationTest 4 | test "should get index" do 5 | get posts_index_url 6 | assert_response :success 7 | end 8 | 9 | test "should get show" do 10 | get posts_show_url 11 | assert_response :success 12 | end 13 | 14 | end 15 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /08_capistrano_with_unicorn/learning_gems/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /09_deploy_using_a_shell_script/learning_gems/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /01_sorcery/learning_gems/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /06_unicorn/learning_gems/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /07_capistrano/learning_gems/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /14_pundit/learning_gems/db/migrate/20161119031112_sorcery_core.rb: -------------------------------------------------------------------------------- 1 | class SorceryCore < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :username, :address 5 | t.string :email, :null => false 6 | t.string :crypted_password 7 | t.string :salt 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :users, :email, unique: true 13 | end 14 | end -------------------------------------------------------------------------------- /01_sorcery/learning_gems/db/migrate/20161119031112_sorcery_core.rb: -------------------------------------------------------------------------------- 1 | class SorceryCore < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :username, :address 5 | t.string :email, :null => false 6 | t.string :crypted_password 7 | t.string :salt 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :users, :email, unique: true 13 | end 14 | end -------------------------------------------------------------------------------- /01_sorcery/learning_gems/db/migrate/20161119031115_sorcery_user_activation.rb: -------------------------------------------------------------------------------- 1 | class SorceryUserActivation < ActiveRecord::Migration 2 | def change 3 | add_column :users, :activation_state, :string, :default => nil 4 | add_column :users, :activation_token, :string, :default => nil 5 | add_column :users, :activation_token_expires_at, :datetime, :default => nil 6 | 7 | add_index :users, :activation_token 8 | end 9 | end -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/db/migrate/20161119031112_sorcery_core.rb: -------------------------------------------------------------------------------- 1 | class SorceryCore < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :username, :address 5 | t.string :email, :null => false 6 | t.string :crypted_password 7 | t.string :salt 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :users, :email, unique: true 13 | end 14 | end -------------------------------------------------------------------------------- /04_sidekiq/learning_gems/db/migrate/20161119031115_sorcery_user_activation.rb: -------------------------------------------------------------------------------- 1 | class SorceryUserActivation < ActiveRecord::Migration 2 | def change 3 | add_column :users, :activation_state, :string, :default => nil 4 | add_column :users, :activation_token, :string, :default => nil 5 | add_column :users, :activation_token_expires_at, :datetime, :default => nil 6 | 7 | add_index :users, :activation_token 8 | end 9 | end -------------------------------------------------------------------------------- /06_unicorn/learning_gems/db/migrate/20161119031112_sorcery_core.rb: -------------------------------------------------------------------------------- 1 | class SorceryCore < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :username, :address 5 | t.string :email, :null => false 6 | t.string :crypted_password 7 | t.string :salt 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :users, :email, unique: true 13 | end 14 | end -------------------------------------------------------------------------------- /06_unicorn/learning_gems/db/migrate/20161119031115_sorcery_user_activation.rb: -------------------------------------------------------------------------------- 1 | class SorceryUserActivation < ActiveRecord::Migration 2 | def change 3 | add_column :users, :activation_state, :string, :default => nil 4 | add_column :users, :activation_token, :string, :default => nil 5 | add_column :users, :activation_token_expires_at, :datetime, :default => nil 6 | 7 | add_index :users, :activation_token 8 | end 9 | end -------------------------------------------------------------------------------- /07_capistrano/learning_gems/db/migrate/20161119031112_sorcery_core.rb: -------------------------------------------------------------------------------- 1 | class SorceryCore < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :username, :address 5 | t.string :email, :null => false 6 | t.string :crypted_password 7 | t.string :salt 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :users, :email, unique: true 13 | end 14 | end -------------------------------------------------------------------------------- /07_capistrano/learning_gems/db/migrate/20161119031115_sorcery_user_activation.rb: -------------------------------------------------------------------------------- 1 | class SorceryUserActivation < ActiveRecord::Migration 2 | def change 3 | add_column :users, :activation_state, :string, :default => nil 4 | add_column :users, :activation_token, :string, :default => nil 5 | add_column :users, :activation_token_expires_at, :datetime, :default => nil 6 | 7 | add_index :users, :activation_token 8 | end 9 | end -------------------------------------------------------------------------------- /12_eventmachine_reaper/reaper/lib/reaper/config.rb: -------------------------------------------------------------------------------- 1 | require 'yaml' 2 | 3 | module Reaper 4 | class Config 5 | 6 | attr_accessor :env, :configuration, :pid_file 7 | 8 | def initialize opts = {} 9 | self.env = opts[:env] 10 | 11 | config_file = File.expand_path('../../../config.yml', __FILE__) 12 | self.configuration = YAML.load_file(config_file)[self.env] 13 | end 14 | 15 | end 16 | 17 | end -------------------------------------------------------------------------------- /13_sassc_rails/learning_gems/db/migrate/20161119031112_sorcery_core.rb: -------------------------------------------------------------------------------- 1 | class SorceryCore < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :username, :address 5 | t.string :email, :null => false 6 | t.string :crypted_password 7 | t.string :salt 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :users, :email, unique: true 13 | end 14 | end -------------------------------------------------------------------------------- /14_pundit/learning_gems/db/migrate/20161119031115_sorcery_user_activation.rb: -------------------------------------------------------------------------------- 1 | class SorceryUserActivation < ActiveRecord::Migration 2 | def change 3 | add_column :users, :activation_state, :string, :default => nil 4 | add_column :users, :activation_token, :string, :default => nil 5 | add_column :users, :activation_token_expires_at, :datetime, :default => nil 6 | 7 | add_index :users, :activation_token 8 | end 9 | end -------------------------------------------------------------------------------- /03_bootstrap_fontawesome/learning_gems/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /10_unicorn_worker_killer/learning_gems/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | --------------------------------------------------------------------------------