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/bin/functions.sh b/bin/functions.sh index 5d4dffb..d804080 100644 --- a/bin/functions.sh +++ b/bin/functions.sh @@ -12,15 +12,15 @@ 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; } function start() { - docker-compose up -d --build; - echo "== All done, happy coding. =="; + docker-compose up --build; } @@ -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 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