Skip to content

Commit 6df1f31

Browse files
committed
セットアップ
0 parents  commit 6df1f31

File tree

6 files changed

+293
-0
lines changed

6 files changed

+293
-0
lines changed

.dockerignore

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### OSX template
3+
.DS_Store
4+
.AppleDouble
5+
.LSOverride
6+
7+
# Icon must end with two \r
8+
Icon
9+
10+
# Thumbnails
11+
._*
12+
13+
# Files that might appear in the root of a volume
14+
.DocumentRevisions-V100
15+
.fseventsd
16+
.Spotlight-V100
17+
.TemporaryItems
18+
.Trashes
19+
.VolumeIcon.icns
20+
21+
# Directories potentially created on remote AFP share
22+
.AppleDB
23+
.AppleDesktop
24+
Network Trash Folder
25+
Temporary Items
26+
.apdisk
27+
### JetBrains template
28+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
29+
30+
*.iml
31+
32+
## Directory-based project format:
33+
.idea/
34+
# if you remove the above rule, at least ignore the following:
35+
36+
# User-specific stuff:
37+
# .idea/workspace.xml
38+
# .idea/tasks.xml
39+
# .idea/dictionaries
40+
41+
# Sensitive or high-churn files:
42+
# .idea/dataSources.ids
43+
# .idea/dataSources.xml
44+
# .idea/sqlDataSources.xml
45+
# .idea/dynamic.xml
46+
# .idea/uiDesigner.xml
47+
48+
# Gradle:
49+
# .idea/gradle.xml
50+
# .idea/libraries
51+
52+
# Mongo Explorer plugin:
53+
# .idea/mongoSettings.xml
54+
55+
## File-based project format:
56+
*.ipr
57+
*.iws
58+
59+
## Plugin-specific files:
60+
61+
# IntelliJ
62+
/out/
63+
64+
# mpeltonen/sbt-idea plugin
65+
.idea_modules/
66+
67+
# JIRA plugin
68+
atlassian-ide-plugin.xml
69+
70+
# Crashlytics plugin (for Android Studio and IntelliJ)
71+
com_crashlytics_export_strings.xml
72+
crashlytics.properties
73+
crashlytics-build.properties
74+
### Vagrant template
75+
.vagrant/
76+
Vagrantfile
77+
78+
### Git
79+
.git/
80+
.gitignore
81+
82+
### Docker
83+
#Dockerfile
84+
.dockerignore
85+

