diff --git a/README.md b/README.md index e438f63..700a8d4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ brew install postgresql@14 brew services start postgresql createdb left4me_dev + +https://developer.valvesoftware.com/wiki/L4D2_Vscripts +https://developer.valvesoftware.com/wiki/Squirrel +https://developer.valvesoftware.com/wiki/List_of_L4D2_Script_Functions +https://developer.valvesoftware.com/wiki/List_of_L4D2_Cvars + +https://developer.valvesoftware.com/wiki/Source_RCON_Protocol + +https://github.com/L4D2Scripters/vslib +https://developer.valvesoftware.com/wiki/L4D2_Vscript_Examples + +https://github.com/rpdelaney/cfg-l4d2/tree/master/cfg + +dropdb left4me_dev; createdb left4me_dev; rails db:migrate; rails db:seed diff --git a/rails/app/controllers/actions_controller.rb b/rails/app/controllers/actions_controller.rb new file mode 100644 index 0000000..fd1ac35 --- /dev/null +++ b/rails/app/controllers/actions_controller.rb @@ -0,0 +1,70 @@ +class ActionsController < ApplicationController + before_action :set_action, only: %i[ show edit update destroy ] + + # GET /actions or /actions.json + def index + @actions = Action.all + end + + # GET /actions/1 or /actions/1.json + def show + end + + # GET /actions/new + def new + @action = Action.new + end + + # GET /actions/1/edit + def edit + end + + # POST /actions or /actions.json + def create + @action = Action.new(action_params) + + respond_to do |format| + if @action.save + format.html { redirect_to action_url(@action), notice: "Action was successfully created." } + format.json { render :show, status: :created, location: @action } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @action.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /actions/1 or /actions/1.json + def update + respond_to do |format| + if @action.update(action_params) + format.html { redirect_to action_url(@action), notice: "Action was successfully updated." } + format.json { render :show, status: :ok, location: @action } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @action.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /actions/1 or /actions/1.json + def destroy + @action.destroy + + respond_to do |format| + format.html { redirect_to actions_url, notice: "Action was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_action + @action = Action.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def action_params + params.require(:action).permit(:batch_id, :actionable_id, :actionable_type) + end +end diff --git a/rails/app/controllers/batches_controller.rb b/rails/app/controllers/batches_controller.rb new file mode 100644 index 0000000..66a9d0d --- /dev/null +++ b/rails/app/controllers/batches_controller.rb @@ -0,0 +1,70 @@ +class BatchesController < ApplicationController + before_action :set_batch, only: %i[ show edit update destroy ] + + # GET /batches or /batches.json + def index + @batches = Batch.all + end + + # GET /batches/1 or /batches/1.json + def show + end + + # GET /batches/new + def new + @batch = Batch.new + end + + # GET /batches/1/edit + def edit + end + + # POST /batches or /batches.json + def create + @batch = Batch.new(batch_params) + + respond_to do |format| + if @batch.save + format.html { redirect_to batch_url(@batch), notice: "Batch was successfully created." } + format.json { render :show, status: :created, location: @batch } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @batch.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /batches/1 or /batches/1.json + def update + respond_to do |format| + if @batch.update(batch_params) + format.html { redirect_to batch_url(@batch), notice: "Batch was successfully updated." } + format.json { render :show, status: :ok, location: @batch } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @batch.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /batches/1 or /batches/1.json + def destroy + @batch.destroy + + respond_to do |format| + format.html { redirect_to batches_url, notice: "Batch was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_batch + @batch = Batch.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def batch_params + params.fetch(:batch, {}) + end +end diff --git a/rails/app/controllers/commands_controller.rb b/rails/app/controllers/commands_controller.rb new file mode 100644 index 0000000..d41d76d --- /dev/null +++ b/rails/app/controllers/commands_controller.rb @@ -0,0 +1,70 @@ +class CommandsController < ApplicationController + before_action :set_command, only: %i[ show edit update destroy ] + + # GET /commands or /commands.json + def index + @commands = Command.all + end + + # GET /commands/1 or /commands/1.json + def show + end + + # GET /commands/new + def new + @command = Command.new + end + + # GET /commands/1/edit + def edit + end + + # POST /commands or /commands.json + def create + @command = Command.new(command_params) + + respond_to do |format| + if @command.save + format.html { redirect_to command_url(@command), notice: "Command was successfully created." } + format.json { render :show, status: :created, location: @command } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @command.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /commands/1 or /commands/1.json + def update + respond_to do |format| + if @command.update(command_params) + format.html { redirect_to command_url(@command), notice: "Command was successfully updated." } + format.json { render :show, status: :ok, location: @command } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @command.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /commands/1 or /commands/1.json + def destroy + @command.destroy + + respond_to do |format| + format.html { redirect_to commands_url, notice: "Command was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_command + @command = Command.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def command_params + params.require(:command).permit(:name, :datatype_id) + end +end diff --git a/rails/app/controllers/datatypes_controller.rb b/rails/app/controllers/datatypes_controller.rb new file mode 100644 index 0000000..7c59479 --- /dev/null +++ b/rails/app/controllers/datatypes_controller.rb @@ -0,0 +1,70 @@ +class DatatypesController < ApplicationController + before_action :set_datatype, only: %i[ show edit update destroy ] + + # GET /datatypes or /datatypes.json + def index + @datatypes = Datatype.all + end + + # GET /datatypes/1 or /datatypes/1.json + def show + end + + # GET /datatypes/new + def new + @datatype = Datatype.new + end + + # GET /datatypes/1/edit + def edit + end + + # POST /datatypes or /datatypes.json + def create + @datatype = Datatype.new(datatype_params) + + respond_to do |format| + if @datatype.save + format.html { redirect_to datatype_url(@datatype), notice: "Datatype was successfully created." } + format.json { render :show, status: :created, location: @datatype } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @datatype.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /datatypes/1 or /datatypes/1.json + def update + respond_to do |format| + if @datatype.update(datatype_params) + format.html { redirect_to datatype_url(@datatype), notice: "Datatype was successfully updated." } + format.json { render :show, status: :ok, location: @datatype } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @datatype.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /datatypes/1 or /datatypes/1.json + def destroy + @datatype.destroy + + respond_to do |format| + format.html { redirect_to datatypes_url, notice: "Datatype was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_datatype + @datatype = Datatype.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def datatype_params + params.require(:datatype).permit(:name, :regex) + end +end diff --git a/rails/app/controllers/executions_controller.rb b/rails/app/controllers/executions_controller.rb new file mode 100644 index 0000000..54f3f95 --- /dev/null +++ b/rails/app/controllers/executions_controller.rb @@ -0,0 +1,70 @@ +class ExecutionsController < ApplicationController + before_action :set_execution, only: %i[ show edit update destroy ] + + # GET /executions or /executions.json + def index + @executions = Execution.all + end + + # GET /executions/1 or /executions/1.json + def show + end + + # GET /executions/new + def new + @execution = Execution.new + end + + # GET /executions/1/edit + def edit + end + + # POST /executions or /executions.json + def create + @execution = Execution.new(execution_params) + + respond_to do |format| + if @execution.save + format.html { redirect_to execution_url(@execution), notice: "Execution was successfully created." } + format.json { render :show, status: :created, location: @execution } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @execution.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /executions/1 or /executions/1.json + def update + respond_to do |format| + if @execution.update(execution_params) + format.html { redirect_to execution_url(@execution), notice: "Execution was successfully updated." } + format.json { render :show, status: :ok, location: @execution } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @execution.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /executions/1 or /executions/1.json + def destroy + @execution.destroy + + respond_to do |format| + format.html { redirect_to executions_url, notice: "Execution was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_execution + @execution = Execution.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def execution_params + params.require(:execution).permit(:command_id, :value) + end +end diff --git a/rails/app/controllers/key_binds_controller.rb b/rails/app/controllers/key_binds_controller.rb new file mode 100644 index 0000000..6a418c7 --- /dev/null +++ b/rails/app/controllers/key_binds_controller.rb @@ -0,0 +1,70 @@ +class KeyBindsController < ApplicationController + before_action :set_key_bind, only: %i[ show edit update destroy ] + + # GET /key_binds or /key_binds.json + def index + @key_binds = KeyBind.all + end + + # GET /key_binds/1 or /key_binds/1.json + def show + end + + # GET /key_binds/new + def new + @key_bind = KeyBind.new + end + + # GET /key_binds/1/edit + def edit + end + + # POST /key_binds or /key_binds.json + def create + @key_bind = KeyBind.new(key_bind_params) + + respond_to do |format| + if @key_bind.save + format.html { redirect_to key_bind_url(@key_bind), notice: "Key bind was successfully created." } + format.json { render :show, status: :created, location: @key_bind } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @key_bind.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /key_binds/1 or /key_binds/1.json + def update + respond_to do |format| + if @key_bind.update(key_bind_params) + format.html { redirect_to key_bind_url(@key_bind), notice: "Key bind was successfully updated." } + format.json { render :show, status: :ok, location: @key_bind } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @key_bind.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /key_binds/1 or /key_binds/1.json + def destroy + @key_bind.destroy + + respond_to do |format| + format.html { redirect_to key_binds_url, notice: "Key bind was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_key_bind + @key_bind = KeyBind.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def key_bind_params + params.require(:key_bind).permit(:setup_id, :key_id, :batch_id) + end +end diff --git a/rails/app/controllers/keys_controller.rb b/rails/app/controllers/keys_controller.rb new file mode 100644 index 0000000..733509c --- /dev/null +++ b/rails/app/controllers/keys_controller.rb @@ -0,0 +1,70 @@ +class KeysController < ApplicationController + before_action :set_key, only: %i[ show edit update destroy ] + + # GET /keys or /keys.json + def index + @keys = Key.all + end + + # GET /keys/1 or /keys/1.json + def show + end + + # GET /keys/new + def new + @key = Key.new + end + + # GET /keys/1/edit + def edit + end + + # POST /keys or /keys.json + def create + @key = Key.new(key_params) + + respond_to do |format| + if @key.save + format.html { redirect_to key_url(@key), notice: "Key was successfully created." } + format.json { render :show, status: :created, location: @key } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @key.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /keys/1 or /keys/1.json + def update + respond_to do |format| + if @key.update(key_params) + format.html { redirect_to key_url(@key), notice: "Key was successfully updated." } + format.json { render :show, status: :ok, location: @key } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @key.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /keys/1 or /keys/1.json + def destroy + @key.destroy + + respond_to do |format| + format.html { redirect_to keys_url, notice: "Key was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_key + @key = Key.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def key_params + params.require(:key).permit(:title, :short, :ingame, :keycap) + end +end diff --git a/rails/app/controllers/menu_options_controller.rb b/rails/app/controllers/menu_options_controller.rb new file mode 100644 index 0000000..c2f00fb --- /dev/null +++ b/rails/app/controllers/menu_options_controller.rb @@ -0,0 +1,70 @@ +class MenuOptionsController < ApplicationController + before_action :set_menu_option, only: %i[ show edit update destroy ] + + # GET /menu_options or /menu_options.json + def index + @menu_options = MenuOption.all + end + + # GET /menu_options/1 or /menu_options/1.json + def show + end + + # GET /menu_options/new + def new + @menu_option = MenuOption.new + end + + # GET /menu_options/1/edit + def edit + end + + # POST /menu_options or /menu_options.json + def create + @menu_option = MenuOption.new(menu_option_params) + + respond_to do |format| + if @menu_option.save + format.html { redirect_to menu_option_url(@menu_option), notice: "Menu option was successfully created." } + format.json { render :show, status: :created, location: @menu_option } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @menu_option.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /menu_options/1 or /menu_options/1.json + def update + respond_to do |format| + if @menu_option.update(menu_option_params) + format.html { redirect_to menu_option_url(@menu_option), notice: "Menu option was successfully updated." } + format.json { render :show, status: :ok, location: @menu_option } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @menu_option.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /menu_options/1 or /menu_options/1.json + def destroy + @menu_option.destroy + + respond_to do |format| + format.html { redirect_to menu_options_url, notice: "Menu option was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_menu_option + @menu_option = MenuOption.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def menu_option_params + params.require(:menu_option).permit(:menu_id, :batch_id) + end +end diff --git a/rails/app/controllers/menus_controller.rb b/rails/app/controllers/menus_controller.rb new file mode 100644 index 0000000..e332dc0 --- /dev/null +++ b/rails/app/controllers/menus_controller.rb @@ -0,0 +1,70 @@ +class MenusController < ApplicationController + before_action :set_menu, only: %i[ show edit update destroy ] + + # GET /menus or /menus.json + def index + @menus = Menu.all + end + + # GET /menus/1 or /menus/1.json + def show + end + + # GET /menus/new + def new + @menu = Menu.new + end + + # GET /menus/1/edit + def edit + end + + # POST /menus or /menus.json + def create + @menu = Menu.new(menu_params) + + respond_to do |format| + if @menu.save + format.html { redirect_to menu_url(@menu), notice: "Menu was successfully created." } + format.json { render :show, status: :created, location: @menu } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @menu.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /menus/1 or /menus/1.json + def update + respond_to do |format| + if @menu.update(menu_params) + format.html { redirect_to menu_url(@menu), notice: "Menu was successfully updated." } + format.json { render :show, status: :ok, location: @menu } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @menu.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /menus/1 or /menus/1.json + def destroy + @menu.destroy + + respond_to do |format| + format.html { redirect_to menus_url, notice: "Menu was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_menu + @menu = Menu.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def menu_params + params.require(:menu).permit(:name, :setup_id) + end +end diff --git a/rails/app/controllers/setups_controller.rb b/rails/app/controllers/setups_controller.rb new file mode 100644 index 0000000..ed59c76 --- /dev/null +++ b/rails/app/controllers/setups_controller.rb @@ -0,0 +1,70 @@ +class SetupsController < ApplicationController + before_action :set_setup, only: %i[ show edit update destroy ] + + # GET /setups or /setups.json + def index + @setups = Setup.all + end + + # GET /setups/1 or /setups/1.json + def show + end + + # GET /setups/new + def new + @setup = Setup.new + end + + # GET /setups/1/edit + def edit + end + + # POST /setups or /setups.json + def create + @setup = Setup.new(setup_params) + + respond_to do |format| + if @setup.save + format.html { redirect_to setup_url(@setup), notice: "Setup was successfully created." } + format.json { render :show, status: :created, location: @setup } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @setup.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /setups/1 or /setups/1.json + def update + respond_to do |format| + if @setup.update(setup_params) + format.html { redirect_to setup_url(@setup), notice: "Setup was successfully updated." } + format.json { render :show, status: :ok, location: @setup } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @setup.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /setups/1 or /setups/1.json + def destroy + @setup.destroy + + respond_to do |format| + format.html { redirect_to setups_url, notice: "Setup was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_setup + @setup = Setup.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def setup_params + params.require(:setup).permit(:name) + end +end diff --git a/rails/app/controllers/wheel_options_controller.rb b/rails/app/controllers/wheel_options_controller.rb new file mode 100644 index 0000000..ed7eb87 --- /dev/null +++ b/rails/app/controllers/wheel_options_controller.rb @@ -0,0 +1,70 @@ +class WheelOptionsController < ApplicationController + before_action :set_wheel_option, only: %i[ show edit update destroy ] + + # GET /wheel_options or /wheel_options.json + def index + @wheel_options = WheelOption.all + end + + # GET /wheel_options/1 or /wheel_options/1.json + def show + end + + # GET /wheel_options/new + def new + @wheel_option = WheelOption.new + end + + # GET /wheel_options/1/edit + def edit + end + + # POST /wheel_options or /wheel_options.json + def create + @wheel_option = WheelOption.new(wheel_option_params) + + respond_to do |format| + if @wheel_option.save + format.html { redirect_to wheel_option_url(@wheel_option), notice: "Wheel option was successfully created." } + format.json { render :show, status: :created, location: @wheel_option } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @wheel_option.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /wheel_options/1 or /wheel_options/1.json + def update + respond_to do |format| + if @wheel_option.update(wheel_option_params) + format.html { redirect_to wheel_option_url(@wheel_option), notice: "Wheel option was successfully updated." } + format.json { render :show, status: :ok, location: @wheel_option } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @wheel_option.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /wheel_options/1 or /wheel_options/1.json + def destroy + @wheel_option.destroy + + respond_to do |format| + format.html { redirect_to wheel_options_url, notice: "Wheel option was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_wheel_option + @wheel_option = WheelOption.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def wheel_option_params + params.require(:wheel_option).permit(:wheel_id, :batch_id) + end +end diff --git a/rails/app/controllers/wheels_controller.rb b/rails/app/controllers/wheels_controller.rb new file mode 100644 index 0000000..ac5e4bc --- /dev/null +++ b/rails/app/controllers/wheels_controller.rb @@ -0,0 +1,70 @@ +class WheelsController < ApplicationController + before_action :set_wheel, only: %i[ show edit update destroy ] + + # GET /wheels or /wheels.json + def index + @wheels = Wheel.all + end + + # GET /wheels/1 or /wheels/1.json + def show + end + + # GET /wheels/new + def new + @wheel = Wheel.new + end + + # GET /wheels/1/edit + def edit + end + + # POST /wheels or /wheels.json + def create + @wheel = Wheel.new(wheel_params) + + respond_to do |format| + if @wheel.save + format.html { redirect_to wheel_url(@wheel), notice: "Wheel was successfully created." } + format.json { render :show, status: :created, location: @wheel } + else + format.html { render :new, status: :unprocessable_entity } + format.json { render json: @wheel.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /wheels/1 or /wheels/1.json + def update + respond_to do |format| + if @wheel.update(wheel_params) + format.html { redirect_to wheel_url(@wheel), notice: "Wheel was successfully updated." } + format.json { render :show, status: :ok, location: @wheel } + else + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @wheel.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /wheels/1 or /wheels/1.json + def destroy + @wheel.destroy + + respond_to do |format| + format.html { redirect_to wheels_url, notice: "Wheel was successfully destroyed." } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_wheel + @wheel = Wheel.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def wheel_params + params.require(:wheel).permit(:name, :setup_id) + end +end diff --git a/rails/app/helpers/actions_helper.rb b/rails/app/helpers/actions_helper.rb new file mode 100644 index 0000000..9611c69 --- /dev/null +++ b/rails/app/helpers/actions_helper.rb @@ -0,0 +1,2 @@ +module ActionsHelper +end diff --git a/rails/app/helpers/batches_helper.rb b/rails/app/helpers/batches_helper.rb new file mode 100644 index 0000000..2a89d3f --- /dev/null +++ b/rails/app/helpers/batches_helper.rb @@ -0,0 +1,2 @@ +module BatchesHelper +end diff --git a/rails/app/helpers/commands_helper.rb b/rails/app/helpers/commands_helper.rb new file mode 100644 index 0000000..9b0978a --- /dev/null +++ b/rails/app/helpers/commands_helper.rb @@ -0,0 +1,2 @@ +module CommandsHelper +end diff --git a/rails/app/helpers/datatypes_helper.rb b/rails/app/helpers/datatypes_helper.rb new file mode 100644 index 0000000..575c281 --- /dev/null +++ b/rails/app/helpers/datatypes_helper.rb @@ -0,0 +1,2 @@ +module DatatypesHelper +end diff --git a/rails/app/helpers/executions_helper.rb b/rails/app/helpers/executions_helper.rb new file mode 100644 index 0000000..bdb4515 --- /dev/null +++ b/rails/app/helpers/executions_helper.rb @@ -0,0 +1,2 @@ +module ExecutionsHelper +end diff --git a/rails/app/helpers/key_binds_helper.rb b/rails/app/helpers/key_binds_helper.rb new file mode 100644 index 0000000..d2d2b9a --- /dev/null +++ b/rails/app/helpers/key_binds_helper.rb @@ -0,0 +1,2 @@ +module KeyBindsHelper +end diff --git a/rails/app/helpers/keys_helper.rb b/rails/app/helpers/keys_helper.rb new file mode 100644 index 0000000..d1a7793 --- /dev/null +++ b/rails/app/helpers/keys_helper.rb @@ -0,0 +1,2 @@ +module KeysHelper +end diff --git a/rails/app/helpers/menu_options_helper.rb b/rails/app/helpers/menu_options_helper.rb new file mode 100644 index 0000000..939bedf --- /dev/null +++ b/rails/app/helpers/menu_options_helper.rb @@ -0,0 +1,2 @@ +module MenuOptionsHelper +end diff --git a/rails/app/helpers/menus_helper.rb b/rails/app/helpers/menus_helper.rb new file mode 100644 index 0000000..2a9d3f5 --- /dev/null +++ b/rails/app/helpers/menus_helper.rb @@ -0,0 +1,2 @@ +module MenusHelper +end diff --git a/rails/app/helpers/setups_helper.rb b/rails/app/helpers/setups_helper.rb new file mode 100644 index 0000000..bcb7b59 --- /dev/null +++ b/rails/app/helpers/setups_helper.rb @@ -0,0 +1,2 @@ +module SetupsHelper +end diff --git a/rails/app/helpers/wheel_options_helper.rb b/rails/app/helpers/wheel_options_helper.rb new file mode 100644 index 0000000..15fdcb2 --- /dev/null +++ b/rails/app/helpers/wheel_options_helper.rb @@ -0,0 +1,2 @@ +module WheelOptionsHelper +end diff --git a/rails/app/helpers/wheels_helper.rb b/rails/app/helpers/wheels_helper.rb new file mode 100644 index 0000000..86f5bc0 --- /dev/null +++ b/rails/app/helpers/wheels_helper.rb @@ -0,0 +1,2 @@ +module WheelsHelper +end diff --git a/rails/app/models/action.rb b/rails/app/models/action.rb new file mode 100644 index 0000000..42b79d2 --- /dev/null +++ b/rails/app/models/action.rb @@ -0,0 +1,4 @@ +class Action < ApplicationRecord + belongs_to :batch + belongs_to :actionable, polymorphic: true +end diff --git a/rails/app/models/batch.rb b/rails/app/models/batch.rb new file mode 100644 index 0000000..152c248 --- /dev/null +++ b/rails/app/models/batch.rb @@ -0,0 +1,6 @@ +class Batch < ApplicationRecord + has_many :actions + has_many :menu_options + has_many :wheel_options + has_many :key_binds +end diff --git a/rails/app/models/command.rb b/rails/app/models/command.rb new file mode 100644 index 0000000..fe2dbb0 --- /dev/null +++ b/rails/app/models/command.rb @@ -0,0 +1,4 @@ +class Command < ApplicationRecord + belongs_to :datatype + has_many :executions +end diff --git a/rails/app/models/datatype.rb b/rails/app/models/datatype.rb new file mode 100644 index 0000000..57756c4 --- /dev/null +++ b/rails/app/models/datatype.rb @@ -0,0 +1,5 @@ +class Datatype < ApplicationRecord + def match? other + /#{Regexp.new(regex)}/.match? other + end +end diff --git a/rails/app/models/execution.rb b/rails/app/models/execution.rb new file mode 100644 index 0000000..30458e3 --- /dev/null +++ b/rails/app/models/execution.rb @@ -0,0 +1,4 @@ +class Execution < ApplicationRecord + belongs_to :command + has_many :actions +end diff --git a/rails/app/models/key.rb b/rails/app/models/key.rb new file mode 100644 index 0000000..1092f44 --- /dev/null +++ b/rails/app/models/key.rb @@ -0,0 +1,3 @@ +class Key < ApplicationRecord + has_many :key_binds +end diff --git a/rails/app/models/key_bind.rb b/rails/app/models/key_bind.rb new file mode 100644 index 0000000..fa8f800 --- /dev/null +++ b/rails/app/models/key_bind.rb @@ -0,0 +1,5 @@ +class KeyBind < ApplicationRecord + belongs_to :setup + belongs_to :key + belongs_to :batch +end diff --git a/rails/app/models/menu.rb b/rails/app/models/menu.rb new file mode 100644 index 0000000..c8ac678 --- /dev/null +++ b/rails/app/models/menu.rb @@ -0,0 +1,5 @@ +class Menu < ApplicationRecord + belongs_to :setup + has_many :actions, as: :actionable + has_many :menu_options +end diff --git a/rails/app/models/menu_option.rb b/rails/app/models/menu_option.rb new file mode 100644 index 0000000..a309155 --- /dev/null +++ b/rails/app/models/menu_option.rb @@ -0,0 +1,4 @@ +class MenuOption < ApplicationRecord + belongs_to :menu + belongs_to :batch +end diff --git a/rails/app/models/setup.rb b/rails/app/models/setup.rb new file mode 100644 index 0000000..495f767 --- /dev/null +++ b/rails/app/models/setup.rb @@ -0,0 +1,6 @@ +class Setup < ApplicationRecord + has_many :key_binds + has_many :wheels + has_many :menus + has_many :input_devices +end diff --git a/rails/app/models/wheel.rb b/rails/app/models/wheel.rb new file mode 100644 index 0000000..0ca8f1f --- /dev/null +++ b/rails/app/models/wheel.rb @@ -0,0 +1,5 @@ +class Wheel < ApplicationRecord + belongs_to :setup + has_many :wheel_options + has_many :actions, as: :actionable +end diff --git a/rails/app/models/wheel_option.rb b/rails/app/models/wheel_option.rb new file mode 100644 index 0000000..50d7cc0 --- /dev/null +++ b/rails/app/models/wheel_option.rb @@ -0,0 +1,4 @@ +class WheelOption < ApplicationRecord + belongs_to :wheel + belongs_to :batch +end diff --git a/rails/app/views/actions/_action.html.erb b/rails/app/views/actions/_action.html.erb new file mode 100644 index 0000000..dbe1160 --- /dev/null +++ b/rails/app/views/actions/_action.html.erb @@ -0,0 +1,12 @@ +
+

