From 65e2158fa18626b69e82cdc0341148cc7a60da59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Sobotka?= Date: Wed, 8 Mar 2017 16:55:44 +0100 Subject: [PATCH 1/3] Do not detach from development setup --- bin/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/functions.sh b/bin/functions.sh index 5d4dffb..cd3455a 100644 --- a/bin/functions.sh +++ b/bin/functions.sh @@ -19,7 +19,7 @@ function renderCommands() { function start() { - docker-compose up -d --build; + docker-compose up --build; echo "== All done, happy coding. =="; } From 3f264ae612936f643fad4e4f855270951c8281ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Sobotka?= Date: Wed, 8 Mar 2017 17:11:51 +0100 Subject: [PATCH 2/3] User specific attaching to container --- bin/functions.sh | 13 +++++++++---- bin/helper | 5 ++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bin/functions.sh b/bin/functions.sh index cd3455a..d804080 100644 --- a/bin/functions.sh +++ b/bin/functions.sh @@ -12,7 +12,8 @@ function renderCommands() { echo -e "${ORANGE}Available commands for localhost environment:${NC}" echo -e " ${GREEN}start${NC} Start and setup development environment." echo -e " ${GREEN}stop${NC} Stop development environment." - echo -e " ${GREEN}in${NC} Go into a container." + echo -e " ${GREEN}in${NC} Go into a container as current user." + echo -e " ${GREEN}indef${NC} Go into a container as default user." echo "" exit 0; } @@ -20,7 +21,6 @@ function renderCommands() { function start() { docker-compose up --build; - echo "== All done, happy coding. =="; } @@ -29,6 +29,11 @@ function stop() { } -function goIntoContainer() { - docker exec -t -i ${APP_CONTAINER} bash; +function goIntoContainerCurrentUser() { + docker exec -t -i -u `id -u $UID` ${APP_CONTAINER} bash; } + + +function goIntoContainerDefaultUser() { + docker exec -t -i ${APP_CONTAINER} bash; +} \ No newline at end of file diff --git a/bin/helper b/bin/helper index c60ec04..b284d90 100755 --- a/bin/helper +++ b/bin/helper @@ -19,9 +19,12 @@ case "$1" in ;; in) - goIntoContainer; + goIntoContainerCurrentUser; ;; + indef) + goIntoContainerDefaultUser; + ;; *) echo "Sorry, I don't know want you want" esac From 7997495f4344110da7cc94c905fceae888f6af55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Sobotka?= Date: Wed, 8 Mar 2017 17:22:52 +0100 Subject: [PATCH 3/3] Generated controller with views --- app/assets/javascripts/structure.coffee | 3 +++ app/assets/stylesheets/structure.scss | 3 +++ app/controllers/structure_controller.rb | 7 +++++++ app/helpers/structure_helper.rb | 2 ++ app/views/structure/glob.html.erb | 2 ++ app/views/structure/tree.html.erb | 2 ++ config/routes.rb | 4 ++++ test/controllers/structure_controller_test.rb | 14 ++++++++++++++ 8 files changed, 37 insertions(+) create mode 100644 app/assets/javascripts/structure.coffee create mode 100644 app/assets/stylesheets/structure.scss create mode 100644 app/controllers/structure_controller.rb create mode 100644 app/helpers/structure_helper.rb create mode 100644 app/views/structure/glob.html.erb create mode 100644 app/views/structure/tree.html.erb create mode 100644 test/controllers/structure_controller_test.rb diff --git a/app/assets/javascripts/structure.coffee b/app/assets/javascripts/structure.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/structure.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/structure.scss b/app/assets/stylesheets/structure.scss new file mode 100644 index 0000000..0eaa0fb --- /dev/null +++ b/app/assets/stylesheets/structure.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the structure controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/structure_controller.rb b/app/controllers/structure_controller.rb new file mode 100644 index 0000000..43f9673 --- /dev/null +++ b/app/controllers/structure_controller.rb @@ -0,0 +1,7 @@ +class StructureController < ApplicationController + def glob + end + + def tree + end +end diff --git a/app/helpers/structure_helper.rb b/app/helpers/structure_helper.rb new file mode 100644 index 0000000..70671fa --- /dev/null +++ b/app/helpers/structure_helper.rb @@ -0,0 +1,2 @@ +module StructureHelper +end diff --git a/app/views/structure/glob.html.erb b/app/views/structure/glob.html.erb new file mode 100644 index 0000000..fe29311 --- /dev/null +++ b/app/views/structure/glob.html.erb @@ -0,0 +1,2 @@ +

Structure#glob

+

Find me in app/views/structure/glob.html.erb

diff --git a/app/views/structure/tree.html.erb b/app/views/structure/tree.html.erb new file mode 100644 index 0000000..1803c31 --- /dev/null +++ b/app/views/structure/tree.html.erb @@ -0,0 +1,2 @@ +

Structure#tree

+

Find me in app/views/structure/tree.html.erb

diff --git a/config/routes.rb b/config/routes.rb index 787824f..8002198 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,7 @@ Rails.application.routes.draw do + get 'structure/glob' + + get 'structure/tree' + # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/test/controllers/structure_controller_test.rb b/test/controllers/structure_controller_test.rb new file mode 100644 index 0000000..8015766 --- /dev/null +++ b/test/controllers/structure_controller_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class StructureControllerTest < ActionDispatch::IntegrationTest + test "should get glob" do + get structure_glob_url + assert_response :success + end + + test "should get tree" do + get structure_tree_url + assert_response :success + end + +end