mrdialog 1.0.4 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4abf284e5f7c5aa297345dbd4506bce9997aae61093f05cb4dab1190f0c40346
4
- data.tar.gz: f667bcca5f8556c139a4ee4d38e210df6f6c9163e3dfab588dfecfa8fa4766e2
3
+ metadata.gz: 2c194aa6f9499029c4c08c29396a683a363ae97f799e6b3f1999ba05b96680aa
4
+ data.tar.gz: 51f8454617486d49b17b09c48483a548c8afc0cff9dd3f57c8de25554393b7c3
5
5
  SHA512:
6
- metadata.gz: f79b47813388ebcf37ae95d3cb3373b792cd6e929c3f83a53fa6818a39fb6909e5096c9b493c89de8ae7f4b9233a4442b0844dd2db067bc7a3f885f88f7a3ffc
7
- data.tar.gz: 89ac7a47299c65fc5fef30fbfd6acaba29e9f80ae20b0fc8d57ce8a65e57cec177f3adfdc6168406882cefe1970a9e776abc04b90ff16fb398b557bfd5decdfe
6
+ metadata.gz: c94e1854275425eca30ae0e3586c16b577c8f31f1a79e2df1a2c856fb4c7581572a84d8f22abf5e0a2703b00e3e1981f8eb2360a6a481c67ecf9c5547f7f9ad0
7
+ data.tar.gz: ee323a123ebec50e080238c0d98a4fb12588ecab8bd2d9c55acc0cfdbc6d9cd6e9af2723ae6048d0677acbc48ad534ed1bc95147e3f8be62d69698441522dfad
data/ChangeLog.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.0.5
2
+ * Wrap values inside single quotes indead of double quotes. If saved values
3
+ are reloaded in a form, special shell characters could get expanded and
4
+ corrupt data. Please update to v1.0.5.
5
+ (Mar-15-2023)
6
+
1
7
  ## 1.0.4
2
8
  * Previously only the OK/Yes button read input from forms, menus and lists.
3
9
  If an extra button is used, it was treated the same as the Cancel/No
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  Copyright (c) Aleks Clarks, http://rdialog.rubyforge.org/
2
- Copyright (c) 2016, Muhammad Muquit, http://www.muquit.com/
2
+ Copyright (c) 2016-2023, Muhammad Muquit, https://www.muquit.com/
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining
5
5
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,177 +1,233 @@
1
1
  ### MRDialog
2
2
 