+ Batch: + <%= action.batch_id %> +

+ +

+ Actionable: + <%= action.actionable_id %> +

+ +
diff --git a/rails/app/views/actions/_action.json.jbuilder b/rails/app/views/actions/_action.json.jbuilder new file mode 100644 index 0000000..027d4ac --- /dev/null +++ b/rails/app/views/actions/_action.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! action, :id, :batch_id, :actionable_id, :actionable_type, :created_at, :updated_at +json.url action_url(action, format: :json) diff --git a/rails/app/views/actions/_form.html.erb b/rails/app/views/actions/_form.html.erb new file mode 100644 index 0000000..a07613f --- /dev/null +++ b/rails/app/views/actions/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_with(model: action) do |form| %> + <% if action.errors.any? %> +
+

<%= pluralize(action.errors.count, "error") %> prohibited this action from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :batch_id, style: "display: block" %> + <%= form.text_field :batch_id %> +
+ +
+ <%= form.label :actionable_id, style: "display: block" %> + <%= form.text_field :actionable_id %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/actions/edit.html.erb b/rails/app/views/actions/edit.html.erb new file mode 100644 index 0000000..4d28d8e --- /dev/null +++ b/rails/app/views/actions/edit.html.erb @@ -0,0 +1,10 @@ +

Editing action

+ +<%= render "form", action: @action %> + +
+ +
+ <%= link_to "Show this action", @action %> | + <%= link_to "Back to actions", actions_path %> +
diff --git a/rails/app/views/actions/index.html.erb b/rails/app/views/actions/index.html.erb new file mode 100644 index 0000000..e4788d2 --- /dev/null +++ b/rails/app/views/actions/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Actions

+ +
+ <% @actions.each do |action| %> + <%= render action %> +

+ <%= link_to "Show this action", action %> +

+ <% end %> +
+ +<%= link_to "New action", new_action_path %> diff --git a/rails/app/views/actions/index.json.jbuilder b/rails/app/views/actions/index.json.jbuilder new file mode 100644 index 0000000..0636af9 --- /dev/null +++ b/rails/app/views/actions/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @actions, partial: "actions/action", as: :action diff --git a/rails/app/views/actions/new.html.erb b/rails/app/views/actions/new.html.erb new file mode 100644 index 0000000..aae1496 --- /dev/null +++ b/rails/app/views/actions/new.html.erb @@ -0,0 +1,9 @@ +

New action

+ +<%= render "form", action: @action %> + +
+ +
+ <%= link_to "Back to actions", actions_path %> +
diff --git a/rails/app/views/actions/show.html.erb b/rails/app/views/actions/show.html.erb new file mode 100644 index 0000000..002689b --- /dev/null +++ b/rails/app/views/actions/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @action %> + +
+ <%= link_to "Edit this action", edit_action_path(@action) %> | + <%= link_to "Back to actions", actions_path %> + + <%= button_to "Destroy this action", @action, method: :delete %> +
diff --git a/rails/app/views/actions/show.json.jbuilder b/rails/app/views/actions/show.json.jbuilder new file mode 100644 index 0000000..0e27bbb --- /dev/null +++ b/rails/app/views/actions/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "actions/action", action: @action diff --git a/rails/app/views/batches/_batch.html.erb b/rails/app/views/batches/_batch.html.erb new file mode 100644 index 0000000..ef25fa7 --- /dev/null +++ b/rails/app/views/batches/_batch.html.erb @@ -0,0 +1,2 @@ +
+
diff --git a/rails/app/views/batches/_batch.json.jbuilder b/rails/app/views/batches/_batch.json.jbuilder new file mode 100644 index 0000000..7d7a6a0 --- /dev/null +++ b/rails/app/views/batches/_batch.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! batch, :id, :created_at, :updated_at +json.url batch_url(batch, format: :json) diff --git a/rails/app/views/batches/_form.html.erb b/rails/app/views/batches/_form.html.erb new file mode 100644 index 0000000..9bb3165 --- /dev/null +++ b/rails/app/views/batches/_form.html.erb @@ -0,0 +1,17 @@ +<%= form_with(model: batch) do |form| %> + <% if batch.errors.any? %> +
+

<%= pluralize(batch.errors.count, "error") %> prohibited this batch from being saved:

+ + +
+ <% end %> + +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/batches/edit.html.erb b/rails/app/views/batches/edit.html.erb new file mode 100644 index 0000000..001873d --- /dev/null +++ b/rails/app/views/batches/edit.html.erb @@ -0,0 +1,10 @@ +

Editing batch

+ +<%= render "form", batch: @batch %> + +
+ +
+ <%= link_to "Show this batch", @batch %> | + <%= link_to "Back to batches", batches_path %> +
diff --git a/rails/app/views/batches/index.html.erb b/rails/app/views/batches/index.html.erb new file mode 100644 index 0000000..3717ca2 --- /dev/null +++ b/rails/app/views/batches/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Batches