.gitignore

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### OSX template
3+
.DS_Store
4+
.AppleDouble
5+
.LSOverride
6+
7+
# Icon must end with two \r
8+
Icon
9+
10+
# Thumbnails
11+
._*
12+
13+
# Files that might appear in the root of a volume
14+
.DocumentRevisions-V100
15+
.fseventsd
16+
.Spotlight-V100
17+
.TemporaryItems
18+
.Trashes
19+
.VolumeIcon.icns
20+
21+
# Directories potentially created on remote AFP share
22+
.AppleDB
23+
.AppleDesktop
24+
Network Trash Folder
25+
Temporary Items
26+
.apdisk
27+
### JetBrains template
28+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
29+
30+
*.iml
31+
32+
## Directory-based project format:
33+
.idea/
34+
# if you remove the above rule, at least ignore the following:
35+
36+
# User-specific stuff:
37+
# .idea/workspace.xml
38+
# .idea/tasks.xml
39+
# .idea/dictionaries
40+
41+
# Sensitive or high-churn files:
42+
# .idea/dataSources.ids
43+
# .idea/dataSources.xml
44+
# .idea/sqlDataSources.xml
45+
# .idea/dynamic.xml
46+
# .idea/uiDesigner.xml
47+
48+
# Gradle:
49+
# .idea/gradle.xml
50+
# .idea/libraries
51+
52+
# Mongo Explorer plugin:
53+
# .idea/mongoSettings.xml
54+
55+
## File-based project format:
56+
*.ipr
57+
*.iws
58+
59+
## Plugin-specific files:
60+
61+
# IntelliJ
62+
/out/
63+
64+
# mpeltonen/sbt-idea plugin
65+
.idea_modules/
66+
67+
# JIRA plugin
68+
atlassian-ide-plugin.xml
69+
70+
# Crashlytics plugin (for Android Studio and IntelliJ)
71+
com_crashlytics_export_strings.xml
72+
crashlytics.properties
73+
crashlytics-build.properties
74+
### Ruby template
75+
*.gem
76+
*.rbc
77+
/.config
78+
/coverage/
79+
/InstalledFiles
80+
/pkg/
81+
/spec/reports/
82+
/spec/examples.txt
83+
/test/tmp/
84+
/test/version_tmp/
85+
/tmp/
86+
87+
## Specific to RubyMotion:
88+
.dat*
89+
.repl_history
90+
build/
91+
92+
## Documentation cache and generated files:
93+
/.yardoc/
94+
/_yardoc/
95+
/doc/
96+
/rdoc/
97+
98+
## Environment normalisation:
99+
/.bundle/
100+
/vendor/bundle
101+
/lib/bundler/man/
102+
103+
# for a library or gem, you might want to ignore these files since the code is
104+
# intended to run in multiple environments; otherwise, check them in:
105+
# Gemfile.lock
106+
# .ruby-version
107+
# .ruby-gemset
108+
109+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
110+
.rvmrc
111+
### Vagrant template
112+
.vagrant/
113+

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM ruby:2.2.1
2+
3+
MAINTAINER hiroshima-arc
4+
5+
RUN apt-get update -y && apt-get install -y \
6+
sqlite3 \
7+
curl
8+
9+
RUN gem install bundler rack
10+
11+
WORKDIR /app
12+
13+
VOLUME /app
14+
15+
EXPOSE 9292
16+
17+
ENTRYPOINT ["/bin/bash"]
18+

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
RubyWebアプリケーション開発
2+
===================
3+
4+
# 目的 #
5+
パーフェクトRubyのPart5 Webアプリケーション開発を教材にRubyの勉強をする
6+
7+
# 前提 #
8+
| ソフトウェア | バージョン | 備考 |
9+
|:---------------|:-------------|:------------|
10+
| ruby |2.2.1-p85 | |
11+
| vagrant |1.7.4 | |
12+
| docker |1.9.1 | |
13+
14+
# 構成 #
15+
## 環境セットアップ
16+
17+
### Vagarnt
18+
19+
$ vagrant up
20+
$ vagrant ssh
21+
$ cd /vagrant
22+
23+
### Docker
24+
25+
$ docker build --no-cache=true --rm -t hiroshima-arc/ruby-webapp .
26+
$ docker run -it -v $(pwd):/app -p 9292:9292 --name app hiroshima-arc/ruby-webapp
27+
$ rackup -o 0.0.0.0
28+
29+
## Webアプリケーション開発
30+
31+
### Webインターフェースの追加
32+
33+
### 再びtodoコマンド
34+
35+
### Todoアプリケーション2.0.0の完成
36+
37+
# 参照 #
38+
39+
+ [パーフェクトRuby](http://www.amazon.co.jp/%E3%83%91%E3%83%BC%E3%83%95%E3%82%A7%E3%82%AF%E3%83%88Ruby-PERFECT-SERIES-6-Ruby%E3%82%B5%E3%83%9D%E3%83%BC%E3%82%BF%E3%83%BC%E3%82%BA/dp/4774158798)

Vagrantfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5+
VAGRANTFILE_API_VERSION = "2"
6+
7+
# Vagrantのmountエラーを解決しようとしたらvboxのリビルドがこける
8+
# http://qiita.com/wakaba260/items/b5c87b7815b710f303a0
9+
script = <<SCRIPT
10+
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null
11+
SCRIPT
12+
13+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
14+
config.vm.provision "shell", inline: script
15+
config.vm.hostname = "hiroshima-arc-ruby-webapp"
16+
config.vm.box = "hiroshima-arc/ruby-study-env"
17+
config.vm.network "forwarded_port", guest: 9292, host: 9292
18+
config.vm.synced_folder ".", "/vagrant", disabled: false
19+
20+
config.vm.provider "virtualbox" do |vb|
21+
vb.gui = false
22+
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
23+
24+
# Use VBoxManage to customize the VM. For example to change memory:
25+
vb.customize ["modifyvm", :id, "--memory", "2024"]
26+
vb.customize ["modifyvm", :id, "--vram", "128"]
27+
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
28+
end
29+
end

config.ru

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require 'rack'
2+
3+
class RackApplication
4+
def call(env)
5+
[200, {'Content-Type' => 'text/plain'},['Hello!']]
6+
end
7+
end
8+
9+
run RackApplication.new

0 commit comments

Comments
 (0)