Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webテキストに合わせて 7.0 を Codespaces に対応させました #85

Merged
merged 8 commits into from
Feb 9, 2024
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
  •  
  •  
  •  
82 changes: 82 additions & 0 deletions 7_0/ch01/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// 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": "gem install solargraph -v '0.50.0' -N",
//"onCreateCommand": "",
//# => 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/vscode-ruby-lsp
"castwide.solargraph" // https://github.com/castwide/vscode-solargraph
],
"settings": {
// Use Ctrl+Shift+P->Format to format.
//"ruby.useLanguageServer": true ,
//"ruby.format": "rubocop",
//"ruby.lint": { "rubocop": true },
//"ruby.intellisense": "rubyLocate",
"editor.tabSize": 2,
"editor.renderWhitespace": false,
"files.associations": { "*.erb": "erb" },
"emmet.includeLanguages": { "erb": "html" },

// Settings for Solargraph
"solargraph.useBundler": false,
"solargraph.diagnostics": false,
"solargraph.formatting": true,
"solargraph.autoformat": false,
"solargraph.definitions": true,
"solargraph.completion": true,
"solargraph.references": true,
"solargraph.symbols": true,
"solargraph.rename": true,
"solargraph.hover": true
}
}
},
"remoteEnv": {
"EDITOR": "code --wait"
},
"portsAttributes": {
"3000": {
"label": "Application",
"onAutoForward": "openPreview"
}
},
"forwardPorts": [3000]
}
1 change: 1 addition & 0 deletions 7_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.
2 changes: 2 additions & 0 deletions 7_0/ch01/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +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
15 changes: 15 additions & 0 deletions 7_0/ch01/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# Ignore bundler config.
/.bundle

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

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
Expand All @@ -18,8 +22,19 @@
!/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 7_0/ch01/.irbrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IRB.conf[:COMPLETOR] = :type # default is :regexp
2 changes: 1 addition & 1 deletion 7_0/ch01/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.2.2
32 changes: 32 additions & 0 deletions 7_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
37 changes: 24 additions & 13 deletions 7_0/ch01/Gemfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gem "rails", "7.0.4"
ruby "3.2.2"

gem "rails", "7.0.4.3"
gem "sassc-rails", "2.1.2"
gem "sprockets-rails", "3.4.2"
gem "importmap-rails", "1.1.0"
gem "turbo-rails", "1.1.1"
gem "stimulus-rails", "1.0.4"
gem "importmap-rails", "1.1.5"
gem "turbo-rails", "1.4.0"
gem "stimulus-rails", "1.2.1"
gem "jbuilder", "2.11.5"
gem "puma", "5.6.4"
gem "bootsnap", "1.12.0", require: false
gem "sqlite3", "1.4.2"
gem "puma", "5.6.8"
gem "bootsnap", "1.16.0", require: false
gem "sqlite3", "1.6.1"

group :development, :test do
gem "debug", "1.5.0", platforms: %i[ mri mingw x64_mingw ]
gem "debug", "1.7.1", platforms: %i[ mri mingw x64_mingw ]
end

group :development do
gem "web-console", "4.2.0"
gem "web-console", "4.2.0"
gem "solargraph", "0.50.0"
gem "irb", "1.10.0"
gem "repl_type_completor", "0.1.2"
end

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

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