+ +
+ <% @batches.each do |batch| %> + <%= render batch %> +

+ <%= link_to "Show this batch", batch %> +

+ <% end %> +
+ +<%= link_to "New batch", new_batch_path %> diff --git a/rails/app/views/batches/index.json.jbuilder b/rails/app/views/batches/index.json.jbuilder new file mode 100644 index 0000000..53afeec --- /dev/null +++ b/rails/app/views/batches/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @batches, partial: "batches/batch", as: :batch diff --git a/rails/app/views/batches/new.html.erb b/rails/app/views/batches/new.html.erb new file mode 100644 index 0000000..ecdd37e --- /dev/null +++ b/rails/app/views/batches/new.html.erb @@ -0,0 +1,9 @@ +

New batch

+ +<%= render "form", batch: @batch %> + +
+ +
+ <%= link_to "Back to batches", batches_path %> +
diff --git a/rails/app/views/batches/show.html.erb b/rails/app/views/batches/show.html.erb new file mode 100644 index 0000000..c5c5edc --- /dev/null +++ b/rails/app/views/batches/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @batch %> + +
+ <%= link_to "Edit this batch", edit_batch_path(@batch) %> | + <%= link_to "Back to batches", batches_path %> + + <%= button_to "Destroy this batch", @batch, method: :delete %> +
diff --git a/rails/app/views/batches/show.json.jbuilder b/rails/app/views/batches/show.json.jbuilder new file mode 100644 index 0000000..1e697b5 --- /dev/null +++ b/rails/app/views/batches/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "batches/batch", batch: @batch diff --git a/rails/app/views/commands/_command.html.erb b/rails/app/views/commands/_command.html.erb new file mode 100644 index 0000000..66bae73 --- /dev/null +++ b/rails/app/views/commands/_command.html.erb @@ -0,0 +1,12 @@ +
+

+ Name: + <%= command.name %> +

+ +

+ Datatype: + <%= command.datatype_id %> +

+ +
diff --git a/rails/app/views/commands/_command.json.jbuilder b/rails/app/views/commands/_command.json.jbuilder new file mode 100644 index 0000000..d876d3a --- /dev/null +++ b/rails/app/views/commands/_command.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! command, :id, :name, :datatype_id, :created_at, :updated_at +json.url command_url(command, format: :json) diff --git a/rails/app/views/commands/_form.html.erb b/rails/app/views/commands/_form.html.erb new file mode 100644 index 0000000..0b374b1 --- /dev/null +++ b/rails/app/views/commands/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_with(model: command) do |form| %> + <% if command.errors.any? %> +
+

<%= pluralize(command.errors.count, "error") %> prohibited this command from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :name, style: "display: block" %> + <%= form.text_field :name %> +
+ +
+ <%= form.label :datatype_id, style: "display: block" %> + <%= form.text_field :datatype_id %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/commands/edit.html.erb b/rails/app/views/commands/edit.html.erb new file mode 100644 index 0000000..25c405e --- /dev/null +++ b/rails/app/views/commands/edit.html.erb @@ -0,0 +1,10 @@ +

Editing command

+ +<%= render "form", command: @command %> + +
+ +
+ <%= link_to "Show this command", @command %> | + <%= link_to "Back to commands", commands_path %> +
diff --git a/rails/app/views/commands/index.html.erb b/rails/app/views/commands/index.html.erb new file mode 100644 index 0000000..287b75e --- /dev/null +++ b/rails/app/views/commands/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Commands

+ +
+ <% @commands.each do |command| %> + <%= render command %> +

+ <%= link_to "Show this command", command %> +

+ <% end %> +
+ +<%= link_to "New command", new_command_path %> diff --git a/rails/app/views/commands/index.json.jbuilder b/rails/app/views/commands/index.json.jbuilder new file mode 100644 index 0000000..36e6763 --- /dev/null +++ b/rails/app/views/commands/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @commands, partial: "commands/command", as: :command diff --git a/rails/app/views/commands/new.html.erb b/rails/app/views/commands/new.html.erb new file mode 100644 index 0000000..342dcf0 --- /dev/null +++ b/rails/app/views/commands/new.html.erb @@ -0,0 +1,9 @@ +

New command

+ +<%= render "form", command: @command %> + +
+ +
+ <%= link_to "Back to commands", commands_path %> +
diff --git a/rails/app/views/commands/show.html.erb b/rails/app/views/commands/show.html.erb new file mode 100644 index 0000000..3b63159 --- /dev/null +++ b/rails/app/views/commands/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @command %> + +
+ <%= link_to "Edit this command", edit_command_path(@command) %> | + <%= link_to "Back to commands", commands_path %> + + <%= button_to "Destroy this command", @command, method: :delete %> +
diff --git a/rails/app/views/commands/show.json.jbuilder b/rails/app/views/commands/show.json.jbuilder new file mode 100644 index 0000000..c31944e --- /dev/null +++ b/rails/app/views/commands/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "commands/command", command: @command diff --git a/rails/app/views/datatypes/_datatype.html.erb b/rails/app/views/datatypes/_datatype.html.erb new file mode 100644 index 0000000..76223da --- /dev/null +++ b/rails/app/views/datatypes/_datatype.html.erb @@ -0,0 +1,12 @@ +
+

+ Name: + <%= datatype.name %> +

+ +

+ Regex: + <%= datatype.regex %> +

+ +
diff --git a/rails/app/views/datatypes/_datatype.json.jbuilder b/rails/app/views/datatypes/_datatype.json.jbuilder new file mode 100644 index 0000000..781a697 --- /dev/null +++ b/rails/app/views/datatypes/_datatype.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! datatype, :id, :name, :regex, :created_at, :updated_at +json.url datatype_url(datatype, format: :json) diff --git a/rails/app/views/datatypes/_form.html.erb b/rails/app/views/datatypes/_form.html.erb new file mode 100644 index 0000000..1330275 --- /dev/null +++ b/rails/app/views/datatypes/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_with(model: datatype) do |form| %> + <% if datatype.errors.any? %> +
+

<%= pluralize(datatype.errors.count, "error") %> prohibited this datatype from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :name, style: "display: block" %> + <%= form.text_field :name %> +
+ +
+ <%= form.label :regex, style: "display: block" %> + <%= form.text_field :regex %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/datatypes/edit.html.erb b/rails/app/views/datatypes/edit.html.erb new file mode 100644 index 0000000..2b1c8bf --- /dev/null +++ b/rails/app/views/datatypes/edit.html.erb @@ -0,0 +1,10 @@ +

Editing datatype

+ +<%= render "form", datatype: @datatype %> + +
+ +
+ <%= link_to "Show this datatype", @datatype %> | + <%= link_to "Back to datatypes", datatypes_path %> +
diff --git a/rails/app/views/datatypes/index.html.erb b/rails/app/views/datatypes/index.html.erb new file mode 100644 index 0000000..8cc0da6 --- /dev/null +++ b/rails/app/views/datatypes/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Datatypes

+ +
+ <% @datatypes.each do |datatype| %> + <%= render datatype %> +

+ <%= link_to "Show this datatype", datatype %> +

+ <% end %> +
+ +<%= link_to "New datatype", new_datatype_path %> diff --git a/rails/app/views/datatypes/index.json.jbuilder b/rails/app/views/datatypes/index.json.jbuilder new file mode 100644 index 0000000..a8e6f1b --- /dev/null +++ b/rails/app/views/datatypes/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @datatypes, partial: "datatypes/datatype", as: :datatype diff --git a/rails/app/views/datatypes/new.html.erb b/rails/app/views/datatypes/new.html.erb new file mode 100644 index 0000000..ebe4657 --- /dev/null +++ b/rails/app/views/datatypes/new.html.erb @@ -0,0 +1,9 @@ +

New datatype

+ +<%= render "form", datatype: @datatype %> + +
+ +
+ <%= link_to "Back to datatypes", datatypes_path %> +
diff --git a/rails/app/views/datatypes/show.html.erb b/rails/app/views/datatypes/show.html.erb new file mode 100644 index 0000000..3268810 --- /dev/null +++ b/rails/app/views/datatypes/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @datatype %> + +
+ <%= link_to "Edit this datatype", edit_datatype_path(@datatype) %> | + <%= link_to "Back to datatypes", datatypes_path %> + + <%= button_to "Destroy this datatype", @datatype, method: :delete %> +
diff --git a/rails/app/views/datatypes/show.json.jbuilder b/rails/app/views/datatypes/show.json.jbuilder new file mode 100644 index 0000000..652d779 --- /dev/null +++ b/rails/app/views/datatypes/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "datatypes/datatype", datatype: @datatype diff --git a/rails/app/views/executions/_execution.html.erb b/rails/app/views/executions/_execution.html.erb new file mode 100644 index 0000000..a4dfab0 --- /dev/null +++ b/rails/app/views/executions/_execution.html.erb @@ -0,0 +1,12 @@ +
+

+ Command: + <%= execution.command_id %> +

+ +

+ Value: + <%= execution.value %> +

+ +
diff --git a/rails/app/views/executions/_execution.json.jbuilder b/rails/app/views/executions/_execution.json.jbuilder new file mode 100644 index 0000000..4e3a59a --- /dev/null +++ b/rails/app/views/executions/_execution.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! execution, :id, :command_id, :value, :created_at, :updated_at +json.url execution_url(execution, format: :json) diff --git a/rails/app/views/executions/_form.html.erb b/rails/app/views/executions/_form.html.erb new file mode 100644 index 0000000..bc1a29a --- /dev/null +++ b/rails/app/views/executions/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_with(model: execution) do |form| %> + <% if execution.errors.any? %> +
+

<%= pluralize(execution.errors.count, "error") %> prohibited this execution from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :command_id, style: "display: block" %> + <%= form.text_field :command_id %> +
+ +
+ <%= form.label :value, style: "display: block" %> + <%= form.text_field :value %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/executions/edit.html.erb b/rails/app/views/executions/edit.html.erb new file mode 100644 index 0000000..7e639c0 --- /dev/null +++ b/rails/app/views/executions/edit.html.erb @@ -0,0 +1,10 @@ +

Editing execution

+ +<%= render "form", execution: @execution %> + +
+ +
+ <%= link_to "Show this execution", @execution %> | + <%= link_to "Back to executions", executions_path %> +
diff --git a/rails/app/views/executions/index.html.erb b/rails/app/views/executions/index.html.erb new file mode 100644 index 0000000..3b123ce --- /dev/null +++ b/rails/app/views/executions/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Executions

+ +
+ <% @executions.each do |execution| %> + <%= render execution %> +

+ <%= link_to "Show this execution", execution %> +

+ <% end %> +
+ +<%= link_to "New execution", new_execution_path %> diff --git a/rails/app/views/executions/index.json.jbuilder b/rails/app/views/executions/index.json.jbuilder new file mode 100644 index 0000000..3f4bc51 --- /dev/null +++ b/rails/app/views/executions/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @executions, partial: "executions/execution", as: :execution diff --git a/rails/app/views/executions/new.html.erb b/rails/app/views/executions/new.html.erb new file mode 100644 index 0000000..bb9d50d --- /dev/null +++ b/rails/app/views/executions/new.html.erb @@ -0,0 +1,9 @@ +

New execution

+ +<%= render "form", execution: @execution %> + +
+ +
+ <%= link_to "Back to executions", executions_path %> +
diff --git a/rails/app/views/executions/show.html.erb b/rails/app/views/executions/show.html.erb new file mode 100644 index 0000000..0ffc0b1 --- /dev/null +++ b/rails/app/views/executions/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @execution %> + +
+ <%= link_to "Edit this execution", edit_execution_path(@execution) %> | + <%= link_to "Back to executions", executions_path %> + + <%= button_to "Destroy this execution", @execution, method: :delete %> +
diff --git a/rails/app/views/executions/show.json.jbuilder b/rails/app/views/executions/show.json.jbuilder new file mode 100644 index 0000000..f3556db --- /dev/null +++ b/rails/app/views/executions/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "executions/execution", execution: @execution diff --git a/rails/app/views/key_binds/_form.html.erb b/rails/app/views/key_binds/_form.html.erb new file mode 100644 index 0000000..92958c6 --- /dev/null +++ b/rails/app/views/key_binds/_form.html.erb @@ -0,0 +1,32 @@ +<%= form_with(model: key_bind) do |form| %> + <% if key_bind.errors.any? %> +
+

<%= pluralize(key_bind.errors.count, "error") %> prohibited this key_bind from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :setup_id, style: "display: block" %> + <%= form.text_field :setup_id %> +
+ +
+ <%= form.label :key_id, style: "display: block" %> + <%= form.text_field :key_id %> +
+ +
+ <%= form.label :batch_id, style: "display: block" %> + <%= form.text_field :batch_id %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/key_binds/_key_bind.html.erb b/rails/app/views/key_binds/_key_bind.html.erb new file mode 100644 index 0000000..460ded0 --- /dev/null +++ b/rails/app/views/key_binds/_key_bind.html.erb @@ -0,0 +1,17 @@ +
+

+ Setup: + <%= key_bind.setup_id %> +

+ +

+ Key: + <%= key_bind.key_id %> +

+ +

+ Batch: + <%= key_bind.batch_id %> +

+ +
diff --git a/rails/app/views/key_binds/_key_bind.json.jbuilder b/rails/app/views/key_binds/_key_bind.json.jbuilder new file mode 100644 index 0000000..e3c3144 --- /dev/null +++ b/rails/app/views/key_binds/_key_bind.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! key_bind, :id, :setup_id, :key_id, :batch_id, :created_at, :updated_at +json.url key_bind_url(key_bind, format: :json) diff --git a/rails/app/views/key_binds/edit.html.erb b/rails/app/views/key_binds/edit.html.erb new file mode 100644 index 0000000..e06126c --- /dev/null +++ b/rails/app/views/key_binds/edit.html.erb @@ -0,0 +1,10 @@ +

Editing key bind

+ +<%= render "form", key_bind: @key_bind %> + +
+ +
+ <%= link_to "Show this key bind", @key_bind %> | + <%= link_to "Back to key binds", key_binds_path %> +
diff --git a/rails/app/views/key_binds/index.html.erb b/rails/app/views/key_binds/index.html.erb new file mode 100644 index 0000000..bb966b3 --- /dev/null +++ b/rails/app/views/key_binds/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Key binds

+ +
+ <% @key_binds.each do |key_bind| %> + <%= render key_bind %> +

+ <%= link_to "Show this key bind", key_bind %> +

+ <% end %> +
+ +<%= link_to "New key bind", new_key_bind_path %> diff --git a/rails/app/views/key_binds/index.json.jbuilder b/rails/app/views/key_binds/index.json.jbuilder new file mode 100644 index 0000000..2ef4ca4 --- /dev/null +++ b/rails/app/views/key_binds/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @key_binds, partial: "key_binds/key_bind", as: :key_bind diff --git a/rails/app/views/key_binds/new.html.erb b/rails/app/views/key_binds/new.html.erb new file mode 100644 index 0000000..c4ac0d1 --- /dev/null +++ b/rails/app/views/key_binds/new.html.erb @@ -0,0 +1,9 @@ +

New key bind