3
- mrdialog is a pure
4
- [ruby](https://www.ruby-lang.org/) library for the ncurses
5
- [dialog](http://invisible-island.net/dialog/dialog.html) program.
3
+ mrdialog is a pure
4
+ [ruby](https://www.ruby-lang.org/) library for the ncurses
5
+ [dialog](http://invisible-island.net/dialog/dialog.html) program.
6
6
  [dialog](http://invisible-island.net/dialog/dialog.html) is
7
- a command line tool that can present questions, messages, forms using
7
+ a command line tool that can present questions, messages, forms using
8
8
  dialog boxes from a shell script. If you compiled linux kernel and typed 'make
9
9
  menuconfig', configured Linux from command line with various configuration
10
10
  managers, you have used 'dialog' like programs.
11
11
 
12
- However, it is painful to program dialog from shell scripts due to lack of
13
- data structure. You constantly have to watch if the correct number of
12
+ However, it is painful to program dialog from shell scripts due to lack of
13
+ data structure. You constantly have to watch if the correct number of
14
14
  items are specified, if the arguments are in correct order for example. It is
15
- a lot of fun to program dialog from an object oriented scripting language like
15
+ a lot of fun to program dialog from an object oriented scripting language like
16
16
  [ruby](https://www.ruby-lang.org/). Compare the sample shell scripts of dialog program with
17
- the sample ruby scripts of mrdialog in the [samples](samples/) directory, I think you will
18
- agree.
17
+ the sample ruby scripts of mrdialog in the [samples](samples/) directory, I think you will agree. Look at [samples/extra_button/](samples/extra_button/) directory for samples on using an extra button on various input dialogs.
19
18
 
20
19
  MRDialog is based on the rdialog ruby gem http://rdialog.rubyforge.org/ by
21
20
  Aleks Clark.
22
21
 
23
22
  I did the following:
24
23
 
25
- * Added features and support for all of the missing widgets.
26
- * Fixed the bugs I found.
27
- * Implemented the examples for all the widgets.
24
+ - Added features and support for all of the missing widgets.
25
+ - Fixed the bugs I found.
26
+ - Implemented the examples for all the widgets.
28
27
 
29
- If you have bug reports, questions, requests or suggestions, please enter it in the [Issues](https://github.com/muquit/mrdialog/issues) with an appropriate label.
28
+ If you have bug reports, questions, requests or suggestions, please enter it in the [Issues](https://github.com/muquit/mrdialog/issues) with an appropriate label.
30
29
 
31
30
  ### Latest Version
32
- The latest version is 1.0.4.
31
+
32
+ The latest version is 1.0.4.
33
33
  Please look at the [ChangeLog.md](ChangeLog.md) file for details. Please look at he [screenshots](screenshots/) to see how the widgets look like.
34
34
 
35
35
  ### Screenshots
36
- Please look at the [screenshots](screenshots/) directory. There are individual screenshots for each of the widgets. Also the animated GIF file [all.gif](screenshots/all.gif) contains screenshot of all the widgets.
37
36
 
37
+ Please look at the [screenshots](screenshots/) directory. There are individual screenshots for each of the widgets. Also the animated GIF file [all.gif](screenshots/all.gif) contains screenshot of all the widgets.
38
38
 
39
39
  ### Requirements
40
- The [dialog](http://invisible-island.net/dialog/dialog.html) program must be installed. Note: the dialog program that is available in ubuntu is little old. Check the dialog version by typing ```dialog --version```
41
40
 
42
- I tested with ```dialog Version: 1.2-20130928```
41
+ The [dialog](http://invisible-island.net/dialog/dialog.html) program must be installed. Note: the dialog program that is available in ubuntu is little old. Check the dialog version by typing `dialog --version`
42
+
43
+ I tested with `dialog Version: 1.2-20130928`
43
44
 
44
45
  dialog HOME: http://invisible-island.net/dialog/dialog.html.
45
46
 
46
47
  ### To install
47
48
 
48
- ```# gem install mrdialog```
49
+ `# gem install mrdialog`
49
50
  or
50
- ```$ sudo gem install mrdialog```
51
+ `$ sudo gem install mrdialog`
52
+
51
53
  ### To uninstall
52
- ```# gem uninstall mrdialog``` or ```$ sudo gem uninstall mrdialog```
53
-
54
+
55
+ `# gem uninstall mrdialog` or `$ sudo gem uninstall mrdialog`
56
+
54
57
  ### Run the sample apps
58
+
55
59
  Find out where the mrdialog gem is installed. Example:
56
60
 
57
61
  $ gem which mrdialog
58
- /Library/Ruby/Gems/2.0.0/gems/mrdialog-1.0.1/lib/mrdialog.rb
62
+ /Users/muquit/.rvm/gems/ruby-3.0.0/gems/mrdialog-1.0.4/lib/mrdialog.rb
59
63
 
60
- ```cd``` to the ```samples``` directory and run the apps.
64
+ `cd` to the `samples` directory and run the apps.
61
65
  Example:
62
66
 
63
- $ cd /Library/Ruby/Gems/2.0.0/gems/mrdialog-1.0.1/samples
67
+ $ cd /Users/muquit/.rvm/gems/ruby-3.0.0/gems/mrdialog-1.0.4/samples
64
68
  $ ./msgbox.rb
65
69
 
70
+ Look at samples/extra_button/ on how to use an extra button on various input
71
+ dialogs.
66
72
 
67
73
  ### How to use the API
68
- For now, please look at the apps in [samples](samples/) directory to see how the API works.
74
+
75
+ For now, please look at the apps in [samples](samples/) directory to see how the API works.
69
76
 
70
77
  require 'mrdialog'
71
78
  dialog = MRDialog.new
72
79
 
73
80
  #### Properties
74
- The various properties of the dialog (shadow, title etc.) can be set by calling the appropriate setters. The supported propertes are shown below:
75
-
76
- |Property|Example|Description|Default|
77
- |--------|-------|-----------|-------|
78
- |shadow|```dialog.shadow = false``` | Draw a shadow to the right and bottom of each dialog box.| true|
79
- |title|```dialog.title = 'foo'```|Specifies a title string to be displayed at the top of the dialog box|N/A|
80
- |logger|```dialog.logger = Logger.new("dialog.log")```|Debug messages will be logged to the specified ruby Logger|N/A|
81
- |clear|```dialog.clear = true```|Clears the widget screen, keeping only the screen_color background.|false|
82
- |insecure|```dialog.insecure = true```|Makes the password widget friendlier but less secure, by echoing asterisks for each character.|false|
83
- |ascii_lines|```dialog.ascii_lines = true```|Rather than draw graphics lines around boxes, draw ASCII "+" and "-" in the same place. See also "--no-lines".|false|
84
- |rc_file|```dialog.rc_file = "/path/to/rc/file"``` | Use the specified rc file.| "$HOME/.dialogrc"|
85
- |yes_label|```dialog.yes_label = "Sure"``` | Use the specified label on the "Yes" button.| "Yes"|
86
- |no_label|```dialog.no_label = "Nope"``` | Use the specified label on the "No" button.| "No"|
87
- |cancel_label|```dialog.cancel_label = "Forget"``` | Use the specified label on the "Cancel" button.| "Cancel"|
88
- |help_button|```dialog.help_button = true``` | Include a "Help" button on the dialog.| false|
89
- |help_label|```dialog.help_label = "What?"``` | Use the specified label on the "Help" button.| "Help"|
90
- |extra_button|```dialog.extra_button = true``` | Include an "Extra" button on the dialog.| false|
91
- |extra_label|```dialog.extra_label = "More"``` | Use the specified label on the "Extra" button.| "Extra"|
92
- |dialog_options|`dialog.dialog_options="any valid dialog option"` e.g. `dialog.dialog_options="--no-tags"` for checklist|Pass any valid dialog option. `man dialog` and look at the **OPTIONS** section. It is the caller's responsibily to specify correct options, no validation will be done|N/A|
81
+
82
+ The various properties of the dialog (shadow, title etc.) can be set by calling the appropriate setters. The supported properties are shown below:
83
+
84
+ | Property | Example | Description | Default |
85
+ | -------------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
86
+ | shadow | `dialog.shadow = false` | Draw a shadow to the right and bottom of each dialog box. | true |
87
+ | title | `dialog.title = 'foo'` | Specifies a title string to be displayed at the top of the dialog box | N/A |
88
+ | logger | `dialog.logger = Logger.new("dialog.log")` | Debug messages will be logged to the specified ruby Logger | N/A |
89
+ | clear | `dialog.clear = true` | Clears the widget screen, keeping only the screen_color background. | false |
90
+ | insecure | `dialog.insecure = true` | Makes the password widget friendlier but less secure, by echoing asterisks for each character. | false |
91
+ | ascii_lines | `dialog.ascii_lines = true` | Rather than draw graphics lines around boxes, draw ASCII "+" and "-" in the same place. See also "--no-lines". | false |
92
+ | rc_file | `dialog.rc_file = "/path/to/rc/file"` | Use the specified rc file. | "$HOME/.dialogrc" |
93
+ | yes_label | `dialog.yes_label = "Sure"` | Use the specified label on the "Yes" button. | "Yes" |
94
+ | no_label | `dialog.no_label = "Nope"` | Use the specified label on the "No" button. | "No" |
95
+ | cancel_label | `dialog.cancel_label = "Forget"` | Use the specified label on the "Cancel" button. | "Cancel" |
96
+ | help_button | `dialog.help_button = true` | Include a "Help" button on the dialog. | false |
97
+ | help_label | `dialog.help_label = "What?"` | Use the specified label on the "Help" button. | "Help" |
98
+ | extra_button | `dialog.extra_button = true` | Include an "Extra" button on the dialog. | false |
99
+ | extra_label | `dialog.extra_label = "More"` | Use the specified label on the "Extra" button. | "Extra" |
100
+ | dialog_options | `dialog.dialog_options="any valid dialog option"` e.g. `dialog.dialog_options="--no-tags"` for checklist | Pass any valid dialog option. `man dialog` and look at the **OPTIONS** section. It is the caller's responsibility to specify correct options, no validation will be done | N/A |
93
101
 
94
102
  #### Widgets
103
+
95
104
  The following dialog widgets are supported:
96
105
 
97
- * buildlist
98
- * calendar
99
- * checklist
100
- * editbox
101
- * form
102
- * fselect
103
- * gauge
104
- * infobox
105
- * inputbox
106
- * menu
107
- * msgbox
108
- * passwordbox
109
- * passwordform
110
- * pause
111
- * prgbox
112
- * progressbox
113
- * programbox
114
- * radiolist
115
- * timebox
116
- * treeview
117
- * yesno
118
-
106
+ - buildlist
107
+ - calendar
108
+ - checklist
109
+ - editbox
110
+ - form
111
+ - fselect
112
+ - gauge
113
+ - infobox
114
+ - inputbox
115
+ - menu
116
+ - msgbox
117
+ - passwordbox
118
+ - passwordform
119
+ - pause
120
+ - prgbox
121
+ - progressbox
122
+ - programbox
123
+ - radiolist
124
+ - timebox
125
+ - treeview
126
+ - yesno
127
+
119
128
  ##### buildlist
120
- A buildlist dialog displays two lists, side-by-side. The list on the left shows unselected items. The list on the right shows selected items. As items are selected or unselected, they move between the lists. The SPACE bar is used to
129
+
130
+ A buildlist dialog displays two lists, side-by-side. The list on the left shows unselected items. The list on the right shows selected items. As items are selected or unselected, they move between the lists. The SPACE bar is used to
121
131
  select or unselect an item.
122
132
 
123
- Use a carriage return or the "OK" button to accept the current value in the selected-window and exit. The results are written using the order displayed in the selected-window. The caller is responsible to create the items properly. Please look at [buildlist.rb](samples/buildlist.rb) for an example.
133
+ Use a carriage return or the "OK" button to accept the current value in the selected-window and exit. The results are written using the order displayed in the selected-window. The caller is responsible to create the items properly. Please look at [buildlist.rb](samples/buildlist.rb) for an example.
124
134
 
125
135
  returns an array of selected tags
126
136
 
127
137
  result_array = dialog.buildlist(text="Text Goes Here", items, height=0, width=0, listheight=0)
128
-
138
+
129
139
  #### calendar
140
+
130
141
  Please look at [calendar.rb](samples/calendar.rb) for an example.
142
+
131
143
  #### checklist
144
+
132
145
  Please look at [checklist.rb](samples/checklist.rb) for an example.
146
+
133
147
  #### editbox
148
+
134
149
  Please look at [editbox.rb](samples/editbox.rb) for an example.
150
+
135
151
  #### form
136
- Please look at
137
- [form1.rb](samples/form1.rb), [form2.rb](samples/form2.rb), [form3.rb](samples/form3.rb)
152
+
153
+ Please look at
154
+ [form1.rb](samples/form1.rb), [form2.rb](samples/form2.rb), [form3.rb](samples/form3.rb)
138
155
  for examples.
156
+
139
157
  #### fselect
158
+
140
159
  Please look at [fselect.rb](samples/fselect.rb) for an example.
160
+
141
161
  #### gauge
162
+
142
163
  Please look at [gauge.rb](samples/gauge.rb) for an example.
164
+
143
165
  #### infobox
166
+
144
167
  Please look at [infobox.rb](samples/infobox.rb) for an example.
168
+
145
169
  #### inputbox
170
+
146
171
  Please look at [inputbox.rb](samples/inputbox.rb) for an example.
172
+
147
173
  #### menu
174
+
148
175
  Please look at [menubox.rb](samples/menubox.rb) for an example.
176
+
149
177
  #### msgbox
178
+
150
179
  Please look at [msgbox.rb](samples/msgbox.rb) for an example.
180
+
151
181
  #### passwordbox
182
+
152
183
  Please look at [password.rb](samples/password.rb), [password2.rb](samples/password2.rb)
153
184
  for examples.
185
+
154
186
  #### passwordform
187
+
155
188
  Please look at [passwordform.rb](samples/passwordform.rb) for an example.
189
+
156
190
  #### pause
191
+
157
192
  Please look at [pause.rb](samples/pause.rb) for an example.
193
+
158
194
  #### prgbox
195
+
159
196
  Please look at [prgbox.rb](samples/prgbox.rb) for an example.
197
+
160
198
  #### progressbox
199
+
161
200
  Please look at [progressbox.rb](samples/progressbox.rb) for an example.
201
+
162
202
  #### programbox
203
+
163
204
  Please look at [programbox.rb](samples/programbox.rb) for an example.
205
+
164
206
  #### radiolist
207
+
165
208
  Please look at [radiolist.rb](samples/radiolist.rb) for an example.
209
+
166
210
  #### timebox
211
+
167
212
  Please look at [timebox.rb](samples/timebox.rb) for an example.
213
+
168
214
  #### treeview
215
+
169
216
  Please look at [treeview.rb](samples/treeview.rb) for an example.
217
+
170
218
  #### yesno
219
+
171
220
  Please look at [yesno.rb](samples/yesno.rb) for an example.
172
221
 
222
+ ### Dependencies
223
+
224
+ Mrdialog does not have dependencies on any other gems. The gems in Gemfile are
225
+ for development for building the gem.
226
+
227
+
173
228
  ### For Developers
174
- Note: Pre-built mrdialog-1.0.4.gem is in the pkg directory
229
+
230
+ Note: Pre-built mrdialog-1.0.5.gem is in the pkg directory
175
231
 
176
232
  If you need to build the gem yourself:
177
233
 
@@ -180,17 +236,18 @@ Install bundler first:
180
236
  $ gem install bundler
181
237
  $ bundle install
182
238
 
183
- - To build: ```$ rake build```
239
+ - To build: `$ rake build`
184
240
 
185
241
  Will create the gem inside the pkg directory
186
242
 
187
- - To install the built gem: ```$ sudo gem install --local pkg/mrdialog-1.0.4.gem```
243
+ - To install the built gem: `$ sudo gem install --local pkg/mrdialog-1.0.5.gem`
188
244
 
189
- - To install using rake: ```$ sudo rake install```
245
+ - To install using rake: `$ sudo rake install`
190
246
 
191
- - To install the gem to a specific directory: ```$ GEM_HOME=/tmp gem install --local pkg/mrdialog-1.0.4.gem```
247
+ - To install the gem to a specific directory: `$ GEM_HOME=/tmp gem install --local pkg/mrdialog-1.0.5.gem`
192
248
 
193
249
  The gem will be installed in /tmp/gems directory
194
250
 
195
251
  ### Copyright
196
- Lincense is MIT. Please look at the [LICENSE.txt](LICENSE.txt) file for details.
252
+
253
+ License is MIT. Please look at the [LICENSE.txt](LICENSE.txt) file for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.4
1
+ 1.0.6
@@ -188,6 +188,13 @@ class MRDialog
188
188
  # For widgets holding a scrollable set of data, draw a scrollbar
189
189
  # on its right-margin. This does not respond to the mouse.
190
190
  attr_accessor :scrollbar
191
+
192
+ # Normally dialog converts tabs to spaces and reduces multiple
193
+ # spaces to a single space for text which is displayed
194
+ # # in a message boxes, etc. Use this option to disable that feature.
195
+ # Note that dialog will still wrap text, subject to the "--cr-wrap"
196
+ # and "--trim" options. #7
197
+ attr_accessor :no_collapse
191
198
  # -- muquit@muquit.com mod ends---
192
199
 
193
200
  # Returns a new RDialog Object
@@ -276,9 +283,9 @@ class MRDialog
276
283
  cmd << " "
277
284
  cmd << "--gauge"
278
285
  cmd << " "
279
- cmd << '"'
286
+ cmd << "'"
280
287
  cmd << text
281
- cmd << '"'
288
+ cmd << "'"
282
289
  cmd << " "
283
290
  cmd << height.to_s
284
291
  cmd << " "
@@ -309,9 +316,9 @@ class MRDialog
309
316
  cmd << "--progressbox"
310
317
  cmd << " "
311
318
  if description.length > 0
312
- cmd << '"'
319
+ cmd << "'"
313
320
  cmd << description
314
- cmd << '"'
321
+ cmd << "'"
315
322
  end
316
323
  cmd << " "
317
324
  cmd << height.to_s
@@ -330,9 +337,9 @@ class MRDialog
330
337
  cmd << "--programbox"
331
338
  cmd << " "
332
339
  if description.length > 0
333
- cmd << '"'
340
+ cmd << "'"
334
341
  cmd << description
335
- cmd << '"'
342
+ cmd << "'"
336
343
  end
337
344
  cmd << " "
338
345
  cmd << height.to_s
@@ -364,14 +371,14 @@ class MRDialog
364
371
  cmd << "--prgbox"
365
372
  cmd << " "
366
373
  if text.length > 0
367
- cmd << '"'
374
+ cmd << "'"
368
375
  cmd << text
369
- cmd << '"'
376
+ cmd << "'"
370
377
  end
371
378
  cmd << " "
372
- cmd << '"'
379
+ cmd << "'"
373
380
  cmd << command
374
- cmd << '"'
381
+ cmd << "'"
375
382
  cmd << " "
376
383
  cmd << height.to_s
377
384
  cmd << " "
@@ -394,22 +401,22 @@ class MRDialog
394
401
  tmp = Tempfile.new('dialog')
395
402
  itemlist = ''
396
403
  items.each do |item|
397
- itemlist << '"'
404
+ itemlist << "'"
398
405
  itemlist << item[0].to_s
399
- itemlist << '"'
406
+ itemlist << "'"
400
407
  itemlist << " "
401
- itemlist << '"'
408
+ itemlist << "'"
402
409
  itemlist << item[1].to_s
403
- itemlist << '"'
410
+ itemlist << "'"
404
411
  itemlist << " "
405
- itemlist << '"'
412
+ itemlist << "'"
406
413
  if item[2]
407
414
  item[2] = "on"
408
415
  else
409
416
  item[2] = "off"
410
417
  end
411
418
  itemlist << item[2]
412
- itemlist << '"'
419
+ itemlist << "'"
413
420
  itemlist << " "
414
421
  itemlist << item[3].to_s
415
422
  itemlist << " "
@@ -422,10 +429,10 @@ class MRDialog
422
429
  cmd << " "
423
430
  cmd << "--treeview"
424
431
  cmd << " "
425
- cmd << '"'
432
+ cmd << "'"
426
433
  cmd << " "
427
434
  cmd << text
428
- cmd << '"'
435
+ cmd << "'"
429
436
  cmd << " "
430
437
  cmd << height.to_s
431
438
  cmd << " "
@@ -471,22 +478,22 @@ class MRDialog
471
478
  itemlist = ''
472
479
 
473
480
  items.each do |item|
474
- itemlist << '"'
481
+ itemlist << "'"
475
482
  itemlist << item[0].to_s
476
- itemlist << '"'
483
+ itemlist << "'"
477
484
  itemlist << " "
478
- itemlist << '"'
485
+ itemlist << "'"
479
486
  itemlist << item[1].to_s
480
- itemlist << '"'
487
+ itemlist << "'"
481
488
  itemlist << " "
482
- itemlist << '"'
489
+ itemlist << "'"
483
490
  if item[2]
484
491
  item[2] = "on"
485
492
  else
486
493
  item[2] = "off"
487
494
  end
488
495
  itemlist << item[2]
489
- itemlist << '"'
496
+ itemlist << "'"
490
497
  itemlist << " "
491
498
  end
492
499
  itemlist << "2>"
@@ -500,17 +507,17 @@ class MRDialog
500
507
  cmd << " "
501
508
  cmd << "--separator"
502
509
  cmd << " "
503
- cmd << '"'
510
+ cmd << "'"
504
511
  cmd << @separator
505
- cmd << '"'
512
+ cmd << "'"
506
513
  end
507
514
  cmd << " "
508
515
  cmd << "--buildlist"
509
516
  cmd << " "
510
- cmd << '"'
517
+ cmd << "'"
511
518
  cmd << " "
512
519
  cmd << text
513
- cmd << '"'
520
+ cmd << "'"
514
521
  cmd << " "
515
522
  cmd << height.to_s
516
523
  cmd << " "
@@ -552,9 +559,9 @@ class MRDialog
552
559
  cmd << " "
553
560
  cmd << "--pause"
554
561
  cmd << " "
555
- cmd << '"'
562
+ cmd << "'"
556
563
  cmd << text
557
- cmd << '"'
564
+ cmd << "'"
558
565
  cmd << " "
559
566
  cmd << height.to_s
560
567
  cmd << " "
@@ -586,9 +593,9 @@ class MRDialog
586
593
  cmd << " "
587
594
  cmd << "--editbox"
588
595
  cmd << " "
589
- cmd << '"'
596
+ cmd << "'"
590
597
  cmd << filepath
591
- cmd << '"'
598
+ cmd << "'"
592
599
  cmd << " "
593
600
  cmd << height.to_s
594
601
  cmd << " "
@@ -636,17 +643,17 @@ class MRDialog
636
643
  mixed_form = true
637
644
  end
638
645
  items.each do |item|
639
- itemlist << '"'
646
+ itemlist << "'"
640
647
  itemlist << item[0].to_s
641
- itemlist << '"'
648
+ itemlist << "'"
642
649
  itemlist << " "
643
650
  itemlist << item[1].to_s
644
651
  itemlist << " "
645
652
  itemlist << item[2].to_s
646
653
  itemlist << " "
647
- itemlist << '"'
654
+ itemlist << "'"
648
655
  itemlist << item[3].to_s
649
- itemlist << '"'
656
+ itemlist << "'"
650
657
  itemlist << " "
651
658
  itemlist << item[4].to_s
652
659
  itemlist << " "
@@ -678,9 +685,9 @@ class MRDialog
678
685
  end
679
686
  end
680
687
  cmd << " "
681
- cmd << '"'
688
+ cmd << "'"
682
689
  cmd << text
683
- cmd << '"'
690
+ cmd << "'"
684
691
  cmd << " "
685
692
  cmd << height.to_s
686
693
  cmd << " "
@@ -1162,13 +1169,13 @@ class MRDialog
1162
1169
  command = ""
1163
1170
  command << option_string();
1164
1171
  command << " "
1165
- command << '"'
1172
+ command << "'"
1166
1173
  command << "--yesno"
1167
- command << '"'
1174
+ command << "'"
1168
1175
  command << " "
1169
- command << '"'
1176
+ command << "'"
1170
1177
  command << text
1171
- command << '"'
1178
+ command << "'"
1172
1179
  command << " "
1173
1180
  command << height.to_s
1174
1181
  command << " "
@@ -1192,7 +1199,7 @@ class MRDialog
1192
1199
  ostring = exe_loc
1193
1200
  else
1194
1201
  exe_loc = @path_to_dialog
1195
- if !File.exists?(exe_loc)
1202
+ if !File.exist?(exe_loc)
1196
1203
  raise "Specified path of dialog '#{exe_loc}' does not exist"
1197
1204
  end
1198
1205
  if !File.executable?(exe_loc)
@@ -1319,6 +1326,11 @@ class MRDialog
1319
1326
  ostring += "--nocancel "
1320
1327
  end
1321
1328
 
1329
+ # #7
1330
+ if @no_collapse
1331
+ ostring += "--no-collapse "
1332
+ end
1333
+
1322
1334
  return ostring
1323
1335
  end
1324
1336
  end
data/pkg/md5.txt CHANGED
@@ -1 +1 @@
1
- e6497d81db203c5c49dfff90c7870a09 mrdialog-1.0.3.gem
1
+ 376e4b7f9cd6bc76a4444c4979a87bda mrdialog-1.0.5.gem
Binary file
data/samples/yesno.rb CHANGED
@@ -23,7 +23,7 @@ questions that have an answer of either yes or no.
23
23
  BTW, do you notice that long lines will be automatically
24
24
  wrapped around so that they can fit in the box? You can
25
25
  also control line breaking explicitly by inserting
26
- 'backslash n' at any place you like, but in this case,
26
+ "backslash n" at any place you like, but in this case,
27
27
  auto wrap around will be disabled and you will have to
28
28
  control line breaking yourself.
29
29
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mrdialog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleks Clark
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-06-22 00:00:00.000000000 Z
12
+ date: 2023-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
@@ -119,6 +119,7 @@ files:
119
119
  - lib/mrdialog/mrdialog.rb
120
120
  - mrdialog.gemspec
121
121
  - pkg/md5.txt
122
+ - pkg/mrdialog-1.0.5.gem
122
123
  - samples/buildlist.rb
123
124
  - samples/calendar.rb
124
125
  - samples/checklist.rb