This topic needs a title

Anyone know of a library that extends the String class to make portable
boxes?

Like "Content".box(...) do |a, b....|
         ....
end

What is a “portable box”, in this context?
What parameters do you pass to `String#box`?
What are these variables `a`, `b` (and more?) that the method yields?
Do you have an example use case?

···

On 19 Oct 2021, at 18:41, Gregory Cohen <gregorycohen2@gmail.com> wrote:

Anyone know of a library that extends the String class to make portable boxes?

Like "Content".box(...) do |a, b....|
         ....
end

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

A "box" would be any box

An HTML box
A GTK box
A QT box

etc.

I don't know what the argumnts would be

···

On Tue, Oct 19, 2021 at 1:46 PM Tom Lord <lord.thom@gmail.com> wrote:

What is a “portable box”, in this context?
What parameters do you pass to `String#box`?
What are these variables `a`, `b` (and more?) that the method yields?
Do you have an example use case?

> On 19 Oct 2021, at 18:41, Gregory Cohen <gregorycohen2@gmail.com> wrote:
>
>
>
> Anyone know of a library that extends the String class to make portable
boxes?
>
> Like "Content".box(...) do |a, b....|
> ....
> end
>
>
>
>
> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

What is a and b in your example?

···

On Wed, Oct 20, 2021 at 2:41 AM Gregory Cohen <gregorycohen2@gmail.com> wrote:

Anyone know of a library that extends the String class to make portable
boxes?

Like "Content".box(...) do |a, b....|
         ....
end

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

I don't think it extends String, but:

print TTY::Box.frame "Hello\nworld!"
# =>
# ┌──────┐
# │Hello │
# │world!│
# └──────┘

···

On 10/19/21, Gregory Cohen <gregorycohen2@gmail.com> wrote:

Anyone know of a library that extends the String class to make portable
boxes?

Like "Content".box(...) do |a, b....|
         ....
end

You can craft absolutely any DSL you’d fancy in Glimmer: GitHub - AndyObtiva/glimmer: DSL Framework consisting of a DSL Engine and a Data-Binding Library used in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), Glimmer DSL for Opal (Pure Ruby Web GUI), Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library), Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library), Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library), Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS

It does not limit you in any way. I built it because no other DSL I saw in Ruby was as flexible. All had silly limits whether by changing self (very surprising) or over relying on block variables (very cluttered). Not with Glimmer, you can literally design a DSL any way you like with its Expressions following the Interpreter pattern.

Andy

LinkedIn: Andy Maleh - Lexop | LinkedIn
Blog: https://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub

···

On Oct 19, 2021, at 2:33 PM, Frank J. Cameron <fjc@fastmail.net> wrote:

On 10/19/21, Gregory Cohen <gregorycohen2@gmail.com> wrote:

Anyone know of a library that extends the String class to make portable
boxes?

Like "Content".box(...) do |a, b....|
        ....
end

I don't think it extends String, but:

print TTY::Box.frame "Hello\nworld!"
# =>
# ┌──────┐
# │Hello │
# │world!│
# └──────┘

GitHub - piotrmurach/tty-box: Draw various frames and boxes in your terminal window

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

What is an "HTML box"?

···

On Tue, Oct 19, 2021 at 10:51 AM Gregory Cohen <gregorycohen2@gmail.com> wrote:

A "box" would be any box

An HTML box
A GTK box
A QT box

etc.

I don't know what the argumnts would be

On Tue, Oct 19, 2021 at 1:46 PM Tom Lord <lord.thom@gmail.com> wrote:

What is a “portable box”, in this context?
What parameters do you pass to `String#box`?
What are these variables `a`, `b` (and more?) that the method yields?
Do you have an example use case?

> On 19 Oct 2021, at 18:41, Gregory Cohen <gregorycohen2@gmail.com> wrote:
>
>
>
> Anyone know of a library that extends the String class to make portable boxes?
>
> Like "Content".box(...) do |a, b....|
> ....
> end
>
>
>
>
> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

An abstraction

Gtk called its element "Box"

···

On Wed, Oct 20, 2021 at 5:37 PM Hassan Schroeder <hassan.schroeder@gmail.com> wrote:

What is an "HTML box"?

On Tue, Oct 19, 2021 at 10:51 AM Gregory Cohen <gregorycohen2@gmail.com> > wrote:
>
> A "box" would be any box
>
> An HTML box
> A GTK box
> A QT box
>
> etc.
>
> I don't know what the argumnts would be
>
> On Tue, Oct 19, 2021 at 1:46 PM Tom Lord <lord.thom@gmail.com> wrote:
>>
>> What is a “portable box”, in this context?
>> What parameters do you pass to `String#box`?
>> What are these variables `a`, `b` (and more?) that the method yields?
>> Do you have an example use case?
>>
>> > On 19 Oct 2021, at 18:41, Gregory Cohen <gregorycohen2@gmail.com> > wrote:
>> >
>> >
>> >
>> > Anyone know of a library that extends the String class to make
portable boxes?
>> >
>> > Like "Content".box(...) do |a, b....|
>> > ....
>> > end
>> >
>> >
>> >
>> >
>> > Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
>> > <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;
>>
>>
>> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
>> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;
>
>
> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

What is an "HTML box"?

A table?

- but nicer would be real boxes...

···

Am 20.10.21 um 23:37 schrieb Hassan Schroeder:

On Tue, Oct 19, 2021 at 10:51 AM Gregory Cohen <gregorycohen2@gmail.com> wrote:

A "box" would be any box

An HTML box
A GTK box
A QT box

etc.

A div

···

On Thu, Oct 21, 2021 at 1:42 AM Die Optimisten <inform@die-optimisten.net> wrote:

Am 20.10.21 um 23:37 schrieb Hassan Schroeder:
> What is an "HTML box"?

A table?

- but nicer would be real boxes...

>
> On Tue, Oct 19, 2021 at 10:51 AM Gregory Cohen <gregorycohen2@gmail.com> > wrote:
>> A "box" would be any box
>>
>> An HTML box
>> A GTK box
>> A QT box
>>
>> etc.
>>

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;