+ +<%= render "form", key_bind: @key_bind %> + +
+ +
+ <%= link_to "Back to key binds", key_binds_path %> +
diff --git a/rails/app/views/key_binds/show.html.erb b/rails/app/views/key_binds/show.html.erb new file mode 100644 index 0000000..3b67104 --- /dev/null +++ b/rails/app/views/key_binds/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @key_bind %> + +
+ <%= link_to "Edit this key bind", edit_key_bind_path(@key_bind) %> | + <%= link_to "Back to key binds", key_binds_path %> + + <%= button_to "Destroy this key bind", @key_bind, method: :delete %> +
diff --git a/rails/app/views/key_binds/show.json.jbuilder b/rails/app/views/key_binds/show.json.jbuilder new file mode 100644 index 0000000..7be4571 --- /dev/null +++ b/rails/app/views/key_binds/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "key_binds/key_bind", key_bind: @key_bind diff --git a/rails/app/views/keys/_form.html.erb b/rails/app/views/keys/_form.html.erb new file mode 100644 index 0000000..5913cec --- /dev/null +++ b/rails/app/views/keys/_form.html.erb @@ -0,0 +1,37 @@ +<%= form_with(model: key) do |form| %> + <% if key.errors.any? %> +
+

<%= pluralize(key.errors.count, "error") %> prohibited this key from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :title, style: "display: block" %> + <%= form.text_field :title %> +
+ +
+ <%= form.label :short, style: "display: block" %> + <%= form.text_field :short %> +
+ +
+ <%= form.label :ingame, style: "display: block" %> + <%= form.text_field :ingame %> +
+ +
+ <%= form.label :keycap, style: "display: block" %> + <%= form.text_field :keycap %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/keys/_key.html.erb b/rails/app/views/keys/_key.html.erb new file mode 100644 index 0000000..408bf5a --- /dev/null +++ b/rails/app/views/keys/_key.html.erb @@ -0,0 +1,22 @@ +
+

+ Title: + <%= key.title %> +

+ +

+ Short: + <%= key.short %> +

+ +

+ Ingame: + <%= key.ingame %> +

+ +

+ Keycap: + <%= key.keycap %> +

+ +
diff --git a/rails/app/views/keys/_key.json.jbuilder b/rails/app/views/keys/_key.json.jbuilder new file mode 100644 index 0000000..b644b03 --- /dev/null +++ b/rails/app/views/keys/_key.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! key, :id, :title, :short, :ingame, :keycap, :created_at, :updated_at +json.url key_url(key, format: :json) diff --git a/rails/app/views/keys/edit.html.erb b/rails/app/views/keys/edit.html.erb new file mode 100644 index 0000000..7d38c53 --- /dev/null +++ b/rails/app/views/keys/edit.html.erb @@ -0,0 +1,10 @@ +

Editing key

+ +<%= render "form", key: @key %> + +
+ +
+ <%= link_to "Show this key", @key %> | + <%= link_to "Back to keys", keys_path %> +
diff --git a/rails/app/views/keys/index.html.erb b/rails/app/views/keys/index.html.erb new file mode 100644 index 0000000..31fda63 --- /dev/null +++ b/rails/app/views/keys/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Keys

+ +
+ <% @keys.each do |key| %> + <%= render key %> +

+ <%= link_to "Show this key", key %> +

+ <% end %> +
+ +<%= link_to "New key", new_key_path %> diff --git a/rails/app/views/keys/index.json.jbuilder b/rails/app/views/keys/index.json.jbuilder new file mode 100644 index 0000000..41e5ec8 --- /dev/null +++ b/rails/app/views/keys/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @keys, partial: "keys/key", as: :key diff --git a/rails/app/views/keys/new.html.erb b/rails/app/views/keys/new.html.erb new file mode 100644 index 0000000..394e314 --- /dev/null +++ b/rails/app/views/keys/new.html.erb @@ -0,0 +1,9 @@ +

New key

+ +<%= render "form", key: @key %> + +
+ +
+ <%= link_to "Back to keys", keys_path %> +
diff --git a/rails/app/views/keys/show.html.erb b/rails/app/views/keys/show.html.erb new file mode 100644 index 0000000..8021af2 --- /dev/null +++ b/rails/app/views/keys/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @key %> + +
+ <%= link_to "Edit this key", edit_key_path(@key) %> | + <%= link_to "Back to keys", keys_path %> + + <%= button_to "Destroy this key", @key, method: :delete %> +
diff --git a/rails/app/views/keys/show.json.jbuilder b/rails/app/views/keys/show.json.jbuilder new file mode 100644 index 0000000..39b7aba --- /dev/null +++ b/rails/app/views/keys/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "keys/key", key: @key diff --git a/rails/app/views/menu_options/_form.html.erb b/rails/app/views/menu_options/_form.html.erb new file mode 100644 index 0000000..8390e2a --- /dev/null +++ b/rails/app/views/menu_options/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_with(model: menu_option) do |form| %> + <% if menu_option.errors.any? %> +
+

<%= pluralize(menu_option.errors.count, "error") %> prohibited this menu_option from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :menu_id, style: "display: block" %> + <%= form.text_field :menu_id %> +
+ +
+ <%= form.label :batch_id, style: "display: block" %> + <%= form.text_field :batch_id %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/menu_options/_menu_option.html.erb b/rails/app/views/menu_options/_menu_option.html.erb new file mode 100644 index 0000000..af8931b --- /dev/null +++ b/rails/app/views/menu_options/_menu_option.html.erb @@ -0,0 +1,12 @@ + diff --git a/rails/app/views/menu_options/_menu_option.json.jbuilder b/rails/app/views/menu_options/_menu_option.json.jbuilder new file mode 100644 index 0000000..c748bf1 --- /dev/null +++ b/rails/app/views/menu_options/_menu_option.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! menu_option, :id, :menu_id, :batch_id, :created_at, :updated_at +json.url menu_option_url(menu_option, format: :json) diff --git a/rails/app/views/menu_options/edit.html.erb b/rails/app/views/menu_options/edit.html.erb new file mode 100644 index 0000000..81a50e8 --- /dev/null +++ b/rails/app/views/menu_options/edit.html.erb @@ -0,0 +1,10 @@ +

Editing menu option

+ +<%= render "form", menu_option: @menu_option %> + +
+ +
+ <%= link_to "Show this menu option", @menu_option %> | + <%= link_to "Back to menu options", menu_options_path %> +
diff --git a/rails/app/views/menu_options/index.html.erb b/rails/app/views/menu_options/index.html.erb new file mode 100644 index 0000000..00e56fc --- /dev/null +++ b/rails/app/views/menu_options/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Menu options

+ + + +<%= link_to "New menu option", new_menu_option_path %> diff --git a/rails/app/views/menu_options/index.json.jbuilder b/rails/app/views/menu_options/index.json.jbuilder new file mode 100644 index 0000000..ca87815 --- /dev/null +++ b/rails/app/views/menu_options/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @menu_options, partial: "menu_options/menu_option", as: :menu_option diff --git a/rails/app/views/menu_options/new.html.erb b/rails/app/views/menu_options/new.html.erb new file mode 100644 index 0000000..c190832 --- /dev/null +++ b/rails/app/views/menu_options/new.html.erb @@ -0,0 +1,9 @@ +

New menu option

+ +<%= render "form", menu_option: @menu_option %> + +
+ +
+ <%= link_to "Back to menu options", menu_options_path %> +
diff --git a/rails/app/views/menu_options/show.html.erb b/rails/app/views/menu_options/show.html.erb new file mode 100644 index 0000000..2a704a2 --- /dev/null +++ b/rails/app/views/menu_options/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @menu_option %> + +
+ <%= link_to "Edit this menu option", edit_menu_option_path(@menu_option) %> | + <%= link_to "Back to menu options", menu_options_path %> + + <%= button_to "Destroy this menu option", @menu_option, method: :delete %> +
diff --git a/rails/app/views/menu_options/show.json.jbuilder b/rails/app/views/menu_options/show.json.jbuilder new file mode 100644 index 0000000..757680f --- /dev/null +++ b/rails/app/views/menu_options/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "menu_options/menu_option", menu_option: @menu_option diff --git a/rails/app/views/menus/_form.html.erb b/rails/app/views/menus/_form.html.erb new file mode 100644 index 0000000..ba839db --- /dev/null +++ b/rails/app/views/menus/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_with(model: menu) do |form| %> + <% if menu.errors.any? %> +
+

<%= pluralize(menu.errors.count, "error") %> prohibited this menu from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :name, style: "display: block" %> + <%= form.text_field :name %> +
+ +
+ <%= form.label :setup_id, style: "display: block" %> + <%= form.text_field :setup_id %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/menus/_menu.html.erb b/rails/app/views/menus/_menu.html.erb new file mode 100644 index 0000000..71a8eba --- /dev/null +++ b/rails/app/views/menus/_menu.html.erb @@ -0,0 +1,12 @@ + diff --git a/rails/app/views/menus/_menu.json.jbuilder b/rails/app/views/menus/_menu.json.jbuilder new file mode 100644 index 0000000..eb794d0 --- /dev/null +++ b/rails/app/views/menus/_menu.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! menu, :id, :name, :setup_id, :created_at, :updated_at +json.url menu_url(menu, format: :json) diff --git a/rails/app/views/menus/edit.html.erb b/rails/app/views/menus/edit.html.erb new file mode 100644 index 0000000..38aaf68 --- /dev/null +++ b/rails/app/views/menus/edit.html.erb @@ -0,0 +1,10 @@ +

Editing menu

+ +<%= render "form", menu: @menu %> + +
+ +
+ <%= link_to "Show this menu", @menu %> | + <%= link_to "Back to menus", menus_path %> +
diff --git a/rails/app/views/menus/index.html.erb b/rails/app/views/menus/index.html.erb new file mode 100644 index 0000000..cd5a85d --- /dev/null +++ b/rails/app/views/menus/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Menus

+ + + +<%= link_to "New menu", new_menu_path %> diff --git a/rails/app/views/menus/index.json.jbuilder b/rails/app/views/menus/index.json.jbuilder new file mode 100644 index 0000000..bf0e45f --- /dev/null +++ b/rails/app/views/menus/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @menus, partial: "menus/menu", as: :menu diff --git a/rails/app/views/menus/new.html.erb b/rails/app/views/menus/new.html.erb new file mode 100644 index 0000000..66171fa --- /dev/null +++ b/rails/app/views/menus/new.html.erb @@ -0,0 +1,9 @@ +

New menu

+ +<%= render "form", menu: @menu %> + +
+ +
+ <%= link_to "Back to menus", menus_path %> +
diff --git a/rails/app/views/menus/show.html.erb b/rails/app/views/menus/show.html.erb new file mode 100644 index 0000000..4cb50f8 --- /dev/null +++ b/rails/app/views/menus/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @menu %> + +
+ <%= link_to "Edit this menu", edit_menu_path(@menu) %> | + <%= link_to "Back to menus", menus_path %> + + <%= button_to "Destroy this menu", @menu, method: :delete %> +
diff --git a/rails/app/views/menus/show.json.jbuilder b/rails/app/views/menus/show.json.jbuilder new file mode 100644 index 0000000..ba172bf --- /dev/null +++ b/rails/app/views/menus/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "menus/menu", menu: @menu diff --git a/rails/app/views/setups/_form.html.erb b/rails/app/views/setups/_form.html.erb new file mode 100644 index 0000000..bb01328 --- /dev/null +++ b/rails/app/views/setups/_form.html.erb @@ -0,0 +1,22 @@ +<%= form_with(model: setup) do |form| %> + <% if setup.errors.any? %> +
+

<%= pluralize(setup.errors.count, "error") %> prohibited this setup from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :name, style: "display: block" %> + <%= form.text_field :name %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/setups/_setup.html.erb b/rails/app/views/setups/_setup.html.erb new file mode 100644 index 0000000..fb85511 --- /dev/null +++ b/rails/app/views/setups/_setup.html.erb @@ -0,0 +1,7 @@ +
+

+ Name: + <%= setup.name %> +

+ +
diff --git a/rails/app/views/setups/_setup.json.jbuilder b/rails/app/views/setups/_setup.json.jbuilder new file mode 100644 index 0000000..248d9e6 --- /dev/null +++ b/rails/app/views/setups/_setup.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! setup, :id, :name, :created_at, :updated_at +json.url setup_url(setup, format: :json) diff --git a/rails/app/views/setups/edit.html.erb b/rails/app/views/setups/edit.html.erb new file mode 100644 index 0000000..7c96e2c --- /dev/null +++ b/rails/app/views/setups/edit.html.erb @@ -0,0 +1,10 @@ +

Editing setup

+ +<%= render "form", setup: @setup %> + +
+ +
+ <%= link_to "Show this setup", @setup %> | + <%= link_to "Back to setups", setups_path %> +
diff --git a/rails/app/views/setups/index.html.erb b/rails/app/views/setups/index.html.erb new file mode 100644 index 0000000..cf364d6 --- /dev/null +++ b/rails/app/views/setups/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Setups

+ +
+ <% @setups.each do |setup| %> + <%= render setup %> +

+ <%= link_to "Show this setup", setup %> +

+ <% end %> +
+ +<%= link_to "New setup", new_setup_path %> diff --git a/rails/app/views/setups/index.json.jbuilder b/rails/app/views/setups/index.json.jbuilder new file mode 100644 index 0000000..f82d06e --- /dev/null +++ b/rails/app/views/setups/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @setups, partial: "setups/setup", as: :setup diff --git a/rails/app/views/setups/new.html.erb b/rails/app/views/setups/new.html.erb new file mode 100644 index 0000000..5403baa --- /dev/null +++ b/rails/app/views/setups/new.html.erb @@ -0,0 +1,9 @@ +

New setup

+ +<%= render "form", setup: @setup %> + +
+ +
+ <%= link_to "Back to setups", setups_path %> +
diff --git a/rails/app/views/setups/show.html.erb b/rails/app/views/setups/show.html.erb new file mode 100644 index 0000000..4ee7726 --- /dev/null +++ b/rails/app/views/setups/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @setup %> + +
+ <%= link_to "Edit this setup", edit_setup_path(@setup) %> | + <%= link_to "Back to setups", setups_path %> + + <%= button_to "Destroy this setup", @setup, method: :delete %> +
diff --git a/rails/app/views/setups/show.json.jbuilder b/rails/app/views/setups/show.json.jbuilder new file mode 100644 index 0000000..3876e05 --- /dev/null +++ b/rails/app/views/setups/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "setups/setup", setup: @setup diff --git a/rails/app/views/wheel_options/_form.html.erb b/rails/app/views/wheel_options/_form.html.erb new file mode 100644 index 0000000..368b3bf --- /dev/null +++ b/rails/app/views/wheel_options/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_with(model: wheel_option) do |form| %> + <% if wheel_option.errors.any? %> +
+

<%= pluralize(wheel_option.errors.count, "error") %> prohibited this wheel_option from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :wheel_id, style: "display: block" %> + <%= form.text_field :wheel_id %> +
+ +
+ <%= form.label :batch_id, style: "display: block" %> + <%= form.text_field :batch_id %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/wheel_options/_wheel_option.html.erb b/rails/app/views/wheel_options/_wheel_option.html.erb new file mode 100644 index 0000000..e2378c2 --- /dev/null +++ b/rails/app/views/wheel_options/_wheel_option.html.erb @@ -0,0 +1,12 @@ +
+

+ Wheel: + <%= wheel_option.wheel_id %> +

