Skip to content

Commit b4cf7ec

Browse files
committed
2章のサンプルアプリのコードを追加
1 parent 63c7a8b commit b4cf7ec

File tree

103 files changed

+2311
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+2311
-0
lines changed

2章/.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore the default SQLite database.
11+
/db/*.sqlite3
12+
/db/*.sqlite3-journal
13+
14+
# Ignore all logfiles and tempfiles.
15+
/log/*
16+
/tmp/*
17+
!/log/.keep
18+
!/tmp/.keep
19+
20+
# Ignore uploaded files in development
21+
/storage/*
22+
!/storage/.keep
23+
24+
/node_modules
25+
/yarn-error.log
26+
27+
/public/assets
28+
.byebug_history
29+
30+
# Ignore master key for decrypting credentials and more.
31+
/config/master.key

2章/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.5.1

2章/Gemfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
source 'https://rubygems.org'
2+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3+
4+
ruby '2.5.1'
5+
6+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7+
gem 'rails', '~> 5.2.3'
8+
# Use sqlite3 as the database for Active Record
9+
gem 'sqlite3', '~> 1.4.1' # Rails 5.2.3より前のバージョンに配慮してバージョンを指定する。
10+
# Use Puma as the app server
11+
gem 'puma', '~> 3.11'
12+
# Use SCSS for stylesheets
13+
gem 'sass-rails', '~> 5.0'
14+
# Use Uglifier as compressor for JavaScript assets
15+
gem 'uglifier', '>= 1.3.0'
16+
# See https://github.com/rails/execjs#readme for more supported runtimes
17+
# gem 'mini_racer', platforms: :ruby
18+
19+
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
20+
gem 'turbolinks', '~> 5'
21+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22+
# gem 'jbuilder', '~> 2.5'
23+
# Use Redis adapter to run Action Cable in production
24+
# gem 'redis', '~> 4.0'
25+
# Use ActiveModel has_secure_password
26+
# gem 'bcrypt', '~> 3.1.7'
27+
28+
# Use ActiveStorage variant
29+
# gem 'mini_magick', '~> 4.8'
30+
31+
# Use Capistrano for deployment
32+
# gem 'capistrano-rails', group: :development
33+
34+
# Reduces boot times through caching; required in config/boot.rb
35+
gem 'bootsnap', '>= 1.1.0', require: false
36+
37+
group :development, :test do
38+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
39+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
40+
end
41+
42+
group :development do
43+
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
44+
gem 'web-console', '>= 3.3.0'
45+
gem 'listen', '>= 3.0.5', '< 3.2'
46+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
47+
gem 'spring'
48+
gem 'spring-watcher-listen', '~> 2.0.0'
49+
end
50+
51+
52+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
53+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

2章/Gemfile.lock

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
actioncable (5.2.3)
5+
actionpack (= 5.2.3)
6+
nio4r (~> 2.0)
7+
websocket-driver (>= 0.6.1)
8+
actionmailer (5.2.3)
9+
actionpack (= 5.2.3)
10+
actionview (= 5.2.3)
11+
activejob (= 5.2.3)
12+
mail (~> 2.5, >= 2.5.4)
13+
rails-dom-testing (~> 2.0)
14+
actionpack (5.2.3)
15+
actionview (= 5.2.3)
16+
activesupport (= 5.2.3)
17+
rack (~> 2.0)
18+
rack-test (>= 0.6.3)
19+
rails-dom-testing (~> 2.0)
20+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
21+
actionview (5.2.3)
22+
activesupport (= 5.2.3)
23+
builder (~> 3.1)
24+
erubi (~> 1.4)
25+
rails-dom-testing (~> 2.0)
26+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
27+
activejob (5.2.3)
28+
activesupport (= 5.2.3)
29+
globalid (>= 0.3.6)
30+
activemodel (5.2.3)
31+
activesupport (= 5.2.3)
32+
activerecord (5.2.3)
33+
activemodel (= 5.2.3)
34+
activesupport (= 5.2.3)
35+
arel (>= 9.0)
36+
activestorage (5.2.3)
37+
actionpack (= 5.2.3)
38+
activerecord (= 5.2.3)
39+
marcel (~> 0.3.1)
40+
activesupport (5.2.3)
41+
concurrent-ruby (~> 1.0, >= 1.0.2)
42+
i18n (>= 0.7, < 2)
43+
minitest (~> 5.1)
44+
tzinfo (~> 1.1)
45+
arel (9.0.0)
46+
bindex (0.8.1)
47+
bootsnap (1.4.4)
48+
msgpack (~> 1.0)
49+
builder (3.2.3)
50+
byebug (11.0.1)
51+
concurrent-ruby (1.1.5)
52+
crass (1.0.4)
53+
erubi (1.8.0)
54+
execjs (2.7.0)
55+
ffi (1.11.1)
56+
globalid (0.4.2)
57+
activesupport (>= 4.2.0)
58+
i18n (1.6.0)
59+
concurrent-ruby (~> 1.0)
60+
listen (3.1.5)
61+
rb-fsevent (~> 0.9, >= 0.9.4)
62+
rb-inotify (~> 0.9, >= 0.9.7)
63+
ruby_dep (~> 1.2)
64+
loofah (2.2.3)
65+
crass (~> 1.0.2)
66+
nokogiri (>= 1.5.9)
67+
mail (2.7.1)
68+
mini_mime (>= 0.1.1)
69+
marcel (0.3.3)
70+
mimemagic (~> 0.3.2)
71+
method_source (0.9.2)
72+
mimemagic (0.3.3)
73+
mini_mime (1.0.2)
74+
mini_portile2 (2.4.0)
75+
minitest (5.11.3)
76+
msgpack (1.3.0)
77+
nio4r (2.4.0)
78+
nokogiri (1.10.3)
79+
mini_portile2 (~> 2.4.0)
80+
puma (3.12.1)
81+
rack (2.0.7)
82+
rack-test (1.1.0)
83+
rack (>= 1.0, < 3)
84+
rails (5.2.3)
85+
actioncable (= 5.2.3)
86+
actionmailer (= 5.2.3)
87+
actionpack (= 5.2.3)
88+
actionview (= 5.2.3)
89+
activejob (= 5.2.3)
90+
activemodel (= 5.2.3)
91+
activerecord (= 5.2.3)
92+
activestorage (= 5.2.3)
93+
activesupport (= 5.2.3)
94+
bundler (>= 1.3.0)
95+
railties (= 5.2.3)
96+
sprockets-rails (>= 2.0.0)
97+
rails-dom-testing (2.0.3)
98+
activesupport (>= 4.2.0)
99+
nokogiri (>= 1.6)
100+
rails-html-sanitizer (1.0.4)
101+
loofah (~> 2.2, >= 2.2.2)
102+
railties (5.2.3)
103+
actionpack (= 5.2.3)
104+
activesupport (= 5.2.3)
105+
method_source
106+
rake (>= 0.8.7)
107+
thor (>= 0.19.0, < 2.0)
108+
rake (12.3.3)
109+
rb-fsevent (0.10.3)
110+
rb-inotify (0.10.0)
111+
ffi (~> 1.0)
112+
ruby_dep (1.5.0)
113+
sass (3.7.4)
114+
sass-listen (~> 4.0.0)
115+
sass-listen (4.0.0)
116+
rb-fsevent (~> 0.9, >= 0.9.4)
117+
rb-inotify (~> 0.9, >= 0.9.7)
118+
sass-rails (5.0.7)
119+
railties (>= 4.0.0, < 6)
120+
sass (~> 3.1)
121+
sprockets (>= 2.8, < 4.0)
122+
sprockets-rails (>= 2.0, < 4.0)
123+
tilt (>= 1.1, < 3)
124+
spring (2.1.0)
125+
spring-watcher-listen (2.0.1)
126+
listen (>= 2.7, < 4.0)
127+
spring (>= 1.2, < 3.0)
128+
sprockets (3.7.2)
129+
concurrent-ruby (~> 1.0)
130+
rack (> 1, < 3)
131+
sprockets-rails (3.2.1)
132+
actionpack (>= 4.0)
133+
activesupport (>= 4.0)
134+
sprockets (>= 3.0.0)
135+
sqlite3 (1.4.1)
136+
thor (0.20.3)
137+
thread_safe (0.3.6)
138+
tilt (2.0.9)
139+
turbolinks (5.2.0)
140+
turbolinks-source (~> 5.2)
141+
turbolinks-source (5.2.0)
142+
tzinfo (1.2.5)
143+
thread_safe (~> 0.1)
144+
uglifier (4.1.20)
145+
execjs (>= 0.3.0, < 3)
146+
web-console (3.7.0)
147+
actionview (>= 5.0)
148+
activemodel (>= 5.0)
149+
bindex (>= 0.4.0)
150+
railties (>= 5.0)
151+
websocket-driver (0.7.1)
152+
websocket-extensions (>= 0.1.0)
153+
websocket-extensions (0.1.4)
154+
155+
PLATFORMS
156+
ruby
157+
158+
DEPENDENCIES
159+
bootsnap (>= 1.1.0)
160+
byebug
161+
listen (>= 3.0.5, < 3.2)
162+
puma (~> 3.11)
163+
rails (~> 5.2.3)
164+
sass-rails (~> 5.0)
165+
spring
166+
spring-watcher-listen (~> 2.0.0)
167+
sqlite3 (~> 1.4.1)
168+
turbolinks (~> 5)
169+
tzinfo-data
170+
uglifier (>= 1.3.0)
171+
web-console (>= 3.3.0)
172+
173+
RUBY VERSION
174+
ruby 2.5.1p57
175+
176+
BUNDLED WITH
177+
2.0.2

2章/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# README
2+
3+
This README would normally document whatever steps are necessary to get the
4+
application up and running.
5+
6+
Things you may want to cover:
7+
8+
* Ruby version
9+
10+
* System dependencies
11+
12+
* Configuration
13+
14+
* Database creation
15+
16+
* Database initialization
17+
18+
* How to run the test suite
19+
20+
* Services (job queues, cache servers, search engines, etc.)
21+
22+
* Deployment instructions
23+
24+
* ...

2章/Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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

2章/app/assets/config/manifest.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//= link_tree ../images
2+
//= link_directory ../javascripts .js
3+
//= link_directory ../stylesheets .css

2章/app/assets/images/.keep

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
5+
// vendor/assets/javascripts directory can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
9+
//
10+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require rails-ujs
14+
//= require activestorage
15+
//= require turbolinks
16+
//= require_tree .

2章/app/assets/javascripts/cable.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Action Cable provides the framework to deal with WebSockets in Rails.
2+
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
3+
//
4+
//= require action_cable
5+
//= require_self
6+
//= require_tree ./channels
7+
8+
(function() {
9+
this.App || (this.App = {});
10+
11+
App.cable = ActionCable.createConsumer();
12+
13+
}).call(this);

2章/app/assets/javascripts/channels/.keep

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Place all the behaviors and hooks related to the matching controller here.
2+
// All this logic will automatically be available in application.js.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Place all the behaviors and hooks related to the matching controller here.
2+
// All this logic will automatically be available in application.js.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* This is a manifest file that'll be compiled into application.css, which will include all the files
3+
* listed below.
4+
*
5+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
7+
*
8+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10+
* files in this directory. Styles in this file should be added after the last require_* statement.
11+
* It is generally better to create a new file per style scope.
12+
*
13+
*= require_tree .
14+
*= require_self
15+
*/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place all the styles related to the food_enquetes controller here.
2+
// They will automatically be included in application.css.
3+
// You can use Sass (SCSS) here: http://sass-lang.com/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place all the styles related to the gym_enquetes controller here.
2+
// They will automatically be included in application.css.
3+
// You can use Sass (SCSS) here: http://sass-lang.com/

0 commit comments

Comments
 (0)