From 25a5c45c39340bdab6fcd65ce77f055a2efc9f9c Mon Sep 17 00:00:00 2001 From: gintama91 Date: Thu, 5 Oct 2023 10:31:06 +0530 Subject: [PATCH] Auto stash before rebase of "refs/heads/idk" remove docker. --- Dockerfile | 29 +++++++++++++++++++++++++++++ examples/para/para_text.rb | 14 ++++++++++++++ lacci/lib/shoes/widgets/para.rb | 11 ++++++++++- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 examples/para/para_text.rb diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..65a1c1a7a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Use the official Ubuntu as a parent image +FROM ubuntu:20.04 +ARG DEBIAN_FRONTEND=noninteractive + +# Install system dependencies +RUN apt-get update && \ + apt-get install -y curl unzip git autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev libgtk-3-dev libwebkit2gtk-4.0-dev portaudio19-dev + +# RUN apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install asdf +RUN git clone --depth 1 https://github.com/asdf-vm/asdf.git ~/.asdf + +ENV PATH="$PATH:/root/.asdf/bin:/root/.asdf/shims" + +# install ruby +RUN asdf plugin add ruby && \ + asdf install ruby 3.2.0 && \ + asdf global ruby 3.2.0 + +# set working directory +WORKDIR /scarpe + +# Copy whole app +COPY . /scarpe + +# Install gems +RUN bundle install + diff --git a/examples/para/para_text.rb b/examples/para/para_text.rb new file mode 100644 index 000000000..dbdd46f1b --- /dev/null +++ b/examples/para/para_text.rb @@ -0,0 +1,14 @@ +Shoes.app do + stack do + @note = para " your note will appear here" + + @edit_box = edit_box "" + @save_button = button "Save" + + @save_button.click do + new_text = @edit_box.text + @note.text = new_text + alert("Note saved successfully!") + end + end +end diff --git a/lacci/lib/shoes/widgets/para.rb b/lacci/lib/shoes/widgets/para.rb index e12a339aa..65de4705e 100644 --- a/lacci/lib/shoes/widgets/para.rb +++ b/lacci/lib/shoes/widgets/para.rb @@ -29,8 +29,17 @@ def text_children_to_items(text_children) end def replace(*children) - @text_children = children + update_text_children(*children) + end + + def text=(children) + update_text_children(*children) + end + + private + def update_text_children(*children) + @text_children = children # This should signal the display widget to change self.text_items = text_children_to_items(@text_children) end