demeler 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +10 -3
- data/lib/demeler.rb +16 -0
- data/lib/demeler/version.rb +2 -2
- data/notes +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a350b5f6a09823e9fed7af88bb7184c3e3dc3826
|
4
|
+
data.tar.gz: fdad247bf7ba8c9d72fe829e1406e1d54f094399
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b94943dcc4d271876540dd8198e459405faffa16d7fbac91f8d4eb468c567e6eb3f3d516a0019baffc328c63a65ad405761ba8b6d9802da1a9bafd2582d8dee2
|
7
|
+
data.tar.gz: 593ce1b7bdbe6337e52b8ab1d7b326970a5578e4bcbe81f5da014ff03f4eda45502ba44267923eaa00679e92b6fec04e1daa34002ca7b89daf14276ca95dd928
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -88,7 +88,7 @@ There are three variables you'll be interested in in Demeler.
|
|
88
88
|
|
89
89
|
* `obj` The object, if any, that was passed as parameter 1 in `new` or `build`. I talk a little more about that one below.
|
90
90
|
* `usr` The object, if any, that was passed as parameter 3 in `build` or parameter 2 in `new`. This object can be anything you need access to in the Demeler script. If you need to pass several objects, simply put them into an array or hash and pass that.
|
91
|
-
* `out` This is an array where the intermediate results are held internally. To convert the array onto a String, use `to_s` or `to_html` if you created the Demeler object with `new
|
91
|
+
* `out` This is an array where the intermediate results are held internally. To convert the array onto a String, use `to_s` or `to_html` if you created the Demeler object with `new`; set parameter 2 to false or true if you used `build`.
|
92
92
|
|
93
93
|
For example,
|
94
94
|
|
@@ -127,8 +127,6 @@ The output is
|
|
127
127
|
<!-- end generated output -->
|
128
128
|
```
|
129
129
|
|
130
|
-
Note that the array is named `data` outside of Demeler, but once it's passed in through parameter 3 (usr) of `build`, inside Demeler it's name is `usr`.
|
131
|
-
|
132
130
|
## Fields from an object can be inserted automatically
|
133
131
|
|
134
132
|
First, a word of warning: if you use variables other than those below, you script will crash. If your script crashes, don't blame Demeler first; look in your script for variables that shouldn't be there.
|
@@ -436,6 +434,15 @@ values | Hash | The names and values of the radio boxes.
|
|
436
434
|
|
437
435
|
The data value in the form object may be a String, Array or Hash. If this is a string, the values are comma separated. If this is an array, the elements are the values. If this is a hash, the values (right hand side of each pair) are the values.
|
438
436
|
|
437
|
+
### def reset(text, opts={})
|
438
|
+
|
439
|
+
The reset shortcut creates a `input` control of type 'reset'.
|
440
|
+
|
441
|
+
Name | Type | Value
|
442
|
+
---- | ---- | -----
|
443
|
+
text | String | The text displayed on the face of the button.
|
444
|
+
opts | Hash | The attributes and options for the control.
|
445
|
+
|
439
446
|
### def select(name, opts, values)
|
440
447
|
|
441
448
|
The select control is unique in that it has `select` tags surrounding a list of `option` tags. Based on the attributes (opts), you can create a pure dropdown list, or a scrolling list. See https://www.w3schools.com for more info on HTML.
|
data/lib/demeler.rb
CHANGED
@@ -223,6 +223,22 @@ class Demeler
|
|
223
223
|
end
|
224
224
|
end
|
225
225
|
|
226
|
+
##
|
227
|
+
# The reset shortcut
|
228
|
+
#
|
229
|
+
# @param [String] text The text which the button will display
|
230
|
+
# @param [Hash] opts Options for the RESET statement
|
231
|
+
#
|
232
|
+
# @example
|
233
|
+
# g.reset("Reset", {})
|
234
|
+
#
|
235
|
+
def reset(text, opts={})
|
236
|
+
attr = {:type=>:reset}
|
237
|
+
attr[:value] = text
|
238
|
+
attr.merge!(opts)
|
239
|
+
tag_generator(:input, attr)
|
240
|
+
end
|
241
|
+
|
226
242
|
##
|
227
243
|
# The select (select_tag) shortcut
|
228
244
|
#
|
data/lib/demeler/version.rb
CHANGED
data/notes
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: demeler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael J. Welch, Ph.D.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This gem takes your ruby input, plus an object such as a Sequel::Model
|
14
14
|
object, and generates HTML code. If the object has values, they're inserted into
|