Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
105 changes: 105 additions & 0 deletions 8_0/ch01/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// Specifications: https://containers.dev/implementors/json_reference/
// Format details: https://aka.ms/devcontainer.json
// Config options: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/ruby
{
"name": "railstutorial",

// Universal is well-customized image for Codespaces:
// https://hub.docker.com/_/microsoft-devcontainers-universal
//"image": "mcr.microsoft.com/devcontainers/universal:2",
//"features": {
// "ghcr.io/devcontainers/features/ruby:1": {}
//},

// Use Ruby image if you want to pin Ruby version like '3.2'
// https://github.com/devcontainers/images/tree/main/src/ruby
"image": "mcr.microsoft.com/devcontainers/ruby:3.2",
//"workspaceFolder": "/railstutorial", => Container build failed

// Enable learners to choose an affordable spec, starting at minimum one.
//"hostRequirements": {
// "cpus": 2,
// "memory": "4gb",
// "storage": "32gb"
//},

"waitFor": "onCreateCommand",
//"onCreateCommand": "",
"onCreateCommand": "gem install solargraph -v '0.58.2' -N",
//"onCreateCommand": "gem install solargraph -v '0.50.0' -N && gem install ruby-lsp -N",
//"onCreateCommand": "gem install ruby-lsp -N",
//# => Solargraph gem not found. Run `gem install solargraph` or update your Gemfile.
"updateContentCommand": "bundle install",
"postCreateCommand": "",
"postAttachCommand": {
"server": "rails server"
},
"customizations": {
"codespaces": {
"openFiles": [
"app/views/hello/index.html.erb"
]
},
"vscode": {
"extensions": [
"GitHub.codespaces",
"Shopify.ruby-lsp", // https://github.com/Shopify/ruby-lsp
"castwide.solargraph" // https://github.com/castwide/vscode-solargraph
//"rebornix.Ruby", // https://github.com/rubyide/vscode-ruby (Deprecated)

],
"settings": {
// General settings for Codespaces (VS Code)
//"ruby.useLanguageServer": true ,
//"ruby.format": "rubocop",
//"ruby.lint": { "rubocop": true },
//"ruby.intellisense": "rubyLocate",
"editor.tabSize": 2,
"editor.formatOnSave": false, // Disable onSave to show diff edited by learners only
"editor.formatOnType": false, // Disable onType for the same reason above
"editor.insertSpaces": true, // Use spaces, not tabs, to avoid errors for learners
"editor.renderWhitespace": "none",
"[ruby]": {
"editor.defaultFormatter": "castwide.solargraph",
"editor.semanticHighlighting.enabled": true // Enable semantic highlighting
},
"files.associations": { "*.erb": "erb" },
"emmet.includeLanguages": { "erb": "html" },

// Settings for Solargraph
// https://github.com/castwide/solargraph
"solargraph.useBundler": false,
"solargraph.diagnostics": false,
"solargraph.formatting": true, // Use Ctrl+Shift+P->Format to format
"solargraph.autoformat": false,
"solargraph.definitions": true,
"solargraph.completion": true,
"solargraph.references": true,
"solargraph.symbols": true,
"solargraph.rename": true,
"solargraph.hover": true,

// Settings for Ruby LSP
// https://github.com/Shopify/ruby-lsp
"rubyLsp.rubyVersionManager": {
"identifier": "none"
},
"rubyLsp.formatter": "none",
"rubyLsp.enabledFeatures": {
"diagnostics": false,
"formatting": false
}
}
}
},
"remoteEnv": {
"EDITOR": "code --wait"
},
"portsAttributes": {
"3000": {
"label": "Application",
"onAutoForward": "openPreview"
}
},
"forwardPorts": [3000]
}
1 change: 1 addition & 0 deletions 8_0/ch01/.devcontainer/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions 8_0/ch01/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
40 changes: 40 additions & 0 deletions 8_0/ch01/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-*

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

/public/assets

# Ignore master key for decrypting credentials and more.
/config/master.key

# Ignore history file used by IRB for interactive Ruby.
.irb_history

dump.rdb
1 change: 1 addition & 0 deletions 8_0/ch01/.irbrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IRB.conf[:COMPLETOR] = :type # default is :regexp
32 changes: 32 additions & 0 deletions 8_0/ch01/.solargraph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
include:
- "**/*.rb"
exclude:
- spec/**/*
- test/**/*
- vendor/**/*
- ".bundle/**/*"
require:
- actioncable
- actionmailer
- actionpack
- actionview
- activejob
- activemodel
- activerecord
- activestorage
- activesupport
domains: []
reporters:
- rubocop
- require_not_found
- typecheck
formatter:
rubocop:
cops: safe
except: []
only: []
extra_args: []
require_paths: []
plugins: []
max_files: 5000
3 changes: 3 additions & 0 deletions 8_0/ch01/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.minimap.enabled": false
}
42 changes: 42 additions & 0 deletions 8_0/ch01/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.2.10'

gem 'bootsnap', '1.16.0', require: false
gem 'concurrent-ruby', '1.3.4'
gem 'importmap-rails', '1.1.5'
gem 'jbuilder', '2.14.1'
gem 'puma', '6.6.1'
gem 'rails', '8.0.2.1'
gem 'sassc-rails', '2.1.2'
gem 'sprockets-rails', '3.4.2'
gem 'sqlite3', '2.7.3'
gem 'stimulus-rails', '1.2.1'
gem 'turbo-rails', '1.4.0'

group :development, :test do
gem 'debug', '1.7.1', platforms: %i[mri mingw x64_mingw]
gem 'reline', '0.5.10'
end

group :development do
gem 'irb', '1.15.2'
gem 'repl_type_completor', '0.1.10'
gem 'solargraph', '0.58.2'
gem 'web-console', '4.2.0'
end

group :test do
gem 'capybara', '3.38.0'
gem 'guard', '2.18.0'
gem 'guard-minitest', '2.4.6'
gem 'minitest', '5.18.0'
gem 'minitest-reporters', '1.6.0'
gem 'rails-controller-testing', '1.0.5'
gem 'selenium-webdriver', '4.8.3'
gem 'webdrivers', '5.2.0'
end

# Windows ではタイムゾーン情報用の tzinfo-data gem を含める必要があります
# gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
Loading