+ +

+ Batch: + <%= wheel_option.batch_id %> +

+ +
diff --git a/rails/app/views/wheel_options/_wheel_option.json.jbuilder b/rails/app/views/wheel_options/_wheel_option.json.jbuilder new file mode 100644 index 0000000..f97f59c --- /dev/null +++ b/rails/app/views/wheel_options/_wheel_option.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! wheel_option, :id, :wheel_id, :batch_id, :created_at, :updated_at +json.url wheel_option_url(wheel_option, format: :json) diff --git a/rails/app/views/wheel_options/edit.html.erb b/rails/app/views/wheel_options/edit.html.erb new file mode 100644 index 0000000..404b4d6 --- /dev/null +++ b/rails/app/views/wheel_options/edit.html.erb @@ -0,0 +1,10 @@ +

Editing wheel option

+ +<%= render "form", wheel_option: @wheel_option %> + +
+ +
+ <%= link_to "Show this wheel option", @wheel_option %> | + <%= link_to "Back to wheel options", wheel_options_path %> +
diff --git a/rails/app/views/wheel_options/index.html.erb b/rails/app/views/wheel_options/index.html.erb new file mode 100644 index 0000000..3d8ba7d --- /dev/null +++ b/rails/app/views/wheel_options/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Wheel options

+ +
+ <% @wheel_options.each do |wheel_option| %> + <%= render wheel_option %> +

+ <%= link_to "Show this wheel option", wheel_option %> +

+ <% end %> +
+ +<%= link_to "New wheel option", new_wheel_option_path %> diff --git a/rails/app/views/wheel_options/index.json.jbuilder b/rails/app/views/wheel_options/index.json.jbuilder new file mode 100644 index 0000000..5cc4862 --- /dev/null +++ b/rails/app/views/wheel_options/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @wheel_options, partial: "wheel_options/wheel_option", as: :wheel_option diff --git a/rails/app/views/wheel_options/new.html.erb b/rails/app/views/wheel_options/new.html.erb new file mode 100644 index 0000000..fd1b11f --- /dev/null +++ b/rails/app/views/wheel_options/new.html.erb @@ -0,0 +1,9 @@ +

New wheel option

+ +<%= render "form", wheel_option: @wheel_option %> + +
+ +
+ <%= link_to "Back to wheel options", wheel_options_path %> +
diff --git a/rails/app/views/wheel_options/show.html.erb b/rails/app/views/wheel_options/show.html.erb new file mode 100644 index 0000000..7b445d1 --- /dev/null +++ b/rails/app/views/wheel_options/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @wheel_option %> + +
+ <%= link_to "Edit this wheel option", edit_wheel_option_path(@wheel_option) %> | + <%= link_to "Back to wheel options", wheel_options_path %> + + <%= button_to "Destroy this wheel option", @wheel_option, method: :delete %> +
diff --git a/rails/app/views/wheel_options/show.json.jbuilder b/rails/app/views/wheel_options/show.json.jbuilder new file mode 100644 index 0000000..234a007 --- /dev/null +++ b/rails/app/views/wheel_options/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "wheel_options/wheel_option", wheel_option: @wheel_option diff --git a/rails/app/views/wheels/_form.html.erb b/rails/app/views/wheels/_form.html.erb new file mode 100644 index 0000000..09e19b5 --- /dev/null +++ b/rails/app/views/wheels/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_with(model: wheel) do |form| %> + <% if wheel.errors.any? %> +
+

<%= pluralize(wheel.errors.count, "error") %> prohibited this wheel from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :name, style: "display: block" %> + <%= form.text_field :name %> +
+ +
+ <%= form.label :setup_id, style: "display: block" %> + <%= form.text_field :setup_id %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/rails/app/views/wheels/_wheel.html.erb b/rails/app/views/wheels/_wheel.html.erb new file mode 100644 index 0000000..6f3098c --- /dev/null +++ b/rails/app/views/wheels/_wheel.html.erb @@ -0,0 +1,12 @@ +
+

+ Name: + <%= wheel.name %> +

+ +

+ Setup: + <%= wheel.setup_id %> +

+ +
diff --git a/rails/app/views/wheels/_wheel.json.jbuilder b/rails/app/views/wheels/_wheel.json.jbuilder new file mode 100644 index 0000000..3276a84 --- /dev/null +++ b/rails/app/views/wheels/_wheel.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! wheel, :id, :name, :setup_id, :created_at, :updated_at +json.url wheel_url(wheel, format: :json) diff --git a/rails/app/views/wheels/edit.html.erb b/rails/app/views/wheels/edit.html.erb new file mode 100644 index 0000000..3089b2c --- /dev/null +++ b/rails/app/views/wheels/edit.html.erb @@ -0,0 +1,10 @@ +

Editing wheel

+ +<%= render "form", wheel: @wheel %> + +
+ +
+ <%= link_to "Show this wheel", @wheel %> | + <%= link_to "Back to wheels", wheels_path %> +
diff --git a/rails/app/views/wheels/index.html.erb b/rails/app/views/wheels/index.html.erb new file mode 100644 index 0000000..49039c2 --- /dev/null +++ b/rails/app/views/wheels/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Wheels

+ +
+ <% @wheels.each do |wheel| %> + <%= render wheel %> +

+ <%= link_to "Show this wheel", wheel %> +

+ <% end %> +
+ +<%= link_to "New wheel", new_wheel_path %> diff --git a/rails/app/views/wheels/index.json.jbuilder b/rails/app/views/wheels/index.json.jbuilder new file mode 100644 index 0000000..f206f65 --- /dev/null +++ b/rails/app/views/wheels/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @wheels, partial: "wheels/wheel", as: :wheel diff --git a/rails/app/views/wheels/new.html.erb b/rails/app/views/wheels/new.html.erb new file mode 100644 index 0000000..9438de1 --- /dev/null +++ b/rails/app/views/wheels/new.html.erb @@ -0,0 +1,9 @@ +

New wheel

