Skip to content

Commit

Permalink
セットアップ
Browse files Browse the repository at this point in the history
  • Loading branch information
k2works committed Dec 5, 2015
0 parents commit 6df1f31
Show file tree
Hide file tree
Showing 6 changed files with 293 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Created by .ignore support plugin (hsz.mobi)
### OSX template
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
### Vagrant template
.vagrant/
Vagrantfile

### Git
.git/
.gitignore

### Docker
#Dockerfile
.dockerignore

113 changes: 113 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Created by .ignore support plugin (hsz.mobi)
### OSX template
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
### Ruby template
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

## Specific to RubyMotion:
.dat*
.repl_history
build/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalisation:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
### Vagrant template
.vagrant/

18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ruby:2.2.1

MAINTAINER hiroshima-arc

RUN apt-get update -y && apt-get install -y \
sqlite3 \
curl

RUN gem install bundler rack

WORKDIR /app

VOLUME /app

EXPOSE 9292

ENTRYPOINT ["/bin/bash"]

39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
RubyWebアプリケーション開発
===================

# 目的 #
パーフェクトRubyのPart5 Webアプリケーション開発を教材にRubyの勉強をする

# 前提 #
| ソフトウェア | バージョン | 備考 |
|:---------------|:-------------|:------------|
| ruby |2.2.1-p85 | |
| vagrant |1.7.4 | |
| docker |1.9.1 | |

# 構成 #
## 環境セットアップ

### Vagarnt

$ vagrant up
$ vagrant ssh
$ cd /vagrant

### Docker

$ docker build --no-cache=true --rm -t hiroshima-arc/ruby-webapp .
$ docker run -it -v $(pwd):/app -p 9292:9292 --name app hiroshima-arc/ruby-webapp
$ rackup -o 0.0.0.0

## Webアプリケーション開発

### Webインターフェースの追加

### 再びtodoコマンド

### Todoアプリケーション2.0.0の完成

# 参照 #

+ [パーフェクト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)
29 changes: 29 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

# Vagrantのmountエラーを解決しようとしたらvboxのリビルドがこける
# http://qiita.com/wakaba260/items/b5c87b7815b710f303a0
script = <<SCRIPT
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null
SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision "shell", inline: script
config.vm.hostname = "hiroshima-arc-ruby-webapp"
config.vm.box = "hiroshima-arc/ruby-study-env"
config.vm.network "forwarded_port", guest: 9292, host: 9292
config.vm.synced_folder ".", "/vagrant", disabled: false

config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]

# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "2024"]
vb.customize ["modifyvm", :id, "--vram", "128"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
end
end
9 changes: 9 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'rack'

class RackApplication
def call(env)
[200, {'Content-Type' => 'text/plain'},['Hello!']]
end
end

run RackApplication.new

0 comments on commit 6df1f31

Please sign in to comment.