+ +<%= render "form", wheel: @wheel %> + +
+ +
+ <%= link_to "Back to wheels", wheels_path %> +
diff --git a/rails/app/views/wheels/show.html.erb b/rails/app/views/wheels/show.html.erb new file mode 100644 index 0000000..884ff12 --- /dev/null +++ b/rails/app/views/wheels/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @wheel %> + +
+ <%= link_to "Edit this wheel", edit_wheel_path(@wheel) %> | + <%= link_to "Back to wheels", wheels_path %> + + <%= button_to "Destroy this wheel", @wheel, method: :delete %> +
diff --git a/rails/app/views/wheels/show.json.jbuilder b/rails/app/views/wheels/show.json.jbuilder new file mode 100644 index 0000000..4a25d5f --- /dev/null +++ b/rails/app/views/wheels/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "wheels/wheel", wheel: @wheel diff --git a/rails/config/routes.rb b/rails/config/routes.rb index 262ffd5..ddb781a 100644 --- a/rails/config/routes.rb +++ b/rails/config/routes.rb @@ -1,4 +1,16 @@ Rails.application.routes.draw do + resources :actions + resources :executions + resources :datatypes + resources :commands + resources :key_binds + resources :wheel_options + resources :wheels + resources :menu_options + resources :menus + resources :batches + resources :setups + resources :keys # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html # Defines the root path route ("/") diff --git a/rails/db/migrate/20221127130223_create_keys.rb b/rails/db/migrate/20221127130223_create_keys.rb new file mode 100644 index 0000000..9fe2458 --- /dev/null +++ b/rails/db/migrate/20221127130223_create_keys.rb @@ -0,0 +1,78 @@ +class CreateKeys < ActiveRecord::Migration[7.0] + def change + create_table :keys do |t| + t.string :title + t.string :short + t.string :ingame + t.string :keycap + t.timestamps + end + + create_table :setups do |t| + t.string :name + t.timestamps + end + + create_table :batches do |t| + t.timestamps + end + + create_table :menus do |t| + t.string :name + t.references :setup, null: false, foreign_key: true + t.timestamps + end + + create_table :menu_options do |t| + t.references :menu, null: false, foreign_key: true + t.references :batch, null: false, foreign_key: true + t.timestamps + end + + create_table :wheels do |t| + t.string :name + t.references :setup, null: false, foreign_key: true + t.timestamps + end + + create_table :wheel_options do |t| + t.references :wheel, null: false, foreign_key: true + t.references :batch, null: false, foreign_key: true + t.timestamps + end + + create_table :key_binds do |t| + t.references :setup, null: false, foreign_key: true + t.references :key, null: false, foreign_key: true + t.references :batch, null: false, foreign_key: true + t.timestamps + end + + create_table :datatypes do |t| + t.string :name + t.string :regex + t.integer :specifity + t.timestamps + end + + create_table :commands do |t| + t.string :name + t.string :description + t.string :default + t.references :datatype, null: false, foreign_key: true + t.timestamps + end + + create_table :executions do |t| + t.references :command, null: false, foreign_key: true + t.string :value + t.timestamps + end + + create_table :actions do |t| + t.references :batch, null: false, foreign_key: true + t.references :actionable, polymorphic: true, null: false + t.timestamps + end + end +end diff --git a/rails/db/schema.rb b/rails/db/schema.rb index b783f98..eec76c3 100644 --- a/rails/db/schema.rb +++ b/rails/db/schema.rb @@ -10,8 +10,121 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 0) do +ActiveRecord::Schema[7.0].define(version: 2022_11_27_130223) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + create_table "actions", force: :cascade do |t| + t.bigint "batch_id", null: false + t.string "actionable_type", null: false + t.bigint "actionable_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["actionable_type", "actionable_id"], name: "index_actions_on_actionable" + t.index ["batch_id"], name: "index_actions_on_batch_id" + end + + create_table "batches", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "commands", force: :cascade do |t| + t.string "name" + t.string "description" + t.string "default" + t.bigint "datatype_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["datatype_id"], name: "index_commands_on_datatype_id" + end + + create_table "datatypes", force: :cascade do |t| + t.string "name" + t.string "regex" + t.integer "specifity" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "executions", force: :cascade do |t| + t.bigint "command_id", null: false + t.string "value" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["command_id"], name: "index_executions_on_command_id" + end + + create_table "key_binds", force: :cascade do |t| + t.bigint "setup_id", null: false + t.bigint "key_id", null: false + t.bigint "batch_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["batch_id"], name: "index_key_binds_on_batch_id" + t.index ["key_id"], name: "index_key_binds_on_key_id" + t.index ["setup_id"], name: "index_key_binds_on_setup_id" + end + + create_table "keys", force: :cascade do |t| + t.string "title" + t.string "short" + t.string "ingame" + t.string "keycap" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "menu_options", force: :cascade do |t| + t.bigint "menu_id", null: false + t.bigint "batch_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["batch_id"], name: "index_menu_options_on_batch_id" + t.index ["menu_id"], name: "index_menu_options_on_menu_id" + end + + create_table "menus", force: :cascade do |t| + t.string "name" + t.bigint "setup_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["setup_id"], name: "index_menus_on_setup_id" + end + + create_table "setups", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "wheel_options", force: :cascade do |t| + t.bigint "wheel_id", null: false + t.bigint "batch_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["batch_id"], name: "index_wheel_options_on_batch_id" + t.index ["wheel_id"], name: "index_wheel_options_on_wheel_id" + end + + create_table "wheels", force: :cascade do |t| + t.string "name" + t.bigint "setup_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["setup_id"], name: "index_wheels_on_setup_id" + end + + add_foreign_key "actions", "batches" + add_foreign_key "commands", "datatypes" + add_foreign_key "executions", "commands" + add_foreign_key "key_binds", "batches" + add_foreign_key "key_binds", "keys" + add_foreign_key "key_binds", "setups" + add_foreign_key "menu_options", "batches" + add_foreign_key "menu_options", "menus" + add_foreign_key "menus", "setups" + add_foreign_key "wheel_options", "batches" + add_foreign_key "wheel_options", "wheels" + add_foreign_key "wheels", "setups" end diff --git a/rails/db/seeds.rb b/rails/db/seeds.rb index bc25fce..e6010e7 100644 --- a/rails/db/seeds.rb +++ b/rails/db/seeds.rb @@ -1,7 +1,363 @@ -# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). -# -# Examples: -# -# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }]) -# Character.create(name: "Luke", movie: movies.first) +keys = [ + { + ingame: 'escape', + short: 'ESC', + title: 'Escape', + keycap: 'ESC', + }, + { + ingame: 'tab', + short: 'TAB', + title: 'Tabulator', + keycap: '↹', + }, + { + ingame: 'capslock', + short: 'CAPS', + title: 'Capslock', + keycap: '⇪', + }, + { + ingame: 'shift', + short: 'SFT', + title: 'Shift', + keycap: '⇧', + }, + { + ingame: 'ctrl', + short: 'CTL', + title: 'Control', + keycap: 'CTL', + }, + { + ingame: 'alt', + short: 'ALT', + title: 'ALT', + keycap: 'ALT', + }, + { + ingame: 'space', + short: 'SPC', + title: 'Space', + keycap: 'SPACE', + }, + { + ingame: 'backspace', + short: 'BSP', + title: 'Backspace', + keycap: '⇦', + }, + { + ingame: 'enter', + short: 'ENT', + title: 'Enter', + keycap: '↵', + }, + { + ingame: 'semicolon', + short: ';', + title: 'Semicolon', + keycap: ';', + }, + { + ingame: 'lwin', + short: 'LWIN', + title: 'Left Super', + keycap: '⊞', + }, + { + ingame: 'rwin', + short: 'RWIN', + title: 'Right Super', + keycap: '⊞', + }, + { + ingame: 'apps', + short: 'MENU', + title: 'Menu', + keycap: '≡', + }, + { + ingame: 'numlock', + short: 'NUM', + title: 'Numlock', + keycap: 'NUM', + }, + { + ingame: 'scrolllock', + short: 'SCR', + title: 'Scrollock', + keycap: 'SCR', + }, + { + ingame: 'uparrow', + short: 'ARU', + title: 'Arrow Up', + keycap: '↑', + }, + { + ingame: 'downarrow', + short: 'ARD', + title: 'Arrow Down', + keycap: '↓', + }, + { + ingame: 'leftarrow', + short: 'ARL', + title: 'Arrow Left', + keycap: '←', + }, + { + ingame: 'rightarrow', + short: 'ARR', + title: 'Arrow Right', + keycap: '→', + }, + { + ingame: 'ins', + short: 'INS', + title: 'Insert', + keycap: 'INS', + }, + { + ingame: 'del', + short: 'DEL', + title: 'Delete', + keycap: 'DEL', + }, + { + ingame: 'pgdn', + short: 'PGD', + title: 'Page Down', + keycap: '⇣', + }, + { + ingame: 'pgup', + short: 'PGU', + title: 'Page Up', + keycap: '⇡', + }, + { + ingame: 'home', + short: 'HOM', + title: 'Home', + keycap: '⌂', + }, + { + ingame: 'end', + short: 'END', + title: 'End', + keycap: '⇥', + }, + { + ingame: 'pause', + short: 'PAU', + title: 'Pause', + keycap: '⏸', + }, + { + ingame: 'kp_end', + short: 'N1', + title: 'Keypad 1 (End)', + keycap: '1', + }, + { + ingame: 'kp_downarrow', + short: 'N2', + title: 'Keypad 2 (Arrow Down)', + keycap: '2', + }, + { + ingame: 'kp_pgdn', + short: 'N3', + title: 'Keypad 3 (Page Down)', + keycap: '3', + }, + { + ingame: 'kp_leftarrow', + short: 'N4', + title: 'Keypad 4 (Arrow Left)', + keycap: '4', + }, + { + ingame: 'kp_5', + short: 'N5', + title: 'Keypad 5', + keycap: '5', + }, + { + ingame: 'kp_rightarrow', + short: 'N6', + title: 'Keypad 6 (Arrow Right)', + keycap: '6', + }, + { + ingame: 'kp_home', + short: 'N7', + title: 'Keypad 7 (Home)', + keycap: '7', + }, + { + ingame: 'kp_uparrow', + short: 'N8', + title: 'Keypad 8 (Arrow Up)', + keycap: '8', + }, + { + ingame: 'kp_pgup', + short: 'N9', + title: 'Keypad 9 (Page Up)', + keycap: '9', + }, + { + ingame: 'kp_enter', + short: 'NENT', + title: 'Keypad Enter', + keycap: '↵', + }, + { + ingame: 'kp_ins', + short: 'NINS', + title: 'Keypad 0', + keycap: '0', + }, + { + ingame: 'kp_del', + short: 'NDEL', + title: 'Keypad .', + keycap: '.', + }, + { + ingame: 'kp_slash', + short: 'NSL', + title: 'Keypad /', + keycap: '/', + }, + { + ingame: 'kp_multiply', + short: 'NMUL', + title: 'Keypad *', + keycap: '*', + }, + { + ingame: 'kp_minus', + short: 'NMIN', + title: 'Keypad -', + keycap: '-', + }, + { + ingame: 'kp_plus', + short: 'NPLS', + title: 'Keypad +', + keycap: '+', + }, + { + ingame: 'mwheeldown', + short: 'WLD', + title: 'Mousewheel Down', + keycap: '⇟', + }, + { + ingame: 'mwheelup', + short: 'WLU', + title: 'Mousewheel Up', + keycap: '⇞', + }, + { + ingame: 'mouse1', + short: 'M1', + title: 'Mouse 1', + keycap: '🖱️1', + }, + { + ingame: 'mouse2', + short: 'M2', + title: 'Mouse 2', + keycap: '🖱️2', + }, + { + ingame: 'mouse3', + short: 'M3', + title: 'Mouse 3', + keycap: '🖱️3', + }, + { + ingame: 'mouse4', + short: 'M4', + title: 'Mouse 4', + keycap: '🖱️4', + }, + { + ingame: 'mouse5', + short: 'M5', + title: 'Mouse 5', + keycap: '🖱️5', + }, +] +%(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜß,.+-*/#^´<>).each_char do |char| + keys.append({ + ingame: char, + short: char, + title: char, + keycap: char, + }) +end +(1..12).each do |num| + keys.append({ + ingame: "F#{num}", + short: "F#{num}", + title: "Function #{num}", + keycap: "F#{num}", + }) +end +keys.each do |key| + Key + .find_or_initialize_by(ingame: key[:ingame]) + .update!(key) +end + +{ + 'none' => //, + 'string' => /.*/, + 'integer' => /\d+/, + 'float' => /\d+(?:\.\d+)|\.\d+/, +}.each_with_index do |(name, regex), i| + Datatype + .find_or_initialize_by(name: name) + .update!({ + regex: regex.to_s, + specifity: i, + }) +end + +Nokogiri::HTML + .parse( + URI('https://developer.valvesoftware.com/wiki/List_of_L4D2_Cvars').read + ) + .css('#mw-content-text pre') + .collect(&:content) + .join("\n") + .split("\n") + .each do |line| + next if line.blank? + name, default, flags, description = line.split(' :') + name.strip! && default.strip! && flags.strip! && description.strip! + flags = flags.strip.split(', ')[1..] # TODO + Command + .find_or_initialize_by(name: name.strip) + .update!({ + name: name, + description: description, + default: default == 'cmd' ? nil : default, + datatype: + if default == 'cmd' + Datatype.find_by!(name: 'none') + else + Datatype + .order(specifity: :asc) + .find{ |datatype| + datatype.match? default + } or raise(default) + end, + }) + end diff --git a/rails/test/controllers/actions_controller_test.rb b/rails/test/controllers/actions_controller_test.rb new file mode 100644 index 0000000..fca502c --- /dev/null +++ b/rails/test/controllers/actions_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class ActionsControllerTest < ActionDispatch::IntegrationTest + setup do + @action = actions(:one) + end + + test "should get index" do + get actions_url + assert_response :success + end + + test "should get new" do + get new_action_url + assert_response :success + end + + test "should create action" do + assert_difference("Action.count") do + post actions_url, params: { action: { actionable_id: @action.actionable_id, actionable_type: @action.actionable_type, batch_id: @action.batch_id } } + end + + assert_redirected_to action_url(Action.last) + end + + test "should show action" do + get action_url(@action) + assert_response :success + end + + test "should get edit" do + get edit_action_url(@action) + assert_response :success + end + + test "should update action" do + patch action_url(@action), params: { action: { actionable_id: @action.actionable_id, actionable_type: @action.actionable_type, batch_id: @action.batch_id } } + assert_redirected_to action_url(@action) + end + + test "should destroy action" do + assert_difference("Action.count", -1) do + delete action_url(@action) + end + + assert_redirected_to actions_url + end +end diff --git a/rails/test/controllers/batches_controller_test.rb b/rails/test/controllers/batches_controller_test.rb new file mode 100644 index 0000000..9c73181 --- /dev/null +++ b/rails/test/controllers/batches_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class BatchesControllerTest < ActionDispatch::IntegrationTest + setup do + @batch = batches(:one) + end + + test "should get index" do + get batches_url + assert_response :success + end + + test "should get new" do + get new_batch_url + assert_response :success + end + + test "should create batch" do + assert_difference("Batch.count") do + post batches_url, params: { batch: { } } + end + + assert_redirected_to batch_url(Batch.last) + end + + test "should show batch" do + get batch_url(@batch) + assert_response :success + end + + test "should get edit" do + get edit_batch_url(@batch) + assert_response :success + end + + test "should update batch" do + patch batch_url(@batch), params: { batch: { } } + assert_redirected_to batch_url(@batch) + end + + test "should destroy batch" do + assert_difference("Batch.count", -1) do + delete batch_url(@batch) + end + + assert_redirected_to batches_url + end +end diff --git a/rails/test/controllers/commands_controller_test.rb b/rails/test/controllers/commands_controller_test.rb new file mode 100644 index 0000000..0d580f0 --- /dev/null +++ b/rails/test/controllers/commands_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class CommandsControllerTest < ActionDispatch::IntegrationTest + setup do + @command = commands(:one) + end + + test "should get index" do + get commands_url + assert_response :success + end + + test "should get new" do + get new_command_url + assert_response :success + end + + test "should create command" do + assert_difference("Command.count") do + post commands_url, params: { command: { datatype_id: @command.datatype_id, name: @command.name } } + end + + assert_redirected_to command_url(Command.last) + end + + test "should show command" do + get command_url(@command) + assert_response :success + end + + test "should get edit" do + get edit_command_url(@command) + assert_response :success + end + + test "should update command" do + patch command_url(@command), params: { command: { datatype_id: @command.datatype_id, name: @command.name } } + assert_redirected_to command_url(@command) + end + + test "should destroy command" do + assert_difference("Command.count", -1) do + delete command_url(@command) + end + + assert_redirected_to commands_url + end +end diff --git a/rails/test/controllers/datatypes_controller_test.rb b/rails/test/controllers/datatypes_controller_test.rb new file mode 100644 index 0000000..252e962 --- /dev/null +++ b/rails/test/controllers/datatypes_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class DatatypesControllerTest < ActionDispatch::IntegrationTest + setup do + @datatype = datatypes(:one) + end + + test "should get index" do + get datatypes_url + assert_response :success + end + + test "should get new" do + get new_datatype_url + assert_response :success + end + + test "should create datatype" do + assert_difference("Datatype.count") do + post datatypes_url, params: { datatype: { name: @datatype.name, regex: @datatype.regex } } + end + + assert_redirected_to datatype_url(Datatype.last) + end + + test "should show datatype" do + get datatype_url(@datatype) + assert_response :success + end + + test "should get edit" do + get edit_datatype_url(@datatype) + assert_response :success + end + + test "should update datatype" do + patch datatype_url(@datatype), params: { datatype: { name: @datatype.name, regex: @datatype.regex } } + assert_redirected_to datatype_url(@datatype) + end + + test "should destroy datatype" do + assert_difference("Datatype.count", -1) do + delete datatype_url(@datatype) + end + + assert_redirected_to datatypes_url + end +end diff --git a/rails/test/controllers/executions_controller_test.rb b/rails/test/controllers/executions_controller_test.rb new file mode 100644 index 0000000..cc1dd05 --- /dev/null +++ b/rails/test/controllers/executions_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class ExecutionsControllerTest < ActionDispatch::IntegrationTest + setup do + @execution = executions(:one) + end + + test "should get index" do + get executions_url + assert_response :success + end + + test "should get new" do + get new_execution_url + assert_response :success + end + + test "should create execution" do + assert_difference("Execution.count") do + post executions_url, params: { execution: { command_id: @execution.command_id, value: @execution.value } } + end + + assert_redirected_to execution_url(Execution.last) + end + + test "should show execution" do + get execution_url(@execution) + assert_response :success + end + + test "should get edit" do + get edit_execution_url(@execution) + assert_response :success + end + + test "should update execution" do + patch execution_url(@execution), params: { execution: { command_id: @execution.command_id, value: @execution.value } } + assert_redirected_to execution_url(@execution) + end + + test "should destroy execution" do + assert_difference("Execution.count", -1) do + delete execution_url(@execution) + end + + assert_redirected_to executions_url + end +end diff --git a/rails/test/controllers/key_binds_controller_test.rb b/rails/test/controllers/key_binds_controller_test.rb new file mode 100644 index 0000000..a90143d --- /dev/null +++ b/rails/test/controllers/key_binds_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class KeyBindsControllerTest < ActionDispatch::IntegrationTest + setup do + @key_bind = key_binds(:one) + end + + test "should get index" do + get key_binds_url + assert_response :success + end + + test "should get new" do + get new_key_bind_url + assert_response :success + end + + test "should create key_bind" do + assert_difference("KeyBind.count") do + post key_binds_url, params: { key_bind: { batch_id: @key_bind.batch_id, key_id: @key_bind.key_id, setup_id: @key_bind.setup_id } } + end + + assert_redirected_to key_bind_url(KeyBind.last) + end + + test "should show key_bind" do + get key_bind_url(@key_bind) + assert_response :success + end + + test "should get edit" do + get edit_key_bind_url(@key_bind) + assert_response :success + end + + test "should update key_bind" do + patch key_bind_url(@key_bind), params: { key_bind: { batch_id: @key_bind.batch_id, key_id: @key_bind.key_id, setup_id: @key_bind.setup_id } } + assert_redirected_to key_bind_url(@key_bind) + end + + test "should destroy key_bind" do + assert_difference("KeyBind.count", -1) do + delete key_bind_url(@key_bind) + end + + assert_redirected_to key_binds_url + end +end diff --git a/rails/test/controllers/keys_controller_test.rb b/rails/test/controllers/keys_controller_test.rb new file mode 100644 index 0000000..5215d02 --- /dev/null +++ b/rails/test/controllers/keys_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class KeysControllerTest < ActionDispatch::IntegrationTest + setup do + @key = keys(:one) + end + + test "should get index" do + get keys_url + assert_response :success + end + + test "should get new" do + get new_key_url + assert_response :success + end + + test "should create key" do + assert_difference("Key.count") do + post keys_url, params: { key: { ingame: @key.ingame, keycap: @key.keycap, short: @key.short, title: @key.title } } + end + + assert_redirected_to key_url(Key.last) + end + + test "should show key" do + get key_url(@key) + assert_response :success + end + + test "should get edit" do + get edit_key_url(@key) + assert_response :success + end + + test "should update key" do + patch key_url(@key), params: { key: { ingame: @key.ingame, keycap: @key.keycap, short: @key.short, title: @key.title } } + assert_redirected_to key_url(@key) + end + + test "should destroy key" do + assert_difference("Key.count", -1) do + delete key_url(@key) + end + + assert_redirected_to keys_url + end +end diff --git a/rails/test/controllers/menu_options_controller_test.rb b/rails/test/controllers/menu_options_controller_test.rb new file mode 100644 index 0000000..05bc6e5 --- /dev/null +++ b/rails/test/controllers/menu_options_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class MenuOptionsControllerTest < ActionDispatch::IntegrationTest + setup do + @menu_option = menu_options(:one) + end + + test "should get index" do + get menu_options_url + assert_response :success + end + + test "should get new" do + get new_menu_option_url + assert_response :success + end + + test "should create menu_option" do + assert_difference("MenuOption.count") do + post menu_options_url, params: { menu_option: { batch_id: @menu_option.batch_id, menu_id: @menu_option.menu_id } } + end + + assert_redirected_to menu_option_url(MenuOption.last) + end + + test "should show menu_option" do + get menu_option_url(@menu_option) + assert_response :success + end + + test "should get edit" do + get edit_menu_option_url(@menu_option) + assert_response :success + end + + test "should update menu_option" do + patch menu_option_url(@menu_option), params: { menu_option: { batch_id: @menu_option.batch_id, menu_id: @menu_option.menu_id } } + assert_redirected_to menu_option_url(@menu_option) + end + + test "should destroy menu_option" do + assert_difference("MenuOption.count", -1) do + delete menu_option_url(@menu_option) + end + + assert_redirected_to menu_options_url + end +end diff --git a/rails/test/controllers/menus_controller_test.rb b/rails/test/controllers/menus_controller_test.rb new file mode 100644 index 0000000..88adaba --- /dev/null +++ b/rails/test/controllers/menus_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class MenusControllerTest < ActionDispatch::IntegrationTest + setup do + @menu = menus(:one) + end + + test "should get index" do + get menus_url + assert_response :success + end + + test "should get new" do + get new_menu_url + assert_response :success + end + + test "should create menu" do + assert_difference("Menu.count") do + post menus_url, params: { menu: { name: @menu.name, setup_id: @menu.setup_id } } + end + + assert_redirected_to menu_url(Menu.last) + end + + test "should show menu" do + get menu_url(@menu) + assert_response :success + end + + test "should get edit" do + get edit_menu_url(@menu) + assert_response :success + end + + test "should update menu" do + patch menu_url(@menu), params: { menu: { name: @menu.name, setup_id: @menu.setup_id } } + assert_redirected_to menu_url(@menu) + end + + test "should destroy menu" do + assert_difference("Menu.count", -1) do + delete menu_url(@menu) + end + + assert_redirected_to menus_url + end +end diff --git a/rails/test/controllers/setups_controller_test.rb b/rails/test/controllers/setups_controller_test.rb new file mode 100644 index 0000000..fc9d8fb --- /dev/null +++ b/rails/test/controllers/setups_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class SetupsControllerTest < ActionDispatch::IntegrationTest + setup do + @setup = setups(:one) + end + + test "should get index" do + get setups_url + assert_response :success + end + + test "should get new" do + get new_setup_url + assert_response :success + end + + test "should create setup" do + assert_difference("Setup.count") do + post setups_url, params: { setup: { name: @setup.name } } + end + + assert_redirected_to setup_url(Setup.last) + end + + test "should show setup" do + get setup_url(@setup) + assert_response :success + end + + test "should get edit" do + get edit_setup_url(@setup) + assert_response :success + end + + test "should update setup" do + patch setup_url(@setup), params: { setup: { name: @setup.name } } + assert_redirected_to setup_url(@setup) + end + + test "should destroy setup" do + assert_difference("Setup.count", -1) do + delete setup_url(@setup) + end + + assert_redirected_to setups_url + end +end diff --git a/rails/test/controllers/wheel_options_controller_test.rb b/rails/test/controllers/wheel_options_controller_test.rb new file mode 100644 index 0000000..3e78eb1 --- /dev/null +++ b/rails/test/controllers/wheel_options_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class WheelOptionsControllerTest < ActionDispatch::IntegrationTest + setup do + @wheel_option = wheel_options(:one) + end + + test "should get index" do + get wheel_options_url + assert_response :success + end + + test "should get new" do + get new_wheel_option_url + assert_response :success + end + + test "should create wheel_option" do + assert_difference("WheelOption.count") do + post wheel_options_url, params: { wheel_option: { batch_id: @wheel_option.batch_id, wheel_id: @wheel_option.wheel_id } } + end + + assert_redirected_to wheel_option_url(WheelOption.last) + end + + test "should show wheel_option" do + get wheel_option_url(@wheel_option) + assert_response :success + end + + test "should get edit" do + get edit_wheel_option_url(@wheel_option) + assert_response :success + end + + test "should update wheel_option" do + patch wheel_option_url(@wheel_option), params: { wheel_option: { batch_id: @wheel_option.batch_id, wheel_id: @wheel_option.wheel_id } } + assert_redirected_to wheel_option_url(@wheel_option) + end + + test "should destroy wheel_option" do + assert_difference("WheelOption.count", -1) do + delete wheel_option_url(@wheel_option) + end + + assert_redirected_to wheel_options_url + end +end diff --git a/rails/test/controllers/wheels_controller_test.rb b/rails/test/controllers/wheels_controller_test.rb new file mode 100644 index 0000000..9ecba7d --- /dev/null +++ b/rails/test/controllers/wheels_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class WheelsControllerTest < ActionDispatch::IntegrationTest + setup do + @wheel = wheels(:one) + end + + test "should get index" do + get wheels_url + assert_response :success + end + + test "should get new" do + get new_wheel_url + assert_response :success + end + + test "should create wheel" do + assert_difference("Wheel.count") do + post wheels_url, params: { wheel: { name: @wheel.name, setup_id: @wheel.setup_id } } + end + + assert_redirected_to wheel_url(Wheel.last) + end + + test "should show wheel" do + get wheel_url(@wheel) + assert_response :success + end + + test "should get edit" do + get edit_wheel_url(@wheel) + assert_response :success + end + + test "should update wheel" do + patch wheel_url(@wheel), params: { wheel: { name: @wheel.name, setup_id: @wheel.setup_id } } + assert_redirected_to wheel_url(@wheel) + end + + test "should destroy wheel" do + assert_difference("Wheel.count", -1) do + delete wheel_url(@wheel) + end + + assert_redirected_to wheels_url + end +end diff --git a/rails/test/fixtures/actions.yml b/rails/test/fixtures/actions.yml new file mode 100644 index 0000000..4e98345 --- /dev/null +++ b/rails/test/fixtures/actions.yml @@ -0,0 +1,11 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + batch: one + actionable: one + actionable_type: Actionable + +two: + batch: two + actionable: two + actionable_type: Actionable diff --git a/rails/test/fixtures/batches.yml b/rails/test/fixtures/batches.yml new file mode 100644 index 0000000..d7a3329 --- /dev/null +++ b/rails/test/fixtures/batches.yml @@ -0,0 +1,11 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the "{}" from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/rails/test/fixtures/commands.yml b/rails/test/fixtures/commands.yml new file mode 100644 index 0000000..ae723e6 --- /dev/null +++ b/rails/test/fixtures/commands.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + datatype: one + +two: + name: MyString + datatype: two diff --git a/rails/test/fixtures/datatypes.yml b/rails/test/fixtures/datatypes.yml new file mode 100644 index 0000000..5f5c392 --- /dev/null +++ b/rails/test/fixtures/datatypes.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + regex: MyString + +two: + name: MyString + regex: MyString diff --git a/rails/test/fixtures/executions.yml b/rails/test/fixtures/executions.yml new file mode 100644 index 0000000..8681eaa --- /dev/null +++ b/rails/test/fixtures/executions.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + command: one + value: MyString + +two: + command: two + value: MyString diff --git a/rails/test/fixtures/key_binds.yml b/rails/test/fixtures/key_binds.yml new file mode 100644 index 0000000..fd93934 --- /dev/null +++ b/rails/test/fixtures/key_binds.yml @@ -0,0 +1,11 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + setup: one + key: one + batch: one + +two: + setup: two + key: two + batch: two diff --git a/rails/test/fixtures/keys.yml b/rails/test/fixtures/keys.yml new file mode 100644 index 0000000..1493ba8 --- /dev/null +++ b/rails/test/fixtures/keys.yml @@ -0,0 +1,13 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + title: MyString + short: MyString + ingame: MyString + keycap: MyString + +two: + title: MyString + short: MyString + ingame: MyString + keycap: MyString diff --git a/rails/test/fixtures/menu_options.yml b/rails/test/fixtures/menu_options.yml new file mode 100644 index 0000000..aee0ab0 --- /dev/null +++ b/rails/test/fixtures/menu_options.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + menu: one + batch: one + +two: + menu: two + batch: two diff --git a/rails/test/fixtures/menus.yml b/rails/test/fixtures/menus.yml new file mode 100644 index 0000000..86639d4 --- /dev/null +++ b/rails/test/fixtures/menus.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + setup: one + +two: + name: MyString + setup: two diff --git a/rails/test/fixtures/setups.yml b/rails/test/fixtures/setups.yml new file mode 100644 index 0000000..7d41224 --- /dev/null +++ b/rails/test/fixtures/setups.yml @@ -0,0 +1,7 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + +two: + name: MyString diff --git a/rails/test/fixtures/wheel_options.yml b/rails/test/fixtures/wheel_options.yml new file mode 100644 index 0000000..b937657 --- /dev/null +++ b/rails/test/fixtures/wheel_options.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + wheel: one + batch: one + +two: + wheel: two + batch: two diff --git a/rails/test/fixtures/wheels.yml b/rails/test/fixtures/wheels.yml new file mode 100644 index 0000000..86639d4 --- /dev/null +++ b/rails/test/fixtures/wheels.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + setup: one + +two: + name: MyString + setup: two diff --git a/rails/test/models/action_test.rb b/rails/test/models/action_test.rb new file mode 100644 index 0000000..585c5df --- /dev/null +++ b/rails/test/models/action_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ActionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/batch_test.rb b/rails/test/models/batch_test.rb new file mode 100644 index 0000000..0f2e19f --- /dev/null +++ b/rails/test/models/batch_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class BatchTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/command_test.rb b/rails/test/models/command_test.rb new file mode 100644 index 0000000..05da7ee --- /dev/null +++ b/rails/test/models/command_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class CommandTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/datatype_test.rb b/rails/test/models/datatype_test.rb new file mode 100644 index 0000000..30957d1 --- /dev/null +++ b/rails/test/models/datatype_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class DatatypeTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/execution_test.rb b/rails/test/models/execution_test.rb new file mode 100644 index 0000000..171193c --- /dev/null +++ b/rails/test/models/execution_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ExecutionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/key_bind_test.rb b/rails/test/models/key_bind_test.rb new file mode 100644 index 0000000..862556e --- /dev/null +++ b/rails/test/models/key_bind_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class KeyBindTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/key_test.rb b/rails/test/models/key_test.rb new file mode 100644 index 0000000..6ec7845 --- /dev/null +++ b/rails/test/models/key_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class KeyTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/menu_option_test.rb b/rails/test/models/menu_option_test.rb new file mode 100644 index 0000000..4529338 --- /dev/null +++ b/rails/test/models/menu_option_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class MenuOptionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/menu_test.rb b/rails/test/models/menu_test.rb new file mode 100644 index 0000000..1cc65fc --- /dev/null +++ b/rails/test/models/menu_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class MenuTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/setup_test.rb b/rails/test/models/setup_test.rb new file mode 100644 index 0000000..bf78066 --- /dev/null +++ b/rails/test/models/setup_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class SetupTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/wheel_option_test.rb b/rails/test/models/wheel_option_test.rb new file mode 100644 index 0000000..eaa1b05 --- /dev/null +++ b/rails/test/models/wheel_option_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class WheelOptionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/models/wheel_test.rb b/rails/test/models/wheel_test.rb new file mode 100644 index 0000000..a900fa3 --- /dev/null +++ b/rails/test/models/wheel_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class WheelTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/rails/test/system/actions_test.rb b/rails/test/system/actions_test.rb new file mode 100644 index 0000000..485d49b --- /dev/null +++ b/rails/test/system/actions_test.rb @@ -0,0 +1,45 @@ +require "application_system_test_case" + +class ActionsTest < ApplicationSystemTestCase + setup do + @action = actions(:one) + end + + test "visiting the index" do + visit actions_url + assert_selector "h1", text: "Actions" + end + + test "should create action" do + visit actions_url + click_on "New action" + + fill_in "Actionable", with: @action.actionable_id + fill_in "Actionable type", with: @action.actionable_type + fill_in "Batch", with: @action.batch_id + click_on "Create Action" + + assert_text "Action was successfully created" + click_on "Back" + end + + test "should update Action" do + visit action_url(@action) + click_on "Edit this action", match: :first + + fill_in "Actionable", with: @action.actionable_id + fill_in "Actionable type", with: @action.actionable_type + fill_in "Batch", with: @action.batch_id + click_on "Update Action" + + assert_text "Action was successfully updated" + click_on "Back" + end + + test "should destroy Action" do + visit action_url(@action) + click_on "Destroy this action", match: :first + + assert_text "Action was successfully destroyed" + end +end diff --git a/rails/test/system/batches_test.rb b/rails/test/system/batches_test.rb new file mode 100644 index 0000000..93a31b6 --- /dev/null +++ b/rails/test/system/batches_test.rb @@ -0,0 +1,39 @@ +require "application_system_test_case" + +class BatchesTest < ApplicationSystemTestCase + setup do + @batch = batches(:one) + end + + test "visiting the index" do + visit batches_url + assert_selector "h1", text: "Batches" + end + + test "should create batch" do + visit batches_url + click_on "New batch" + + click_on "Create Batch" + + assert_text "Batch was successfully created" + click_on "Back" + end + + test "should update Batch" do + visit batch_url(@batch) + click_on "Edit this batch", match: :first + + click_on "Update Batch" + + assert_text "Batch was successfully updated" + click_on "Back" + end + + test "should destroy Batch" do + visit batch_url(@batch) + click_on "Destroy this batch", match: :first + + assert_text "Batch was successfully destroyed" + end +end diff --git a/rails/test/system/commands_test.rb b/rails/test/system/commands_test.rb new file mode 100644 index 0000000..11dda36 --- /dev/null +++ b/rails/test/system/commands_test.rb @@ -0,0 +1,43 @@ +require "application_system_test_case" + +class CommandsTest < ApplicationSystemTestCase + setup do + @command = commands(:one) + end + + test "visiting the index" do + visit commands_url + assert_selector "h1", text: "Commands" + end + + test "should create command" do + visit commands_url + click_on "New command" + + fill_in "Datatype", with: @command.datatype_id + fill_in "Name", with: @command.name + click_on "Create Command" + + assert_text "Command was successfully created" + click_on "Back" + end + + test "should update Command" do + visit command_url(@command) + click_on "Edit this command", match: :first + + fill_in "Datatype", with: @command.datatype_id + fill_in "Name", with: @command.name + click_on "Update Command" + + assert_text "Command was successfully updated" + click_on "Back" + end + + test "should destroy Command" do + visit command_url(@command) + click_on "Destroy this command", match: :first + + assert_text "Command was successfully destroyed" + end +end diff --git a/rails/test/system/datatypes_test.rb b/rails/test/system/datatypes_test.rb new file mode 100644 index 0000000..33851b3 --- /dev/null +++ b/rails/test/system/datatypes_test.rb @@ -0,0 +1,43 @@ +require "application_system_test_case" + +class DatatypesTest < ApplicationSystemTestCase + setup do + @datatype = datatypes(:one) + end + + test "visiting the index" do + visit datatypes_url + assert_selector "h1", text: "Datatypes" + end + + test "should create datatype" do + visit datatypes_url + click_on "New datatype" + + fill_in "Name", with: @datatype.name + fill_in "Regex", with: @datatype.regex + click_on "Create Datatype" + + assert_text "Datatype was successfully created" + click_on "Back" + end + + test "should update Datatype" do + visit datatype_url(@datatype) + click_on "Edit this datatype", match: :first + + fill_in "Name", with: @datatype.name + fill_in "Regex", with: @datatype.regex + click_on "Update Datatype" + + assert_text "Datatype was successfully updated" + click_on "Back" + end + + test "should destroy Datatype" do + visit datatype_url(@datatype) + click_on "Destroy this datatype", match: :first + + assert_text "Datatype was successfully destroyed" + end +end diff --git a/rails/test/system/executions_test.rb b/rails/test/system/executions_test.rb new file mode 100644 index 0000000..3030f52 --- /dev/null +++ b/rails/test/system/executions_test.rb @@ -0,0 +1,43 @@ +require "application_system_test_case" + +class ExecutionsTest < ApplicationSystemTestCase + setup do + @execution = executions(:one) + end + + test "visiting the index" do + visit executions_url + assert_selector "h1", text: "Executions" + end + + test "should create execution" do + visit executions_url + click_on "New execution" + + fill_in "Command", with: @execution.command_id + fill_in "Value", with: @execution.value + click_on "Create Execution" + + assert_text "Execution was successfully created" + click_on "Back" + end + + test "should update Execution" do + visit execution_url(@execution) + click_on "Edit this execution", match: :first + + fill_in "Command", with: @execution.command_id + fill_in "Value", with: @execution.value + click_on "Update Execution" + + assert_text "Execution was successfully updated" + click_on "Back" + end + + test "should destroy Execution" do + visit execution_url(@execution) + click_on "Destroy this execution", match: :first + + assert_text "Execution was successfully destroyed" + end +end diff --git a/rails/test/system/key_binds_test.rb b/rails/test/system/key_binds_test.rb new file mode 100644 index 0000000..ead496d --- /dev/null +++ b/rails/test/system/key_binds_test.rb @@ -0,0 +1,45 @@ +require "application_system_test_case" + +class KeyBindsTest < ApplicationSystemTestCase + setup do + @key_bind = key_binds(:one) + end + + test "visiting the index" do + visit key_binds_url + assert_selector "h1", text: "Key binds" + end + + test "should create key bind" do + visit key_binds_url + click_on "New key bind" + + fill_in "Batch", with: @key_bind.batch_id + fill_in "Key", with: @key_bind.key_id + fill_in "Setup", with: @key_bind.setup_id + click_on "Create Key bind" + + assert_text "Key bind was successfully created" + click_on "Back" + end + + test "should update Key bind" do + visit key_bind_url(@key_bind) + click_on "Edit this key bind", match: :first + + fill_in "Batch", with: @key_bind.batch_id + fill_in "Key", with: @key_bind.key_id + fill_in "Setup", with: @key_bind.setup_id + click_on "Update Key bind" + + assert_text "Key bind was successfully updated" + click_on "Back" + end + + test "should destroy Key bind" do + visit key_bind_url(@key_bind) + click_on "Destroy this key bind", match: :first + + assert_text "Key bind was successfully destroyed" + end +end diff --git a/rails/test/system/keys_test.rb b/rails/test/system/keys_test.rb new file mode 100644 index 0000000..7a77c83 --- /dev/null +++ b/rails/test/system/keys_test.rb @@ -0,0 +1,47 @@ +require "application_system_test_case" + +class KeysTest < ApplicationSystemTestCase + setup do + @key = keys(:one) + end + + test "visiting the index" do + visit keys_url + assert_selector "h1", text: "Keys" + end + + test "should create key" do + visit keys_url + click_on "New key" + + fill_in "Ingame", with: @key.ingame + fill_in "Keycap", with: @key.keycap + fill_in "Short", with: @key.short + fill_in "Title", with: @key.title + click_on "Create Key" + + assert_text "Key was successfully created" + click_on "Back" + end + + test "should update Key" do + visit key_url(@key) + click_on "Edit this key", match: :first + + fill_in "Ingame", with: @key.ingame + fill_in "Keycap", with: @key.keycap + fill_in "Short", with: @key.short + fill_in "Title", with: @key.title + click_on "Update Key" + + assert_text "Key was successfully updated" + click_on "Back" + end + + test "should destroy Key" do + visit key_url(@key) + click_on "Destroy this key", match: :first + + assert_text "Key was successfully destroyed" + end +end diff --git a/rails/test/system/menu_options_test.rb b/rails/test/system/menu_options_test.rb new file mode 100644 index 0000000..bd37f48 --- /dev/null +++ b/rails/test/system/menu_options_test.rb @@ -0,0 +1,43 @@ +require "application_system_test_case" + +class MenuOptionsTest < ApplicationSystemTestCase + setup do + @menu_option = menu_options(:one) + end + + test "visiting the index" do + visit menu_options_url + assert_selector "h1", text: "Menu options" + end + + test "should create menu option" do + visit menu_options_url + click_on "New menu option" + + fill_in "Batch", with: @menu_option.batch_id + fill_in "Menu", with: @menu_option.menu_id + click_on "Create Menu option" + + assert_text "Menu option was successfully created" + click_on "Back" + end + + test "should update Menu option" do + visit menu_option_url(@menu_option) + click_on "Edit this menu option", match: :first + + fill_in "Batch", with: @menu_option.batch_id + fill_in "Menu", with: @menu_option.menu_id + click_on "Update Menu option" + + assert_text "Menu option was successfully updated" + click_on "Back" + end + + test "should destroy Menu option" do + visit menu_option_url(@menu_option) + click_on "Destroy this menu option", match: :first + + assert_text "Menu option was successfully destroyed" + end +end diff --git a/rails/test/system/menus_test.rb b/rails/test/system/menus_test.rb new file mode 100644 index 0000000..975bb41 --- /dev/null +++ b/rails/test/system/menus_test.rb @@ -0,0 +1,43 @@ +require "application_system_test_case" + +class MenusTest < ApplicationSystemTestCase + setup do + @menu = menus(:one) + end + + test "visiting the index" do + visit menus_url + assert_selector "h1", text: "Menus" + end + + test "should create menu" do + visit menus_url + click_on "New menu" + + fill_in "Name", with: @menu.name + fill_in "Setup", with: @menu.setup_id + click_on "Create Menu" + + assert_text "Menu was successfully created" + click_on "Back" + end + + test "should update Menu" do + visit menu_url(@menu) + click_on "Edit this menu", match: :first + + fill_in "Name", with: @menu.name + fill_in "Setup", with: @menu.setup_id + click_on "Update Menu" + + assert_text "Menu was successfully updated" + click_on "Back" + end + + test "should destroy Menu" do + visit menu_url(@menu) + click_on "Destroy this menu", match: :first + + assert_text "Menu was successfully destroyed" + end +end diff --git a/rails/test/system/setups_test.rb b/rails/test/system/setups_test.rb new file mode 100644 index 0000000..7e99022 --- /dev/null +++ b/rails/test/system/setups_test.rb @@ -0,0 +1,41 @@ +require "application_system_test_case" + +class SetupsTest < ApplicationSystemTestCase + setup do + @setup = setups(:one) + end + + test "visiting the index" do + visit setups_url + assert_selector "h1", text: "Setups" + end + + test "should create setup" do + visit setups_url + click_on "New setup" + + fill_in "Name", with: @setup.name + click_on "Create Setup" + + assert_text "Setup was successfully created" + click_on "Back" + end + + test "should update Setup" do + visit setup_url(@setup) + click_on "Edit this setup", match: :first + + fill_in "Name", with: @setup.name + click_on "Update Setup" + + assert_text "Setup was successfully updated" + click_on "Back" + end + + test "should destroy Setup" do + visit setup_url(@setup) + click_on "Destroy this setup", match: :first + + assert_text "Setup was successfully destroyed" + end +end diff --git a/rails/test/system/wheel_options_test.rb b/rails/test/system/wheel_options_test.rb new file mode 100644 index 0000000..9fc1534 --- /dev/null +++ b/rails/test/system/wheel_options_test.rb @@ -0,0 +1,43 @@ +require "application_system_test_case" + +class WheelOptionsTest < ApplicationSystemTestCase + setup do + @wheel_option = wheel_options(:one) + end + + test "visiting the index" do + visit wheel_options_url + assert_selector "h1", text: "Wheel options" + end + + test "should create wheel option" do + visit wheel_options_url + click_on "New wheel option" + + fill_in "Batch", with: @wheel_option.batch_id + fill_in "Wheel", with: @wheel_option.wheel_id + click_on "Create Wheel option" + + assert_text "Wheel option was successfully created" + click_on "Back" + end + + test "should update Wheel option" do + visit wheel_option_url(@wheel_option) + click_on "Edit this wheel option", match: :first + + fill_in "Batch", with: @wheel_option.batch_id + fill_in "Wheel", with: @wheel_option.wheel_id + click_on "Update Wheel option" + + assert_text "Wheel option was successfully updated" + click_on "Back" + end + + test "should destroy Wheel option" do + visit wheel_option_url(@wheel_option) + click_on "Destroy this wheel option", match: :first + + assert_text "Wheel option was successfully destroyed" + end +end diff --git a/rails/test/system/wheels_test.rb b/rails/test/system/wheels_test.rb new file mode 100644 index 0000000..a71bb78 --- /dev/null +++ b/rails/test/system/wheels_test.rb @@ -0,0 +1,43 @@ +require "application_system_test_case" + +class WheelsTest < ApplicationSystemTestCase + setup do + @wheel = wheels(:one) + end + + test "visiting the index" do + visit wheels_url + assert_selector "h1", text: "Wheels" + end + + test "should create wheel" do + visit wheels_url + click_on "New wheel" + + fill_in "Name", with: @wheel.name + fill_in "Setup", with: @wheel.setup_id + click_on "Create Wheel" + + assert_text "Wheel was successfully created" + click_on "Back" + end + + test "should update Wheel" do + visit wheel_url(@wheel) + click_on "Edit this wheel", match: :first + + fill_in "Name", with: @wheel.name + fill_in "Setup", with: @wheel.setup_id + click_on "Update Wheel" + + assert_text "Wheel was successfully updated" + click_on "Back" + end + + test "should destroy Wheel" do + visit wheel_url(@wheel) + click_on "Destroy this wheel", match: :first + + assert_text "Wheel was successfully destroyed" + end +end diff --git a/temp1/addoninfo.txt b/temp1/addoninfo.txt new file mode 100644 index 0000000..ec5ccaf --- /dev/null +++ b/temp1/addoninfo.txt @@ -0,0 +1,15 @@ +// The addoninfo.txt file is a metadata file that is required by all Source Engine Add-ons. + +"AddonInfo" +{ + addonSteamAppID 500 + addontitle "Detect Bunnyhop" + addonversion 1.0 + addontagline "buunyhop" + addonauthor "mt2" + addonauthorSteamID "STEAM_1:0:53913343" + addonURL0 "" + + // short description that appears in the Add-on list screen... + addonDescription "simple bhop script" +} \ No newline at end of file diff --git a/temp1/scripts/vscripts/bhop_detector.nut b/temp1/scripts/vscripts/bhop_detector.nut new file mode 100644 index 0000000..2661b7f --- /dev/null +++ b/temp1/scripts/vscripts/bhop_detector.nut @@ -0,0 +1,216 @@ +printl(" Load bunny-hop detect script 1.4.1") + +::BhopVars <- +{ + BunnyHopTimerEnabled = false, + BunnyCounter = array(32,0),//버니 몇번했는지 + LastBunnyTopSpeed = array(32,0),//최고 버니 속도 + LastBunnySpeed = array(32,0),//그냥 버니 속도 + BunnyGroundTime = array(32,0),//땅에 착지한 시간 + BunnyFailFlag = array(32,0),//버니 속도 안나올때 감지 + BunnyDetectCount = 3, + BunnyDetectSpeed = 350, + jumpingList = {} // 점프 시작하면 여기에 넣어줌 Think타이머에서 계속 체크함 +} + +::BhopFunc <- +{ + addThinkTimer = function() + { + local checkThinkTimer = false; + local ent = null; + while (ent = Entities.FindByClassname(ent,"info_target")) + { + if (ent.IsValid() && ent.GetName() == "bhopTimer") + { + ent.Kill(); + break; + } + } + + if(checkThinkTimer == false) + { + ::BhopVars._bhop_detect_timer <- SpawnEntityFromTable("info_target",{targetname = "bhopTimer"}); + if(::BhopVars._bhop_detect_timer != null) + { + ::BhopVars.BunnyHopTimerEnabled = true; + ::BhopVars._bhop_detect_timer.ValidateScriptScope(); + local scrScope = ::BhopVars._bhop_detect_timer.GetScriptScope(); + scrScope["ThinkTimer"] <- ::BhopFunc.Think; + AddThinkToEnt(::BhopVars._bhop_detect_timer,"ThinkTimer"); + } + } + } + loadFile = function() + { + local path = "simple_bunnyhop_detect/bhop_detect_condition.txt"; + local file = FileToString(path); + + if(!file) + { + StringToFile(path,::BhopVars.BunnyDetectCount+","+::BhopVars.BunnyDetectSpeed); + return; + } + + try + { + local arr = split(file,","); + ::BhopVars.BunnyDetectCount = arr[0].tointeger(); + ::BhopVars.BunnyDetectSpeed = arr[1].tointeger(); + + printl("Bunnyhop detect condition : count "+arr[0]+" / speed "+arr[1]); + } + catch(error) + { + printl("Bunnyhop detect condition error : Invaild value"); + } + } + + IsAlive = function(player) + { + if (!player.IsValid()) + { + return false; + } + + local pClass = player.GetClassname(); + + if (pClass == "player" + || pClass == "witch" + || pClass == "infected") + { + return NetProps.GetPropInt(player,"m_lifeState") == 0; + } + else + { + return player.GetHealth() > 0; + } + } + + //실제 버니 체크 + checkBhop = function (player) + { + if(!player) + { + return false; + } + else if(!player.IsValid() || !this.IsAlive(player)) + { + return false; + } + + local vars = ::BhopVars; + local pName = player.GetPlayerName(); + local index = player.GetEntityIndex(); + local LBT = vars.LastBunnyTopSpeed; + local BGT = vars.BunnyGroundTime; + local speed = player.GetVelocity().Length(); + local playerFlag = NetProps.GetPropInt(player,"m_fFlags"); + local isOnGround = playerFlag == ( playerFlag | 1 ); + local Fail = vars.BunnyFailFlag; + + if(speed > LBT[index])//최고 속도 갱신 + { + LBT[index] = speed; + } + + if(isOnGround == true || Fail[index] == 1) + { + //땅에 붙어있는 시간이 0.3초 이상이면 출력 + //왜냐하면 스탠딩 버니에서 실제로 버니가 되고 있는데도 출력되는 버그가있어서 약간 텀을 줘야함 + if(BGT[index] >= 3 || Fail[index] == 1) + { + local BC = vars.BunnyCounter; + local count = BC[index]; + local topspeed = floor(LBT[index]+0.5); + if(count >= vars.BunnyDetectCount && topspeed >= vars.BunnyDetectSpeed) + { + ClientPrint(null,5,"\x04"+pName+"\x01 got \x05"+count+"\x01 bunnyhop"+((count > 1)?"s":"")+ " in a row (top speed: \x05"+topspeed+"\x01)"); + } + BC[index] = 0; + LBT[index] = 0; + vars.LastBunnySpeed[index] = 0; + Fail[index] = 0; + + return false; + } + else + { + BGT[index]++; + } + } + else if(BGT[index] > 0) + { + BGT[index] = 0; + } + } + + Think = function() + { + foreach(index,player in ::BhopVars.jumpingList) + { + if(::BhopFunc.checkBhop(player) == false) + { + delete ::BhopVars.jumpingList[index]; + } + } + } +} + +::BhopEvent <- +{ + OnGameEvent_player_jump = function (params) + { + local vars = ::BhopVars; + if(::BhopVars.BunnyHopTimerEnabled == false) + { + return; + } + + local player = GetPlayerFromUserID(params.userid); + + if(IsPlayerABot(player) == false) + { + local index = player.GetEntityIndex(); + local speed = player.GetVelocity().Length(); + local LBS = vars.LastBunnySpeed; + local pName = player.GetPlayerName(); + local indexName = "bhop"+index; + + if(!(indexName in vars.jumpingList)) + { + if(speed > 150) + { + LBS[index] = 0; + vars.LastBunnyTopSpeed[index] = 0; + vars.jumpingList[indexName] <- player; + } + } + else + { + local incSpeed = speed - LBS[index]; + local BC = vars.BunnyCounter; + if(incSpeed > 0.01 || speed > 300) + { + BC[index]++; + if(speed > vars.LastBunnyTopSpeed[index]) + { + vars.LastBunnyTopSpeed[index] = speed; + } + } + else if(BC[index] > 0) + { + vars.BunnyFailFlag[index] = 1; + vars.BunnyGroundTime[index] = 10; + } + } + + LBS[index] = speed; + } + } +} + +::BhopFunc.addThinkTimer(); +::BhopFunc.loadFile(); + +__CollectEventCallbacks(::BhopEvent, "OnGameEvent_", "GameEventCallbacks", RegisterScriptGameEventListener); \ No newline at end of file diff --git a/temp1/scripts/vscripts/director_base_addon.nut b/temp1/scripts/vscripts/director_base_addon.nut new file mode 100644 index 0000000..5cd49e1 --- /dev/null +++ b/temp1/scripts/vscripts/director_base_addon.nut @@ -0,0 +1,2 @@ +// EntFire( "worldspawn", "RunScriptFile", "bhop_detector" ); +IncludeScript("bhop_detector") \ No newline at end of file